Skip to content

LSP not working? #118

@hugo-hsi-dev

Description

@hugo-hsi-dev

I've got some issues with the lsp tooling. I tried having opencode test them out on a some sandbox .ts and .svelte file and none of the lsp_* tools work. It seems like no LSP servers are available despite them working on the opencode side. Here's a screenshot:

Image

Adding this here if you prefer to read the raw text.

Initial prompt (as received)
“can you try running all the lsp_* tools against @src/lib/features/auth/components/batch.svelte and @src/lib/features/auth/remotes/batch-test.remote.ts. Report back to me this initial prompt and a short overview of the results of your findings, whether they work or not.”
What happened when running lsp_* tools
1) LSP availability (lsp_servers)
No LSP servers are configured/installed for either .svelte or .ts in this environment:
- svelte [not installed]
- typescript-language-server [not installed]
- typescript [not installed]
- (others also show [not installed])
2) Results per lsp_* tool call
Because there’s no LSP server configured for these file extensions, every lsp_* operation against these files failed immediately with the same class of error:
- lsp_diagnostics on batch.svelte → Error: No LSP server configured for extension: .svelte
- lsp_diagnostics on batch-test.remote.ts → Error: No LSP server configured for extension: .ts
- lsp_document_symbols (both files) → same “No LSP server configured…” error
- lsp_workspace_symbols → same error
- lsp_hover / lsp_goto_definition / lsp_find_references / lsp_prepare_rename / lsp_code_actions → same error
3) Net conclusion
The lsp_* tools do not work here right now for these files, not due to your code, but because the required language servers (Svelte + TypeScript) are not installed/configured in this runtime.

I know that the README has this excerpt...

LSP

OpenCode provides LSP tools for analysis.
Oh My OpenCode adds refactoring tools (rename, code actions).
All OpenCode LSP configs and custom settings (from opencode.json) are supported, plus additional Oh My OpenCode-specific settings.

Add LSP servers via the lsp option in ~/.config/opencode/oh-my-opencode.json or .opencode/oh-my-opencode.json:

{
  "lsp": {
    "typescript-language-server": {
      "command": ["typescript-language-server", "--stdio"],
      "extensions": [".ts", ".tsx"],
      "priority": 10
    },
    "pylsp": {
      "disabled": true
    }
  }
}

Is it required to add this to the configuration?
Is it required to install these servers globally or are we supposed to use the ones spawned by opencode?

I guess I'm just looking for more guidance on how to set it up properly. Many thanks for the awesome plugin!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions