refactor(daemon): require explicit serverId on all daemon ops
Move all server matching logic to the extension/CLI side. The daemon no longer calls pickServer() — it receives an explicit serverId (or serverIds[] for diagnostics) and uses it directly for cache lookup and server spawning. Key changes: - request op requires serverId: string - diagnostics op requires serverIds: string[] — daemon fans out in parallel via Promise.allSettled and returns grouped map - formatDiagnostics() handles grouped results with per-server headers when multiple servers contribute (single-server omits header) - CLI picks servers locally before calling daemon helpers - New pickDiagnosticServers() in extension returns all available, non-disabled servers matching the file extension This makes multi-server diagnostics (e.g., typescript-language-server + oxlint) work naturally — the extension decides which servers to query, the daemon just executes.
This commit is contained in:
@@ -38,6 +38,7 @@ export type DaemonRequest =
|
||||
id: number;
|
||||
op: "request";
|
||||
file: string;
|
||||
serverId: string;
|
||||
method: string;
|
||||
params: Record<string, unknown>;
|
||||
launch: LaunchContext;
|
||||
@@ -46,6 +47,7 @@ export type DaemonRequest =
|
||||
id: number;
|
||||
op: "diagnostics";
|
||||
file: string;
|
||||
serverIds: string[];
|
||||
timeoutMs?: number;
|
||||
launch: LaunchContext;
|
||||
}
|
||||
@@ -57,6 +59,7 @@ export type DaemonRequestWithoutId =
|
||||
| {
|
||||
op: "request";
|
||||
file: string;
|
||||
serverId: string;
|
||||
method: string;
|
||||
params: Record<string, unknown>;
|
||||
launch: LaunchContext;
|
||||
@@ -64,6 +67,7 @@ export type DaemonRequestWithoutId =
|
||||
| {
|
||||
op: "diagnostics";
|
||||
file: string;
|
||||
serverIds: string[];
|
||||
timeoutMs?: number;
|
||||
launch: LaunchContext;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user