Skip to content

fix(opencode): prefer monorepo roots for jdtls#14049

Open
kurochenko wants to merge 2 commits intoanomalyco:devfrom
kurochenko:fix/jdtls-monorepo-root-selection
Open

fix(opencode): prefer monorepo roots for jdtls#14049
kurochenko wants to merge 2 commits intoanomalyco:devfrom
kurochenko:fix/jdtls-monorepo-root-selection

Conversation

@kurochenko
Copy link

Summary

  • make JDTLS root detection prefer monorepo markers (settings.gradle(.kts)), then wrapper markers (gradlew), and only then nearest module build files
  • this prevents spawning one JDTLS process per Gradle module in Java monorepos and keeps a single shared server for a repo
  • add root-selection tests covering Groovy Gradle (settings.gradle/build.gradle) and Kotlin DSL (*.kts) cases

Verification

  • bun test test/lsp/server-root.test.ts
  • bun test test/lsp/*.test.ts

Fixes #11368

@github-actions
Copy link
Contributor

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

I found a potentially related PR:

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

This PR appears to address the same core issue - preventing multiple JDTLS processes from being spawned in Java monorepos. The current PR (14049) seems to be a continuation or refinement of this work, implementing the specific root detection strategy to solve the issue (#11368) that was likely identified in or related to PR #12123.

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 redundant per-module processes in Java monorepos, causing OOM

1 participant