Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Package error not reported with "java.jdt.ls.javac.enabled":"on"

Đang mở
#4,414 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
java, typescript, vscode

Hướng nghiên cứu

Giải nén Demo25-javac-on.zip và tái hiện vấn đề với "java.jdt.ls.javac.enabled":"on" bằng cách so sánh foo\bar\ex02.java với ex01.java và ex03.java. Kiểm tra cách các chẩn đoán package và các đường dẫn class-file của workspace-cache được tạo ra, sau đó xác minh rằng ex02.java và ex03.java báo cáo lỗi package, đồng thời các lớp được lưu trong bộ nhớ đệm vẫn giữ các thư mục nguồn của chúng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Describe the bug
When using "java.jdt.ls.javac.enabled":"on" on a unmanaged project, if the package does not match the folder hierarchy, no error is reported in VSCode interface

To Reproduce

  1. Unzip Demo25-javac-on.zip
  2. Open folder ... Demo25-javac-on
  3. Open file foo\bar\ex02.java -> The package is incorrect (bar instead of foo.bar) but no error is reported
  4. File ex01.java has the correct package
  5. File ex03.java has no package (compact source file)

Expected behavior
A package error should be reported for ex02.java and ex03.java . In fact, the class file are not placed in the correct folders in the workspace cache folder (see left side of the picture below). When javac is on, the class are placed in folders according to the package declared in the java file instead of the original folder hierarchy. So since the class file matches the package, no package error is reported. The correct behavior is to keep the class files in the same folders of the source java files like when javac is off (right side of picture below)

Screenshots
Image

Environment

  • Operating System: Debian 13
  • JDK version: 25
  • Visual Studio Code version: 1.121
  • Java extension version: 1.54.0

Additional Information
Maybe it is a problem in the JDT-LS from Eclipse?

Ngôn ngữ chính
TypeScript
Star
2.3k
Fork
547
Merge trung bình
20 giờ 9 phút
Pull request đã merge (30 ngày)
10

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của redhat-developer/vscode-java

Tất cả issue của redhat-developer/vscode-java

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.