Skip to content

Fix Java LSP completion for git-backed projects (follow symlinks) - #6038

Merged
delchev merged 1 commit into
masterfrom
fix/jdtls-symlink-classpath
Jun 19, 2026
Merged

Fix Java LSP completion for git-backed projects (follow symlinks)#6038
delchev merged 1 commit into
masterfrom
fix/jdtls-symlink-classpath

Conversation

@delchev

@delchev delchev commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Problem

In the Monaco editor, Java code completion resolves only standard JRE packages (java.util.*, etc.) but not org.eclipse.dirigible.sdk.* nor the project's own Java types. Root cause: the JDT.LS .project/.classpath descriptors are never generated for the project, so JDT.LS falls back to a JRE-only default project.

Root cause

git-backed workspace projects are symlinks into the repository's .git store, e.g.:

users/<user>/workspace/<project>  ->  repository/.git/<user>/workspace/<project>/<project>

JdtLsManager.containsJavaFile() walked the project directory with Files.walk(dir, 5) without FileVisitOption.FOLLOW_LINKS. When the start path is a symlink, Files.walk treats it as a non-traversable file, descends into nothing, and finds zero .java. The project is therefore filtered out of ensureEclipseProjectFilesForWorkspace(), the descriptors are never written, and JDT.LS gives JRE-only completion.

This affects every git-cloned / git-backed Java project (the common case — e.g. the dirigiblelabs/sample-intent-model clone used by IntentEditorLoadsIT). It is unrelated to the recent Monaco upgrade (#6025), which only touched the in-browser TS/JS/HTML language services.

Fix

Pass FileVisitOption.FOLLOW_LINKS to Files.walk in containsJavaFile() so the symlinked project directory is traversed.

Verification

  • Module compiles: mvn -o -pl components/ide/ide-java-lsp compile.
  • On the sample-intent-model workspace project (a git clone), the directory walk finds 0 .java files before the change and 17 after — so the project is now recognized and its .project/.classpath are generated.

Follow-up (not in this PR)

Worth validating that JDT.LS resolves the symlinked project cleanly on import; if Eclipse balks at the symlink, a further step would be to generate/import descriptors against the resolved real path.

🤖 Generated with Claude Code

git-backed workspace projects are symlinks into the repository's .git
store (e.g. users/<u>/workspace/<project> -> repository/.git/.../​<project>).
JdtLsManager.containsJavaFile() walked the project dir with Files.walk(dir, 5)
WITHOUT FileVisitOption.FOLLOW_LINKS, so when the project directory is a
symlink, Files.walk treats it as a non-traversable file, finds zero .java,
and the project is filtered out of ensureEclipseProjectFilesForWorkspace().

Consequence: .project/.classpath are never generated for such projects, so
JDT.LS falls back to a JRE-only default project - java.util.* completes but
org.eclipse.dirigible.sdk.* and the project's own types do not.

Fix: pass FileVisitOption.FOLLOW_LINKS to Files.walk so the symlinked project
is traversed. Verified on the sample-intent-model workspace project (a git
clone): 0 .java found before, 17 after.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@delchev
delchev merged commit 23e6fa6 into master Jun 19, 2026
12 checks passed
@delchev
delchev deleted the fix/jdtls-symlink-classpath branch June 19, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant