Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/core/src/v1/config/lsp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const builtinServerIds = [
"tinymist",
"haskell-language-server",
"julials",
"taplo",
]

export const requiresExtensionsForCustomServers = Schema.makeFilter<
Expand Down
1 change: 1 addition & 0 deletions packages/opencode/src/lsp/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,5 @@ export const LANGUAGE_EXTENSIONS: Record<string, string> = {
".nix": "nix",
".typ": "typst",
".typc": "typst",
".toml": "toml",
} as const
17 changes: 17 additions & 0 deletions packages/opencode/src/lsp/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1981,3 +1981,20 @@ export const JuliaLS: Info = {
}
},
}

export const Taplo: Info = {
id: "taplo",
extensions: [".toml"],
root: NearestRoot(["taplo.toml", ".taplo.toml", ".git"]),
async spawn(root) {
const bin = which("taplo")
if (!bin) {
return
}
return {
process: spawn(bin, ["lsp", "stdio"], {
cwd: root,
}),
}
},
}
1 change: 1 addition & 0 deletions packages/web/src/content/docs/lsp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ OpenCode comes with several built-in LSP servers for popular languages:
| sourcekit-lsp | .swift, .objc, .objcpp | `swift` installed (`xcode` on macOS) |
| svelte | .svelte | Auto-installs for Svelte projects |
| terraform | .tf, .tfvars | Auto-installs from GitHub releases |
| taplo | .toml | `taplo` command available |
| tinymist | .typ, .typc | Auto-installs from GitHub releases |
| typescript | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts | `typescript` dependency in project |
| vue | .vue | Auto-installs for Vue projects |
Expand Down
Loading