Skip to content

fix(opencode): fixed js lsp servers detection in monorepos - #17359

Closed
tumenbaev wants to merge 1 commit into
anomalyco:devfrom
tumenbaev:fix-lsp-servers
Closed

tumenbaev wants to merge 1 commit into
anomalyco:devfrom
tumenbaev:fix-lsp-servers

Conversation

@tumenbaev

@tumenbaev tumenbaev commented Mar 13, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #7690

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

In monorepo setups, LSP servers for JavaScript/TypeScript languages (TypeScript, ESLint, and Astro) were failing to start because the module resolution for tsserver and eslint was using Instance.directory (the monorepo root) instead of the detected package root. This caused issues when TypeScript or ESLint were installed locally in individual packages rather than at the monorepo root. This is how biome is configured already and it works correctly.

The fix updates the Module.resolve calls in the spawn functions for TypeScript, ESLint, and Astro LSP servers to use the root parameter (the package-specific directory) instead of Instance.directory.

This ensures LSP servers can properly detect and use locally installed dependencies in monorepo environments.

How did you verify your code works?

I tested the changes in a monorepo setup with multiple JavaScript/TypeScript packages, verifying that LSP servers now start correctly and resolve dependencies from the correct package directories.

Screenshots / recordings

-

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

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

Potential Duplicate Found:

Why it's related: Both PRs address the same issue (#7690) about fixing LSP server root detection for ESLint and TypeScript in monorepo setups. PR #7691 appears to be the original fix for the exact same problem - fixing ESLint and tsserver LSP root detection to use the package-specific directory instead of the monorepo root.

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.

LSP detection in monorepo not working

2 participants