feat(lsp): add web worker language servers as defaults#2531
feat(lsp): add web worker language servers as defaults#2531bajrangCoder wants to merge 7 commits into
Conversation
Greptile SummaryThis PR ships a complete Web Worker LSP runtime for HTML, CSS, JSON, and TypeScript/JavaScript — enabling zero-setup language intelligence in Acode without Alpine, STDIO processes, or network bridges. The STDIO servers are preserved but renamed (e.g.
Confidence Score: 4/5Safe to merge except for the code-action crash in the TypeScript worker. The TypeScript worker unconditionally reads src/cm/lsp/workers/typescript.worker.ts — the Important Files Changed
Sequence DiagramsequenceDiagram
participant Host as Main Thread (Acode)
participant WT as WorkerTransport
participant HW as HTML Worker
participant NLC as NestedLspClient
participant TW as TypeScript Worker
Host->>WT: new Worker("build/htmlLspWorker.js")
Host->>HW: "postMessage({kind:"configure", serverId, rootUri})"
HW-->>Host: "postMessage({kind:"ready"})"
WT->>Host: ready promise resolves
Host->>HW: LSP initialize request (JSON-RPC string)
HW-->>Host: initialize response
Note over HW,TW: Lazy TypeScript nested worker init (on first JS request)
HW->>NLC: new NestedLspClient("typescriptLspWorker.js")
NLC->>TW: new Worker(url)
NLC->>TW: "postMessage({kind:"configure", serverId, rootUri})"
TW-->>NLC: "postMessage({kind:"ready"})"
NLC->>TW: initialize request
TW-->>NLC: initialize response
NLC->>TW: initialized notification
Host->>HW: textDocument/codeAction (JS embedded region)
HW->>NLC: request(method, params, jsDocument)
NLC->>TW: textDocument/codeAction (params without options)
Note over TW: formatSettings(undefined) throws TypeError
Note over Host,WT: Graceful shutdown
Host->>HW: shutdown + exit notifications
HW->>NLC: "dispose() -> typescriptClient.dispose()"
NLC->>TW: worker.terminate()
HW->>HW: workerScope.close()
WT->>WT: "dispose() -> worker.terminate()"
|
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