JDT LS fails to resolve lombok.config in single-folder Maven projects
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
Rechercherichtung
Beginne damit, Lombok's FileSystemSourceCache.forUri() und EclipseAST.getAbsoluteFileLocation() durch JDT LS' Behandlung von single-folder und Invisible Project zu verfolgen. Vergleiche die Quell-Datei-URIs und die Auflösung des Projektstamms mit dem workspace mode; das Issue ist abgeschlossen, wenn die root lombok.config im single-folder mode gefunden wird und ihre Einstellungen die Sprachfunktionen des Editors beeinflussen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Bug Report Issue: lombok.config not loaded in single-folder Maven project
Describe the bug
When opening a Maven multi-module project via VSCode's "Open Folder" (single-folder mode), the lombok.config file at the project root is completely ignored. Lombok annotations work (e.g., @Data, @Getter), but all settings in lombok.config (such as lombok.accessors.chain=true, lombok.tostring.callsuper=CALL) are not applied. The editor shows errors where it shouldn't, e.g., setter methods not returning this for chaining, or toString() not calling super.toString().
The project compiles fine from command line (mvn clean compile passes without errors), which confirms the lombok.config file itself is correct and Maven picks it up properly. The issue is exclusively within the JDT Language Server's handling of lombok.config in VSCode's single-folder mode.
Notably, opening the same project via .code-workspace file (workspace mode) works correctly — lombok.config is loaded and all settings take effect.
To Reproduce
- Create or open a Maven multi-module project with a
lombok.configfile at the project root directory - Open the project via VSCode's "Open Folder" (single-folder mode, NOT workspace mode)
- Configure
lombok.configwith non-default settings, e.g.:lombok.accessors.chain=true lombok.tostring.callsuper=CALL lombok.equalsandhashcode.callsuper=CALL - Create a class with
@Dataannotation and verify:- Setters should return
this(chain = true) but they returnvoid(default behavior) toString()should callsuper.toString()but it doesn't
- Setters should return
- Run
mvn clean compilefrom terminal — this works correctly, confirming the config file is valid
Expected behavior
lombok.config at the project root should be discovered and applied by JDT LS, even in single-folder mode. All configured settings (chain, callsuper, etc.) should take effect in the editor's language features.
Environment
| Item | Value |
|---|---|
| Operating System | Windows 11 Home Chinese Edition (Version 2009) |
| JDK | Oracle GraalVM 21.0.10+8.1 (build 21.0.10+8-LTS-jvmci-23.1-b84) |
| Visual Studio Code | 1.128.0 (x64) |
| Java Extension (redhat.java) | 1.55.0 |
| Java Extension Pack | 0.31.1 |
| Lombok version | 1.18.46 |
| Project type | Maven multi-module (ruoyi-vue-pro) |
Additional Information
What works
- Opening the project via
.code-workspacefile (workspace mode):lombok.configloads correctly mvn clean compilefrom command line: compiles correctly with all lombok.config settings applied
What does NOT work (all attempted and failed)
- Lombok version upgrade: Using 1.18.46, well above the 1.18.28 fix for Eclipse 4.27 compatibility (issue #2887)
- Manual
-javaagentinjection: Settingjava.jdt.ls.vmargsto-javaagent:<path>/lombok-1.18.46.jarin.vscode/settings.json— no effect - Disabling built-in Lombok support: Setting
java.jdt.ls.lombokSupport.enabled: false+ manual javaagent — no effect - Copying
lombok.configtosrc/main/java/: No effect - Removing
config.stopBubbling: No effect Java: Clean Java Language Server Workspaceafter each change: No effect
Suspected root cause
Based on Lombok source code analysis (FileSystemSourceCache.forUri() and EclipseAST.getAbsoluteFileLocation()), the issue likely lies in how JDT LS resolves the source file URI in single-folder mode. In workspace mode, the .code-workspace file provides a clear project root context, allowing JDT LS to pass correct absolute file paths to Lombok. In single-folder mode, the Invisible Project mechanism may resolve URIs differently, causing Lombok's lombok.config discovery (which walks up from the source file's parent directory) to never reach the actual project root directory where lombok.config resides.
Related issues
- #2887 —
lombok.config ignored in 1.14.0(fixed in Lombok 1.18.28 for Eclipse 4.27 compatibility) - projectlombok/lombok#3332 — The upstream Lombok fix for Eclipse 4.27
lombok.config content
lombok.tostring.callsuper=CALL
lombok.equalsandhashcode.callsuper=CALL
lombok.accessors.chain=true
- Vorherrschende Sprache
- TypeScript
- Sterne
- 2.3k
- Forks
- 547
- Ø Merge
- 7 Std. 38 Min.
- Gemergte PRs (30 T.)
- 12
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus redhat-developer/vscode-java
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
redhat-developer/vscode-java#4426 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Red Hat Not ActivatingOffenbug documentation
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 25/100
redhat-developer/vscode-java#4516 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
redhat-developer/vscode-java#4506 · 7 Kommentare · 4 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
redhat-developer/vscode-java#4505 · 5 Kommentare · 2 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 62/100
redhat-developer/vscode-java#4502 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in redhat-developer/vscode-java
Ähnliche Issues
-
Mend: dependency security vulnerability untriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
opensearch-project/security-dashboards-plugin#2545 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Add: Dream TR SDOffencheck:passed streams:add
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
doctor integrity sample scans soft-deleted pages on Postgres (batch path has no deleted_at filter)Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
SocialGouv/egapro#4672 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
area:agents area:tui bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
anthropics/claude-code#98358 ·
Maintainer antworten meist innerhalb von 1 Tag