oh-my-opencode 5.1.81 → 5.1.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +443 -276
- package/dist/cli-node/index.js +443 -276
- package/dist/hooks/claude-code-hooks/handlers/empty-hook-config.fixture.d.ts +1 -0
- package/dist/index.js +650 -431
- package/dist/shared/opencode-message-dir.d.ts +1 -1
- package/dist/skills/browser/references/owned-engine/README.md +4 -2
- package/dist/skills/browser/references/owned-engine/frames-and-humans.md +9 -3
- package/dist/skills/browser/runtime/omowright/index.js +8 -8
- package/dist/skills/browser/runtime/omowright/manifest.json +4 -4
- package/dist/skills/frontend/SKILL.md +4 -2
- package/dist/skills/frontend/references/perfection/state-and-flow.md +120 -0
- package/dist/skills/visual-qa/AGENTS.md +2 -1
- package/dist/skills/visual-qa/SKILL.md +43 -11
- package/dist/skills/visual-qa/references/behaviour-evidence.md +189 -0
- package/dist/tui.js +15 -15
- package/package.json +15 -15
- package/packages/lsp-core/src/lsp/client-key.ts +14 -0
- package/packages/lsp-core/src/lsp/client-startup.ts +139 -0
- package/packages/lsp-core/src/lsp/client-wrapper.ts +4 -4
- package/packages/lsp-core/src/lsp/config-loader.ts +15 -0
- package/packages/lsp-core/src/lsp/directory-diagnostics-group-scan.test.ts +388 -0
- package/packages/lsp-core/src/lsp/directory-diagnostics-mixed-typescript.test.ts +124 -0
- package/packages/lsp-core/src/lsp/directory-diagnostics.test.ts +4 -4
- package/packages/lsp-core/src/lsp/directory-diagnostics.ts +38 -41
- package/packages/lsp-core/src/lsp/directory-group-scan.ts +124 -0
- package/packages/lsp-core/src/lsp/directory-server-groups.ts +84 -0
- package/packages/lsp-core/src/lsp/manager-acquisition.test.ts +115 -0
- package/packages/lsp-core/src/lsp/manager-lifecycle.test.ts +9 -9
- package/packages/lsp-core/src/lsp/manager-max-clients.test.ts +41 -16
- package/packages/lsp-core/src/lsp/manager-reaping.test.ts +119 -0
- package/packages/lsp-core/src/lsp/manager-test-support.ts +108 -0
- package/packages/lsp-core/src/lsp/manager.ts +80 -249
- package/packages/lsp-core/src/lsp/native-typescript.ts +88 -0
- package/packages/lsp-core/src/lsp/server-installation.ts +15 -7
- package/packages/lsp-core/src/lsp/server-resolution-typescript-native.test.ts +327 -0
- package/packages/lsp-core/src/lsp/server-resolution.ts +28 -2
- package/packages/lsp-core/src/lsp/timer-provider.ts +17 -0
- package/packages/lsp-core/src/lsp/typescript-project-test-support.ts +52 -0
- package/packages/lsp-daemon/dist/cli.js +486 -310
- package/packages/lsp-daemon/dist/client.js +472 -296
- package/packages/lsp-daemon/dist/index.js +476 -300
- package/packages/lsp-tools-mcp/dist/cli.js +467 -291
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +160 -193
- package/packages/lsp-tools-mcp/dist/mcp.js +467 -291
- package/packages/lsp-tools-mcp/dist/tools.js +467 -291
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +478 -313
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +12 -12
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/skills/browser/references/owned-engine/README.md +4 -2
- package/packages/omo-codex/plugin/skills/browser/references/owned-engine/frames-and-humans.md +9 -3
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/index.js +8 -8
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +4 -4
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +4 -2
- package/packages/omo-codex/plugin/skills/frontend/references/perfection/state-and-flow.md +120 -0
- package/packages/omo-codex/plugin/skills/visual-qa/AGENTS.md +2 -1
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +43 -11
- package/packages/omo-codex/plugin/skills/visual-qa/references/behaviour-evidence.md +189 -0
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
- package/packages/shared-skills/skills/browser/references/owned-engine/README.md +4 -2
- package/packages/shared-skills/skills/browser/references/owned-engine/frames-and-humans.md +9 -3
- package/packages/shared-skills/skills/browser/runtime/omowright/index.js +8 -8
- package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +4 -4
- package/packages/shared-skills/skills/frontend/SKILL.md +4 -2
- package/packages/shared-skills/skills/frontend/references/perfection/state-and-flow.md +120 -0
- package/packages/shared-skills/skills/visual-qa/AGENTS.md +2 -1
- package/packages/shared-skills/skills/visual-qa/SKILL.md +43 -11
- package/packages/shared-skills/skills/visual-qa/references/behaviour-evidence.md +189 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-opencode",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.83",
|
|
4
4
|
"description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
},
|
|
201
201
|
"devDependencies": {
|
|
202
202
|
"@clack/prompts": "^1.8.1",
|
|
203
|
-
"@code-yeongyu/senpi": "2026.11.
|
|
203
|
+
"@code-yeongyu/senpi": "2026.11.23",
|
|
204
204
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
205
205
|
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
206
206
|
"@oh-my-opencode/ast-grep-mcp": "workspace:*",
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
"jsonc-parser": "^3.3.1",
|
|
265
265
|
"knip": "6.43.0",
|
|
266
266
|
"node-pty": "^1.1.0",
|
|
267
|
-
"omowright": "^0.3.
|
|
267
|
+
"omowright": "^0.3.2",
|
|
268
268
|
"oxc-parser": "0.148.0",
|
|
269
269
|
"oxlint": "1.89.0",
|
|
270
270
|
"picocolors": "^1.1.1",
|
|
@@ -274,18 +274,18 @@
|
|
|
274
274
|
"typescript": "^7.0.2"
|
|
275
275
|
},
|
|
276
276
|
"optionalDependencies": {
|
|
277
|
-
"oh-my-opencode-darwin-arm64": "5.1.
|
|
278
|
-
"oh-my-opencode-darwin-x64": "5.1.
|
|
279
|
-
"oh-my-opencode-darwin-x64-baseline": "5.1.
|
|
280
|
-
"oh-my-opencode-linux-arm64": "5.1.
|
|
281
|
-
"oh-my-opencode-linux-arm64-musl": "5.1.
|
|
282
|
-
"oh-my-opencode-linux-x64": "5.1.
|
|
283
|
-
"oh-my-opencode-linux-x64-baseline": "5.1.
|
|
284
|
-
"oh-my-opencode-linux-x64-musl": "5.1.
|
|
285
|
-
"oh-my-opencode-linux-x64-musl-baseline": "5.1.
|
|
286
|
-
"oh-my-opencode-windows-arm64": "5.1.
|
|
287
|
-
"oh-my-opencode-windows-x64": "5.1.
|
|
288
|
-
"oh-my-opencode-windows-x64-baseline": "5.1.
|
|
277
|
+
"oh-my-opencode-darwin-arm64": "5.1.83",
|
|
278
|
+
"oh-my-opencode-darwin-x64": "5.1.83",
|
|
279
|
+
"oh-my-opencode-darwin-x64-baseline": "5.1.83",
|
|
280
|
+
"oh-my-opencode-linux-arm64": "5.1.83",
|
|
281
|
+
"oh-my-opencode-linux-arm64-musl": "5.1.83",
|
|
282
|
+
"oh-my-opencode-linux-x64": "5.1.83",
|
|
283
|
+
"oh-my-opencode-linux-x64-baseline": "5.1.83",
|
|
284
|
+
"oh-my-opencode-linux-x64-musl": "5.1.83",
|
|
285
|
+
"oh-my-opencode-linux-x64-musl-baseline": "5.1.83",
|
|
286
|
+
"oh-my-opencode-windows-arm64": "5.1.83",
|
|
287
|
+
"oh-my-opencode-windows-x64": "5.1.83",
|
|
288
|
+
"oh-my-opencode-windows-x64-baseline": "5.1.83"
|
|
289
289
|
},
|
|
290
290
|
"overrides": {
|
|
291
291
|
"hono": "^4.13.8",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ResolvedServer } from "./types.js"
|
|
2
|
+
|
|
3
|
+
/** What tells two resident clients apart: the server id and the exact command it was resolved to. */
|
|
4
|
+
export type ClientIdentity = Pick<ResolvedServer, "id" | "command">
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The resident client key. The resolved command is part of it because one server id can resolve to
|
|
8
|
+
* different binaries under one workspace root: in a monorepo, a TypeScript 7 package is served by its
|
|
9
|
+
* own `tsc --lsp` while a TypeScript 5 sibling is served by typescript-language-server. The same root
|
|
10
|
+
* and command still share one client.
|
|
11
|
+
*/
|
|
12
|
+
export function lspClientKey(root: string, server: ClientIdentity): string {
|
|
13
|
+
return JSON.stringify([root, server.id, server.command])
|
|
14
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { LspClient } from "./client.js"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Lifecycle of a starting client, owned by the LspManager.
|
|
5
|
+
*
|
|
6
|
+
* The manager owns every startup and every shutdown; a caller only waits. A startup begun by getClient
|
|
7
|
+
* is held by its waiters, counted in `pendingWaiters` from the moment they join until each one either
|
|
8
|
+
* becomes a reference or leaves. A waiter whose signal aborts (a caller cancellation or a directory
|
|
9
|
+
* scan's start deadline) detaches: it stops counting and rejects at once, and never awaits a shutdown.
|
|
10
|
+
* When the last waiter of a waiter-held startup leaves while it holds no reference, the manager drops
|
|
11
|
+
* the startup from its pool (so `clientCount()` no longer counts it) and stops it as a tracked
|
|
12
|
+
* tombstone, which the next getClient for that key and `stopAll()` await, so no process outlives the
|
|
13
|
+
* manager. A start that fails is dropped and stopped the same way, once. A warmup startup has no waiter
|
|
14
|
+
* to lose and runs to its end.
|
|
15
|
+
*
|
|
16
|
+
* States of one key: ABSENT; STARTING (N counted waiters); RESIDENT (R references, plus the counted
|
|
17
|
+
* waiters of a start that just finished); STOPPING (not pooled, stop tracked in `pendingStops`).
|
|
18
|
+
* - getClient resident hit: R+1 synchronously, no await.
|
|
19
|
+
* - getClient cold start or joining a start: counted (N+1) synchronously, then awaits the start. When it
|
|
20
|
+
* resumes it stops counting and takes its reference (R+1) in one synchronous step, after checking it
|
|
21
|
+
* still holds the pooled instance for its key and that the client is alive. A client that is no longer
|
|
22
|
+
* pooled (stopped by the init-timeout reaper, invalidateClient or stopAll while it waited) is never
|
|
23
|
+
* handed out: the caller acquires again through the normal path, which awaits that stop and starts a
|
|
24
|
+
* fresh client, or rejects once the manager is disposed.
|
|
25
|
+
* - Waiter abort or deadline: N-1, rejects; the last waiter leaving stops the startup as above.
|
|
26
|
+
* - releaseClient: R-1 on the instance the caller held; a stale instance gives back nothing.
|
|
27
|
+
* - Eviction at the resident cap and the idle reaper take only a RESIDENT client with R = 0 and N = 0.
|
|
28
|
+
* - The init-timeout reaper stops a startup older than the init timeout whatever its waiters, and
|
|
29
|
+
* stopAll stops everything; neither hands the stopped client to a caller.
|
|
30
|
+
*/
|
|
31
|
+
export interface ManagedClient {
|
|
32
|
+
readonly key: string
|
|
33
|
+
readonly root: string
|
|
34
|
+
readonly serverId: string
|
|
35
|
+
readonly client: LspClient
|
|
36
|
+
/** False for a warmup startup, which no waiter holds. */
|
|
37
|
+
readonly heldByWaiters: boolean
|
|
38
|
+
refCount: number
|
|
39
|
+
pendingWaiters: number
|
|
40
|
+
lastUsedAt: number
|
|
41
|
+
initPromise: Promise<void> | null
|
|
42
|
+
isInitializing: boolean
|
|
43
|
+
initializingSince: number | null
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface StartupRequest {
|
|
47
|
+
readonly key: string
|
|
48
|
+
readonly root: string
|
|
49
|
+
readonly serverId: string
|
|
50
|
+
readonly client: LspClient
|
|
51
|
+
readonly heldByWaiters: boolean
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export class ClientStartups {
|
|
55
|
+
constructor(
|
|
56
|
+
private readonly now: () => number,
|
|
57
|
+
private readonly discard: (managed: ManagedClient) => void,
|
|
58
|
+
) {}
|
|
59
|
+
|
|
60
|
+
begin(request: StartupRequest): ManagedClient {
|
|
61
|
+
const { client } = request
|
|
62
|
+
const startedAt = this.now()
|
|
63
|
+
const initPromise = (async () => {
|
|
64
|
+
await client.start()
|
|
65
|
+
await client.initialize()
|
|
66
|
+
})()
|
|
67
|
+
const managed: ManagedClient = {
|
|
68
|
+
...request,
|
|
69
|
+
refCount: 0,
|
|
70
|
+
pendingWaiters: 0,
|
|
71
|
+
lastUsedAt: startedAt,
|
|
72
|
+
initPromise,
|
|
73
|
+
isInitializing: true,
|
|
74
|
+
initializingSince: startedAt,
|
|
75
|
+
}
|
|
76
|
+
// Registered before any waiter, so the pool reflects the outcome by the time a waiter resumes.
|
|
77
|
+
initPromise.then(
|
|
78
|
+
() => {
|
|
79
|
+
managed.isInitializing = false
|
|
80
|
+
managed.initializingSince = null
|
|
81
|
+
managed.initPromise = null
|
|
82
|
+
managed.lastUsedAt = this.now()
|
|
83
|
+
},
|
|
84
|
+
() => this.discard(managed),
|
|
85
|
+
)
|
|
86
|
+
return managed
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Waits for the start as one counted waiter. A rejection has already detached the waiter; a
|
|
91
|
+
* resolution leaves it counted, and the caller must turn it into a reference or `detach` it before
|
|
92
|
+
* its next await.
|
|
93
|
+
*/
|
|
94
|
+
async wait(managed: ManagedClient, initPromise: Promise<void>, signal: AbortSignal | undefined): Promise<void> {
|
|
95
|
+
managed.pendingWaiters++
|
|
96
|
+
try {
|
|
97
|
+
await awaitWithSignal(initPromise, signal)
|
|
98
|
+
} catch (error) {
|
|
99
|
+
this.detach(managed)
|
|
100
|
+
throw error
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
detach(managed: ManagedClient): void {
|
|
105
|
+
managed.pendingWaiters--
|
|
106
|
+
if (managed.pendingWaiters === 0 && managed.refCount === 0 && managed.heldByWaiters) this.discard(managed)
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function awaitWithSignal<T>(promise: Promise<T>, signal: AbortSignal | undefined): Promise<T> {
|
|
111
|
+
if (!signal) return promise
|
|
112
|
+
return new Promise<T>((resolve, reject) => {
|
|
113
|
+
let settled = false
|
|
114
|
+
const onAbort = () => {
|
|
115
|
+
if (settled) return
|
|
116
|
+
settled = true
|
|
117
|
+
reject(new DOMException("Aborted", "AbortError"))
|
|
118
|
+
}
|
|
119
|
+
if (signal.aborted) {
|
|
120
|
+
onAbort()
|
|
121
|
+
return
|
|
122
|
+
}
|
|
123
|
+
signal.addEventListener("abort", onAbort, { once: true })
|
|
124
|
+
promise.then(
|
|
125
|
+
(value) => {
|
|
126
|
+
if (settled) return
|
|
127
|
+
settled = true
|
|
128
|
+
signal.removeEventListener("abort", onAbort)
|
|
129
|
+
resolve(value)
|
|
130
|
+
},
|
|
131
|
+
(err) => {
|
|
132
|
+
if (settled) return
|
|
133
|
+
settled = true
|
|
134
|
+
signal.removeEventListener("abort", onAbort)
|
|
135
|
+
reject(err)
|
|
136
|
+
},
|
|
137
|
+
)
|
|
138
|
+
})
|
|
139
|
+
}
|
|
@@ -255,7 +255,7 @@ export async function withLspClient<T>(
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
const ext = effectiveExtension(absPath)
|
|
258
|
-
const result = findServerForExtension(ext)
|
|
258
|
+
const result = findServerForExtension(ext, absPath)
|
|
259
259
|
if (result.status !== "found") {
|
|
260
260
|
throw new LspServerLookupError(formatServerLookupError(result), result)
|
|
261
261
|
}
|
|
@@ -271,18 +271,18 @@ export async function withLspClient<T>(
|
|
|
271
271
|
return await fn(client, root, absPath)
|
|
272
272
|
} catch (err) {
|
|
273
273
|
if (allowRetry && READ_ONLY_TOOLS.has(toolName) && isLspDeadConnectionError(err)) {
|
|
274
|
-
manager.invalidateClient(root, server
|
|
274
|
+
manager.invalidateClient(root, server, client)
|
|
275
275
|
return acquireAndCall(false)
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
if (err instanceof LspRequestTimeoutError) {
|
|
279
|
-
if (manager.isServerInitializing(root, server
|
|
279
|
+
if (manager.isServerInitializing(root, server)) {
|
|
280
280
|
throw new LspServerInitializingError(err)
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
throw err
|
|
284
284
|
} finally {
|
|
285
|
-
manager.releaseClient(root, server
|
|
285
|
+
manager.releaseClient(root, server, client)
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
|
|
@@ -21,6 +21,13 @@ type ConfigSource = "project" | "user"
|
|
|
21
21
|
|
|
22
22
|
export interface ServerWithSource extends ResolvedServer {
|
|
23
23
|
source: "project" | "user" | "builtin"
|
|
24
|
+
/**
|
|
25
|
+
* True when no config file named `command`, so it is the builtin default. A configured command
|
|
26
|
+
* stays false even when it is textually equal to the default.
|
|
27
|
+
*/
|
|
28
|
+
inheritsBuiltinCommand: boolean
|
|
29
|
+
/** The `initialization` a config file supplied, without the builtin option set merged in. */
|
|
30
|
+
configuredInitialization?: Record<string, unknown>
|
|
24
31
|
}
|
|
25
32
|
|
|
26
33
|
export function getConfigPaths(): { project: string; user: string } {
|
|
@@ -106,6 +113,7 @@ export function getMergedServers(): ServerWithSource[] {
|
|
|
106
113
|
extensions: config.extensions,
|
|
107
114
|
priority: -100,
|
|
108
115
|
source: "builtin",
|
|
116
|
+
inheritsBuiltinCommand: true,
|
|
109
117
|
...(config.initialization === undefined ? {} : { initialization: config.initialization }),
|
|
110
118
|
})
|
|
111
119
|
}
|
|
@@ -133,7 +141,9 @@ function createServerFromEntry(id: string, entry: LspEntry, source: ConfigSource
|
|
|
133
141
|
extensions: entry.extensions ?? builtin.extensions,
|
|
134
142
|
priority: entry.priority ?? 0,
|
|
135
143
|
source,
|
|
144
|
+
inheritsBuiltinCommand: true,
|
|
136
145
|
})
|
|
146
|
+
if (entry.initialization !== undefined) server.configuredInitialization = entry.initialization
|
|
137
147
|
const initialization = mergeInitialization(builtin.initialization, entry.initialization)
|
|
138
148
|
if (initialization !== undefined) {
|
|
139
149
|
server.initialization = initialization
|
|
@@ -148,6 +158,7 @@ function createServerFromEntry(id: string, entry: LspEntry, source: ConfigSource
|
|
|
148
158
|
extensions: entry.extensions,
|
|
149
159
|
priority: entry.priority ?? 0,
|
|
150
160
|
source,
|
|
161
|
+
inheritsBuiltinCommand: false,
|
|
151
162
|
})
|
|
152
163
|
applyOptionalServerFields(server, entry)
|
|
153
164
|
return server
|
|
@@ -160,6 +171,7 @@ function createServerFromEntry(id: string, entry: LspEntry, source: ConfigSource
|
|
|
160
171
|
extensions: entry.extensions ?? builtin.extensions,
|
|
161
172
|
priority: entry.priority ?? 0,
|
|
162
173
|
source,
|
|
174
|
+
inheritsBuiltinCommand: entry.command === undefined,
|
|
163
175
|
})
|
|
164
176
|
applyOptionalServerFields(server, entry)
|
|
165
177
|
const builtinInitialization = entry.command === undefined ? builtin.initialization : undefined
|
|
@@ -185,6 +197,7 @@ function createServer(input: {
|
|
|
185
197
|
readonly extensions: string[]
|
|
186
198
|
readonly priority: number
|
|
187
199
|
readonly source: ConfigSource
|
|
200
|
+
readonly inheritsBuiltinCommand: boolean
|
|
188
201
|
readonly env?: Record<string, string>
|
|
189
202
|
readonly initialization?: Record<string, unknown>
|
|
190
203
|
}): ServerWithSource {
|
|
@@ -194,6 +207,7 @@ function createServer(input: {
|
|
|
194
207
|
extensions: input.extensions,
|
|
195
208
|
priority: input.priority,
|
|
196
209
|
source: input.source,
|
|
210
|
+
inheritsBuiltinCommand: input.inheritsBuiltinCommand,
|
|
197
211
|
}
|
|
198
212
|
if (input.env !== undefined) {
|
|
199
213
|
server.env = input.env
|
|
@@ -210,6 +224,7 @@ function applyOptionalServerFields(server: ServerWithSource, entry: LspEntry): v
|
|
|
210
224
|
}
|
|
211
225
|
if (entry.initialization !== undefined) {
|
|
212
226
|
server.initialization = entry.initialization
|
|
227
|
+
server.configuredInitialization = entry.initialization
|
|
213
228
|
}
|
|
214
229
|
}
|
|
215
230
|
|