fix(opencode): resolve LSP dependencies from workspace root#27694
Open
samiralibabic wants to merge 1 commit into
Open
fix(opencode): resolve LSP dependencies from workspace root#27694samiralibabic wants to merge 1 commit into
samiralibabic wants to merge 1 commit into
Conversation
Author
|
Updated the PR description to match the template. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
e196a07 to
68c0adb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #18694
Addresses #7690
Type of change
What does this PR do?
OpenCode can be launched from a monorepo root while the language project for a file lives in a child directory. Some built-in LSP servers already detect that child root, but still resolve project-local dependencies from the launch directory.
This changes built-in JS-family LSP dependency resolution to prefer the detected workspace root first, then fall back to the launch directory.
Changes:
typescript/lib/tsserver.jsfrom the detected root before the launch directory.eslintfrom the detected root before the launch directory.package.json,tsconfig.json, andjsconfig.json, not only lockfiles.This keeps existing fallback behavior while fixing child-package monorepo layouts.
How did you verify your code works?
bun test test/lsp test/config/lsp.test.ts test/tool/lsp.test.tsbun typecheckAlso tested locally with OpenCode launched from a repo root where the TypeScript package lives in a child directory.
Screenshots / recordings
N/A. This is not a UI change.
Checklist