feat(lsp): add web worker language servers as defaults#2531
Conversation
Greptile SummaryThis PR adds built-in Web Worker language servers for HTML, CSS/SCSS/Less, JSON/JSONC, and TypeScript/JavaScript, enabling LSP features without Alpine, STDIO processes, or manual installation. Previously flagged issues (pending client surviving disposal, post-ready worker crash silently hanging requests, factory rejection leaving a live worker, and
Confidence Score: 5/5Safe to merge. The web-worker lifecycle (startup, abort-on-disable, post-ready crash) is correctly implemented, and every concern raised in the prior review round has been addressed. All four lifecycle bugs from the previous review (pending-client survival, post-ready crash in NestedLspClient, factory rejection leaving a live worker, and formatSettings crashing on undefined options) have been fixed. The remaining findings are quality suggestions around TypeScript compiler-options fidelity and performance — none affect correctness of the shipped LSP features. Files Needing Attention: src/cm/lsp/workers/typescript.worker.ts — Important Files Changed
Sequence DiagramsequenceDiagram
participant CM as LspClientManager
participant WT as workerTransport
participant W as Web Worker (protocol.ts)
participant NLC as NestedLspClient
participant TW as TypeScript Worker
CM->>WT: "createWorkerTransport({ url, configure })"
WT->>W: "postMessage({ kind: "configure", serverId, rootUri })"
W->>W: factory() → adapter
W-->>WT: "postMessage({ kind: "ready" })"
WT-->>CM: ready resolves
CM->>WT: transport.send(JSON-RPC initialize)
WT->>W: postMessage(string)
W-->>WT: postMessage(JSON-RPC response)
WT-->>CM: listeners dispatch response
Note over W,NLC: HTML worker only
W->>NLC: new NestedLspClient("typescriptLspWorker.js")
NLC->>TW: "postMessage({ kind: "configure" })"
TW-->>NLC: "postMessage({ kind: "ready" })"
NLC->>TW: JSON-RPC initialize
TW-->>NLC: JSON-RPC response
NLC-->>W: ready
CM->>WT: dispose() or disposeServer()
WT->>W: worker.terminate()
Note over NLC,TW: HTML worker dispose
W->>NLC: dispose()
NLC->>TW: worker.terminate()
Reviews (10): Last reviewed commit: "fix: html , ts worker lsp" | Re-trigger Greptile |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
# Conflicts: # src/cm/lsp/clientManager.ts # src/cm/lsp/servers/javascript.ts
Summary
Add bundled Web Worker-based language servers as the default LSP experience for users.
HTML, CSS, JSON, JavaScript, and TypeScript now work without requiring Alpine, STDIO processes, manual installation, WebSocket URLs, or launcher bridges. Existing STDIO servers remain available as optional alternatives for advanced users who wants full workspace level stdio based lsp.
Changes
content://locations