redhat-developer / redhat-developer/vscode-java

Cannot disable Language Support for Java in `node_modules`

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

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

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

Mô tả

Issue description

When I open a react-native project, the Language Support for Java scans all the files inside node_modules and shows an error if they have some invalid syntax. I want to be able to disable running the Language Support scan inside node_modules, since then the problem is emphasised in the Project Explorer tab:

Screenshot 2023-09-04 at 16 28 41
Environment
  • Operating System: macOS
  • JDK version: 17.0.8
  • Visual Studio Code version: 1.81.1
  • Java extension version: 1.21.0
Steps To Reproduce
  1. Create a React-Native project: (i.e. npx react-native init testProject);
  2. Add a dependency which has some invalid syntax recognized by the extension: (yarn add @react-native-clipboard/clipboard);
  3. Open the project in VSCode with the extension installed and wait until the error pops up.
Current Result

If you followed the steps above you should get in the error panels a log like:

[{
	"resource": "/Users/test/testProject/node_modules/@react-native-clipboard/clipboard/android/.settings/org.eclipse.buildship.core.prefs",
	"owner": "_generated_diagnostic_collection_name_#4",
	"code": "0",
	"severity": 8,
	"message": "Invalid Gradle project configuration file: .settings/org.eclipse.buildship.core.prefs",
	"source": "Java",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 1,
	"endColumn": 1
}]
Expected Result

The extension should not trigger any error in the node_modules folder, since it should be skipped as indicated by the default config java.project.resourceFilters, which is ["node_modules",".git"].

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.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện chẩn đoán với dự án React Native được báo cáo và theo dõi cách thiết lập java.project.resourceFilters xử lý node_modules. Xác nhận rằng các bộ lọc mặc định sẽ ngăn các chẩn đoán của Language Support tại đó, trong khi quá trình quét Java vẫn tiếp tục bình thường bên ngoài các thư mục bị loại trừ.

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

Đánh giá

Công nghệ
java, react-native, typescript, vscode
Lĩnh vực
developer-experience, tooling
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

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.