diff --git a/server.ts b/server.ts index 9c94c44..b6e78b7 100644 --- a/server.ts +++ b/server.ts @@ -64,5 +64,6 @@ export const servers: ServerConfig[] = [ args: ["--lsp"], rootMarkers: [".oxlintrc.json", "oxlint.config.json"], languageId: "typescript", + diagnosticsOnly: true, }, ]; diff --git a/src/root.ts b/src/root.ts index ae5eb74..09e8edd 100644 --- a/src/root.ts +++ b/src/root.ts @@ -30,10 +30,10 @@ export function isServerAvailable(server: ServerConfig): boolean { } // Pick Server By File Extension - match[] entries are matched against the -// file's extension (no dot). First available server in the registry wins. +// file's extension (no dot). First available, non-diagnosticsOnly server wins. export function pickServer(filePath: string): ServerConfig { const ext = path.extname(filePath).replace(/^\./, ""); - const hit = servers.find((s) => s.match.includes(ext) && isServerAvailable(s)); + const hit = servers.find((s) => s.match.includes(ext) && !s.diagnosticsOnly && isServerAvailable(s)); if (!hit) { throw new UnsupportedExtensionError(`.${ext}`); } diff --git a/src/types.ts b/src/types.ts index 3a529c9..8e1103f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -34,6 +34,10 @@ export interface ServerConfig { // Idle TTL - Daemon keeps one server alive per (id, rootDir) and evicts // it after this many ms of inactivity. Defaults to 5 minutes. idleTtlMs?: number; + // Diagnostics Only - When true, this server is excluded from + // hover/definition/references/completion/documentSymbol but included + // in lsp_diagnostics and auto-check. + diagnosticsOnly?: boolean; } // Supported high-level commands exposed via the CLI. Extend this union