redhat-developer / redhat-developer/vscode-java

Cannot disable Language Support for Java in `node_modules`

オープン
#3,271 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
TypeScript
スター
2.3k
フォーク
546
平均マージ
20時間 1分
マージ済み PR(30日)
11

説明

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"].

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

報告されている React Native プロジェクトで診断を再現することから始め、java.project.resourceFilters 設定が node_modules をどのように処理するかを追跡します。デフォルトのフィルターによってそこでの Language Support の診断が抑制される一方、除外されたフォルダーの外では Java のスキャンが通常どおり継続することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, react-native, typescript, vscode
領域
developer-experience, tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。