Skip to content

feat(lsp): add web worker language servers as defaults#2531

Open
bajrangCoder wants to merge 3 commits into
mainfrom
worker-lsp-defaults
Open

feat(lsp): add web worker language servers as defaults#2531
bajrangCoder wants to merge 3 commits into
mainfrom
worker-lsp-defaults

Conversation

@bajrangCoder

Copy link
Copy Markdown
Member

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

  • Add a built-in Web Worker LSP runtime
  • Enable Web Worker servers by default for:
    • HTML
    • CSS, SCSS, and Less
    • JSON and JSONC
    • JavaScript, JSX, TypeScript, and TSX
  • Keep equivalent STDIO servers available but disabled by default
  • Support arbitrary document URIs, including Android SAF and content:// locations
  • Add HTML embedded-language support for CSS and JavaScript/TypeScript
  • Add JSON schema discovery and configuration support
  • Add TypeScript library loading and nested file resolution
  • Preserve Markdown formatting in TypeScript completion and signature-help documentation
  • Correctly dispose workers when:
    • A server is disabled
    • The last associated editor is closed
    • A custom server is removed
  • Avoid starting workers when their LSP servers are disabled

@bajrangCoder
bajrangCoder marked this pull request as ready for review July 23, 2026 16:29
@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds bundled Web Worker language servers as the default LSP experience. The main changes are:

  • Built-in HTML, CSS, JSON, JavaScript, and TypeScript workers.
  • Optional STDIO server alternatives.
  • Support for embedded HTML languages, JSON schemas, and TypeScript libraries.
  • Cancellation and cleanup for pending or unused workers.

Confidence Score: 5/5

This looks safe to merge.

  • Pending initialization is now aborted when a server is disabled or removed.
  • Partially initialized clients and transports are cleaned up after cancellation.
  • Settled pending clients are disposed before shutdown completes.

Important Files Changed

Filename Overview
src/cm/lsp/clientManager.ts Adds cancellation-aware initialization and idempotent cleanup for pending language-server clients.
src/cm/lsp/runtimes/webWorker.ts Adds the bundled Web Worker transport, startup handling, host file requests, and worker termination.

Reviews (2): Last reviewed commit: "fix dispose" | Re-trigger Greptile

Comment thread src/cm/lsp/clientManager.ts
@bajrangCoder

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant