[FEATURE]: Allow configuring project-specific LSP servers (e.g., basedpyright instead of pyright) #6841

Open
opened 2026-02-16 18:05:25 -05:00 by yindo · 1 comment
Owner

Originally created by @nachitog83 on GitHub (Jan 19, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Description:

Currently, OpenCode uses built-in language servers for diagnostics. It would be helpful to allow projects to configure which LSP server to use, so that diagnostics match the project's actual tooling.

Use case:

Our project uses basedpyright (a stricter fork of pyright) for type checking. The built-in pyright sometimes shows different errors or misses issues that basedpyright catches. This leads to a workflow where I have to manually run basedpyright via bash after edits to verify there are no type errors.

Proposed solution:

Allow a configuration option (e.g., in opencode.json or project settings) to specify custom LSP servers per language:

{
  lsp: {
    python: basedpyright
  }
}

The LSP server should be resolved from the project's environment (e.g., virtual environment, node_modules, or PATH) and use the project's configuration files (e.g., pyrightconfig.json, pyproject.toml). This ensures diagnostics respect project-specific settings like strict mode, type checking rules, and import resolution.

This would make the in-editor diagnostics consistent with CI/pre-commit checks and reduce the need for manual verification steps.

Originally created by @nachitog83 on GitHub (Jan 19, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request ### Description: Currently, OpenCode uses built-in language servers for diagnostics. It would be helpful to allow projects to configure which LSP server to use, so that diagnostics match the project's actual tooling. ### Use case: Our project uses basedpyright (a stricter fork of pyright) for type checking. The built-in pyright sometimes shows different errors or misses issues that basedpyright catches. This leads to a workflow where I have to manually run basedpyright via bash after edits to verify there are no type errors. ### Proposed solution: Allow a configuration option (e.g., in opencode.json or project settings) to specify custom LSP servers per language: ```json { lsp: { python: basedpyright } } ``` The LSP server should be resolved from the project's environment (e.g., virtual environment, node_modules, or PATH) and use the project's configuration files (e.g., pyrightconfig.json, pyproject.toml). This ensures diagnostics respect project-specific settings like strict mode, type checking rules, and import resolution. This would make the in-editor diagnostics consistent with CI/pre-commit checks and reduce the need for manual verification steps.
yindo added the discussion label 2026-02-16 18:05:25 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 19, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #5345: [FEATURE]: ty + ruff lsp rather than pyright - Similar request to use alternative Python LSP (ty) instead of pyright
  • #2318: feature request: dmypy/mypy lsp support (python) - Requests mypy LSP support as an alternative to pyright
  • #7405: How to configure LSP? - Discusses need for LSP configuration and fine-tuning
  • #7184: [FEATURE]: Connect to running LSP process - Related feature to allow external LSP process configuration
  • #8712: [FEATURE]: Force LSP usage - Feature request for configurable/forced LSP activation via config

Feel free to ignore if your use case requires something specific these don't address!

@github-actions[bot] commented on GitHub (Jan 19, 2026): This issue might be a duplicate of existing issues. Please check: - #5345: [FEATURE]: ty + ruff lsp rather than pyright - Similar request to use alternative Python LSP (ty) instead of pyright - #2318: feature request: dmypy/mypy lsp support (python) - Requests mypy LSP support as an alternative to pyright - #7405: How to configure LSP? - Discusses need for LSP configuration and fine-tuning - #7184: [FEATURE]: Connect to running LSP process - Related feature to allow external LSP process configuration - #8712: [FEATURE]: Force LSP usage - Feature request for configurable/forced LSP activation via config Feel free to ignore if your use case requires something specific these don't address!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6841