df03300211
- Split 25+ index.ts files into hook.ts + extracted modules - Rename all catch-all utils.ts/helpers.ts to domain-specific names - Split src/tools/lsp/ into ~15 focused modules - Split src/tools/delegate-task/ into ~18 focused modules - Separate shared types from implementation - 155 files changed, 60+ new files created - All typecheck clean, 61 tests pass
92 lines
5.9 KiB
TypeScript
92 lines
5.9 KiB
TypeScript
import type { LSPServerConfig } from "./types"
|
|
|
|
export const LSP_INSTALL_HINTS: Record<string, string> = {
|
|
typescript: "npm install -g typescript-language-server typescript",
|
|
deno: "Install Deno from https://deno.land",
|
|
vue: "npm install -g @vue/language-server",
|
|
eslint: "npm install -g vscode-langservers-extracted",
|
|
oxlint: "npm install -g oxlint",
|
|
biome: "npm install -g @biomejs/biome",
|
|
gopls: "go install golang.org/x/tools/gopls@latest",
|
|
"ruby-lsp": "gem install ruby-lsp",
|
|
basedpyright: "pip install basedpyright",
|
|
pyright: "pip install pyright",
|
|
ty: "pip install ty",
|
|
ruff: "pip install ruff",
|
|
"elixir-ls": "See https://github.com/elixir-lsp/elixir-ls",
|
|
zls: "See https://github.com/zigtools/zls",
|
|
csharp: "dotnet tool install -g csharp-ls",
|
|
fsharp: "dotnet tool install -g fsautocomplete",
|
|
"sourcekit-lsp": "Included with Xcode or Swift toolchain",
|
|
rust: "rustup component add rust-analyzer",
|
|
clangd: "See https://clangd.llvm.org/installation",
|
|
svelte: "npm install -g svelte-language-server",
|
|
astro: "npm install -g @astrojs/language-server",
|
|
"bash-ls": "npm install -g bash-language-server",
|
|
jdtls: "See https://github.com/eclipse-jdtls/eclipse.jdt.ls",
|
|
"yaml-ls": "npm install -g yaml-language-server",
|
|
"lua-ls": "See https://github.com/LuaLS/lua-language-server",
|
|
php: "npm install -g intelephense",
|
|
dart: "Included with Dart SDK",
|
|
"terraform-ls": "See https://github.com/hashicorp/terraform-ls",
|
|
terraform: "See https://github.com/hashicorp/terraform-ls",
|
|
prisma: "npm install -g prisma",
|
|
"ocaml-lsp": "opam install ocaml-lsp-server",
|
|
texlab: "See https://github.com/latex-lsp/texlab",
|
|
dockerfile: "npm install -g dockerfile-language-server-nodejs",
|
|
gleam: "See https://gleam.run/getting-started/installing/",
|
|
"clojure-lsp": "See https://clojure-lsp.io/installation/",
|
|
nixd: "nix profile install nixpkgs#nixd",
|
|
tinymist: "See https://github.com/Myriad-Dreamin/tinymist",
|
|
"haskell-language-server": "ghcup install hls",
|
|
bash: "npm install -g bash-language-server",
|
|
"kotlin-ls": "See https://github.com/Kotlin/kotlin-lsp",
|
|
}
|
|
|
|
// Synced with OpenCode's server.ts
|
|
// https://github.com/sst/opencode/blob/dev/packages/opencode/src/lsp/server.ts
|
|
export const BUILTIN_SERVERS: Record<string, Omit<LSPServerConfig, "id">> = {
|
|
typescript: { command: ["typescript-language-server", "--stdio"], extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts"] },
|
|
deno: { command: ["deno", "lsp"], extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs"] },
|
|
vue: { command: ["vue-language-server", "--stdio"], extensions: [".vue"] },
|
|
eslint: { command: ["vscode-eslint-language-server", "--stdio"], extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts", ".vue"] },
|
|
oxlint: { command: ["oxlint", "--lsp"], extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts", ".vue", ".astro", ".svelte"] },
|
|
biome: { command: ["biome", "lsp-proxy", "--stdio"], extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts", ".json", ".jsonc", ".vue", ".astro", ".svelte", ".css", ".graphql", ".gql", ".html"] },
|
|
gopls: { command: ["gopls"], extensions: [".go"] },
|
|
"ruby-lsp": { command: ["rubocop", "--lsp"], extensions: [".rb", ".rake", ".gemspec", ".ru"] },
|
|
basedpyright: { command: ["basedpyright-langserver", "--stdio"], extensions: [".py", ".pyi"] },
|
|
pyright: { command: ["pyright-langserver", "--stdio"], extensions: [".py", ".pyi"] },
|
|
ty: { command: ["ty", "server"], extensions: [".py", ".pyi"] },
|
|
ruff: { command: ["ruff", "server"], extensions: [".py", ".pyi"] },
|
|
"elixir-ls": { command: ["elixir-ls"], extensions: [".ex", ".exs"] },
|
|
zls: { command: ["zls"], extensions: [".zig", ".zon"] },
|
|
csharp: { command: ["csharp-ls"], extensions: [".cs"] },
|
|
fsharp: { command: ["fsautocomplete"], extensions: [".fs", ".fsi", ".fsx", ".fsscript"] },
|
|
"sourcekit-lsp": { command: ["sourcekit-lsp"], extensions: [".swift", ".objc", ".objcpp"] },
|
|
rust: { command: ["rust-analyzer"], extensions: [".rs"] },
|
|
clangd: { command: ["clangd", "--background-index", "--clang-tidy"], extensions: [".c", ".cpp", ".cc", ".cxx", ".c++", ".h", ".hpp", ".hh", ".hxx", ".h++"] },
|
|
svelte: { command: ["svelteserver", "--stdio"], extensions: [".svelte"] },
|
|
astro: { command: ["astro-ls", "--stdio"], extensions: [".astro"] },
|
|
bash: { command: ["bash-language-server", "start"], extensions: [".sh", ".bash", ".zsh", ".ksh"] },
|
|
// Keep legacy alias for backward compatibility
|
|
"bash-ls": { command: ["bash-language-server", "start"], extensions: [".sh", ".bash", ".zsh", ".ksh"] },
|
|
jdtls: { command: ["jdtls"], extensions: [".java"] },
|
|
"yaml-ls": { command: ["yaml-language-server", "--stdio"], extensions: [".yaml", ".yml"] },
|
|
"lua-ls": { command: ["lua-language-server"], extensions: [".lua"] },
|
|
php: { command: ["intelephense", "--stdio"], extensions: [".php"] },
|
|
dart: { command: ["dart", "language-server", "--lsp"], extensions: [".dart"] },
|
|
terraform: { command: ["terraform-ls", "serve"], extensions: [".tf", ".tfvars"] },
|
|
// Legacy alias for backward compatibility
|
|
"terraform-ls": { command: ["terraform-ls", "serve"], extensions: [".tf", ".tfvars"] },
|
|
prisma: { command: ["prisma", "language-server"], extensions: [".prisma"] },
|
|
"ocaml-lsp": { command: ["ocamllsp"], extensions: [".ml", ".mli"] },
|
|
texlab: { command: ["texlab"], extensions: [".tex", ".bib"] },
|
|
dockerfile: { command: ["docker-langserver", "--stdio"], extensions: [".dockerfile"] },
|
|
gleam: { command: ["gleam", "lsp"], extensions: [".gleam"] },
|
|
"clojure-lsp": { command: ["clojure-lsp", "listen"], extensions: [".clj", ".cljs", ".cljc", ".edn"] },
|
|
nixd: { command: ["nixd"], extensions: [".nix"] },
|
|
tinymist: { command: ["tinymist"], extensions: [".typ", ".typc"] },
|
|
"haskell-language-server": { command: ["haskell-language-server-wrapper", "--lsp"], extensions: [".hs", ".lhs"] },
|
|
"kotlin-ls": { command: ["kotlin-lsp"], extensions: [".kt", ".kts"] },
|
|
}
|