Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
java, typescript, vscode

調査の方向性

Demo25-javac-on.zip を解凍し、foo\bar\ex02.java と ex01.java および ex03.java を比較して、"java.jdt.ls.javac.enabled":"on" で問題を再現します。package diagnostics と workspace-cache の class-file パスがどのように生成されるかを調査し、その後 ex02.java と ex03.java が package エラーを報告し、キャッシュされたクラスがソースフォルダーを保持していることを確認します。

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

説明

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?

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

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

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

はじめの一歩

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

redhat-developer/vscode-java のほかの issue

redhat-developer/vscode-java の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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