diff options
| author | opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com> | 2025-12-23 22:37:49 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-23 22:37:49 -0600 |
| commit | 6097d6af862002a559cdc0c8ffa5e69f5f746406 (patch) | |
| tree | e2b5eb9cac8c6c453292ab95be8eb21ce551e7dd /packages/web/src/content/docs/lsp.mdx | |
| parent | 09d2febe278ffe49ca6c22b9eca96cc99a6f6f9a (diff) | |
| download | opencode-6097d6af862002a559cdc0c8ffa5e69f5f746406.tar.gz opencode-6097d6af862002a559cdc0c8ffa5e69f5f746406.zip | |
docs: experimental LSP tool (#5943)
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: Aiden Cline <[email protected]>
Co-authored-by: Aiden Cline <[email protected]>
Diffstat (limited to 'packages/web/src/content/docs/lsp.mdx')
| -rw-r--r-- | packages/web/src/content/docs/lsp.mdx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/packages/web/src/content/docs/lsp.mdx b/packages/web/src/content/docs/lsp.mdx index 230f782d3..0b79fa329 100644 --- a/packages/web/src/content/docs/lsp.mdx +++ b/packages/web/src/content/docs/lsp.mdx @@ -51,6 +51,34 @@ You can disable automatic LSP server downloads by setting the `OPENCODE_DISABLE_ --- +## LLM Tool (Experimental) + +OpenCode includes an experimental built-in tool named `lsp` that lets the LLM query your LSP servers for code navigation and symbol information. + +To enable it, set `OPENCODE_EXPERIMENTAL_LSP_TOOL=true` (or `OPENCODE_EXPERIMENTAL=true` to enable all experimental features). + +Once enabled, you can still disable it via your `tools` config: + +```json title="opencode.json" +{ + "$schema": "https://opencode.ai/config.json", + "tools": { + "lsp": false + } +} +``` + +Example prompts: + +- "Use the lsp tool to go to definition of `createServer` in `src/server.ts` at line 12, character 5." +- "Use lsp hover on `User` in `src/models/user.ts` at line 20, character 10." + +:::note +The `lsp` tool only works when an LSP server is available for the file type. +::: + +--- + ## How It Works When opencode opens a file, it: |
