redhat-developer / redhat-developer/vscode-java

Renaming module folders is not synchronized with the Java Project Manager and may result in renaming ghost folders

Offen
#4,294 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
TypeScript
Sterne
2.3k
Forks
546
Ø Merge
20 Std. 1 Min.
Gemergte PRs (30 T.)
11

Beschreibung

Description: The Java Project Management view fails to synchronize with file system changes. When renaming a module folder via the file explorer, the Java Language Server does not detect or reflect the rename operation, resulting in a desynchronization between the project metadata and the actual file system state. The recreation of the old folder is a side effect of this synchronization failure.

Build Tool: Maven
OS: Windows 11 25H2

Steps to Reproduce:

  1. Open a workspace folder that contains multiple Java sub-projects (modules).
  2. Wait for the Java Language Server to finish importing and indexing all projects.
  3. Rename one of the sub-project folders (e.g., rename old-module-name to new-module-name) using the OS file
    explorer or the IDE's built-in file tree.
  4. Observe the Java Project Explorer/Manager view.

Actual Result:

  • The Java Project Manager still displays old-module-name.
  • The system recreates a new folder named old-module-name in the file system containing target and other
    directories (side effect of the sync failure).
  • The new-module-name folder is treated as an unlinked plain folder rather than a Java module.

Expected Behavior:

  • The Java Project Manager should detect the folder rename operation.
  • The project metadata should be updated or re-indexed to reflect the name change, maintaining synchronization with
    the file system.

Additional Context:
Running the command "Java: Clean Workspace Cache" and restarting the language server resolves the issue and
correctly reflects the new folder name. This confirms that the Language Server's cache retains stale file paths and
fails to monitor file system rename events, causing the desynchronization and subsequent side effects.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere die Umbenennung nach dem Import eines Java-Projekts und beginne dann mit dem im Bericht beschriebenen Verhalten des Befehls Java: Clean Workspace Cache und der Synchronisierung des Language Servers. Erledigt ist es, wenn der Java Project Manager den neuen Ordnernamen widerspiegelt, ohne den alten Ordner neu zu erstellen, und der umbenannte Ordner weiterhin als Java-Modul verknüpft bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java, vscode
Bereich
developer-experience, tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.