[PR #12123] fix: Multiple jdtls LSPs eating memory in java monorepos #14074

Open
opened 2026-02-16 18:18:53 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12123

State: open
Merged: No


What does this PR do?

In monorepos, starts jdtls at the project root* to let it discover and handle all submodules with a single process.

*Uses the project markers already used for kotlin-ls.

There's some complexity which I think is necessary to handle all cases - hopefully explained by the inline comments.

Fixes: https://github.com/anomalyco/opencode/issues/11368

How did you verify your code works?

Ran in gradle monorepo, reading files from multiple modules:

Before:

LSP
jdtls module-a
jdtls module-b
jdtls module-c

After:

LSP
jdtls

Made edits and got correct diagnostics in tool results.

Ran in single project repo, made edits

Thanks

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12123 **State:** open **Merged:** No --- ### What does this PR do? In monorepos, starts `jdtls` at the project root* to let it discover and handle all submodules with a single process. *Uses the project markers already used for [kotlin-ls](https://github.com/anomalyco/opencode/blob/af06175b1f293ea13d4165cee56db65fbbd56c65/packages/opencode/src/lsp/server.ts#L1235-L1245). There's some complexity which I think is necessary to handle all cases - hopefully explained by the inline comments. Fixes: https://github.com/anomalyco/opencode/issues/11368 ### How did you verify your code works? Ran in gradle monorepo, reading files from multiple modules: Before: ``` LSP jdtls module-a jdtls module-b jdtls module-c ``` After: ``` LSP jdtls ``` Made edits and got correct diagnostics in tool results. Ran in single project repo, made edits Thanks
yindo added the pull-request label 2026-02-16 18:18:53 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14074