Add diagnosticsOnly?: boolean to ServerConfig. When set, the server is excluded from pickServer() (hover/definition/references/completion/ documentSymbol) but still included in pickDiagnosticServers() for lsp_diagnostics and auto-check. Mark oxlint as diagnosticsOnly: true — it now contributes diagnostics alongside typescript-language-server without interfering with navigation or completion tools.
70 lines
1.8 KiB
TypeScript
70 lines
1.8 KiB
TypeScript
// Server Registry - Maps a language id (or file extension) to an LSP server
|
|
// launcher plus the root markers that identify a project boundary.
|
|
//
|
|
// Add new servers here. `match` is a list of file extensions (no dot) OR
|
|
// language ids; either matches.
|
|
import type { ServerConfig } from "./src/types.ts";
|
|
|
|
// Global Root Markers — appended to every server's rootMarkers list
|
|
export const globalRootMarkers = [".git"];
|
|
|
|
export const servers: ServerConfig[] = [
|
|
{
|
|
id: "gopls",
|
|
match: ["go"],
|
|
command: "gopls",
|
|
args: ["-remote=auto"],
|
|
rootMarkers: ["go.work", "go.mod"],
|
|
languageId: "go",
|
|
},
|
|
{
|
|
id: "typescript-language-server",
|
|
match: ["ts", "tsx", "js", "jsx", "mts", "cts"],
|
|
command: "typescript-language-server",
|
|
args: ["--stdio"],
|
|
rootMarkers: ["pnpm-workspace.yaml", "tsconfig.json", "package.json"],
|
|
languageId: "typescript",
|
|
},
|
|
{
|
|
id: "pyright",
|
|
match: ["py"],
|
|
command: "pyright-langserver",
|
|
args: ["--stdio"],
|
|
rootMarkers: ["pyproject.toml", "setup.py", "setup.cfg"],
|
|
languageId: "python",
|
|
},
|
|
{
|
|
id: "lua-language-server",
|
|
match: ["lua"],
|
|
command: "lua-language-server",
|
|
args: [],
|
|
rootMarkers: [".luarc.json"],
|
|
languageId: "lua",
|
|
},
|
|
{
|
|
id: "vscode-html-language-server",
|
|
match: ["html", "css", "jsonl", "jsonc", "json"],
|
|
command: "vscode-html-language-server",
|
|
args: ["--stdio"],
|
|
rootMarkers: ["package.json"],
|
|
languageId: "html",
|
|
},
|
|
{
|
|
id: "nil",
|
|
match: ["nix"],
|
|
command: "nil",
|
|
args: [],
|
|
rootMarkers: ["flake.nix"],
|
|
languageId: "nix",
|
|
},
|
|
{
|
|
id: "oxlint",
|
|
match: ["ts", "tsx", "js", "jsx", "mjs", "cjs"],
|
|
command: "oxlint",
|
|
args: ["--lsp"],
|
|
rootMarkers: [".oxlintrc.json", "oxlint.config.json"],
|
|
languageId: "typescript",
|
|
diagnosticsOnly: true,
|
|
},
|
|
];
|