Skip to content

fix(lsp): resolve JDTLS root to Gradle workspace root in monorepos#14192

Open
ChrisJamesHassell wants to merge 1 commit intoanomalyco:devfrom
ChrisJamesHassell:chassell/cleanup-subagent-lsp
Open

fix(lsp): resolve JDTLS root to Gradle workspace root in monorepos#14192
ChrisJamesHassell wants to merge 1 commit intoanomalyco:devfrom
ChrisJamesHassell:chassell/cleanup-subagent-lsp

Conversation

@ChrisJamesHassell
Copy link

Closes #14191

Summary

  • JDTLS root function now walks up from the nearest subproject marker to find settings.gradle/settings.gradle.kts, so all subprojects in a Gradle monorepo share a single JDTLS instance instead of spawning one per subproject
  • JDTLS temp data directories are cleaned up on shutdown via Handle.cleanup

Verification

All 7 LSP tests pass (bun test test/lsp/ from packages/opencode), including 4 new tests covering workspace root resolution and cleanup. Typecheck clean.

JDTLS spawned a separate process per subproject in Gradle monorepos because
the root function resolved to the nearest build.gradle instead of the
workspace root (settings.gradle). Walk up from the subproject to find the
Gradle workspace root, matching how RustAnalyzer already handles Cargo
workspaces.

Also clean up JDTLS temp data directories on shutdown via Handle.cleanup.
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Found 2 potentially related PRs (excluding the current PR #14192):

  1. PR fix(opencode): prefer monorepo roots for jdtls #14049 - "fix(opencode): prefer monorepo roots for jdtls"

  2. PR fix: Multiple jdtls LSPs eating memory in java monorepos #12123 - "fix: Multiple jdtls LSPs eating memory in java monorepos"

Both PRs appear to be addressing the same issue domain. PR #14049 looks particularly relevant as it specifically targets monorepo root preference for JDTLS, which is the core of PR #14192.

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.

JDTLS spawns separate process per subproject in Gradle monorepos

1 participant

Comments