Skip to content

IDE: provide shared JavaScript language-service support through citry-lsp #116

Open

Description

@JuroOravec

Problem

General JavaScript assistance inside Citry components currently depends on the VS Code extension creating virtual JavaScript documents and invoking VS Code providers. Other editors connected to citry-lsp receive Citry-owned features but do not automatically receive equivalent JavaScript completion, hover, or navigation.

Developers should retain normal JavaScript editing assistance when choosing inline component code, including in Helix and Zed.

Prior art

  • packages/py/citry_lsp/citry_lsp/server.py: citry/browserProjection exposes mapped JavaScript projections.
  • packages/editors/vscode/src/extension.ts: registerBrowserLanguageProviders delegates requests to VS Code providers.
  • docs/design/embedded_language_ide.md: portable analysis and exact source mappings already exist; general web-language intelligence is currently delegated to editor providers.
  • IDE: complete and validate the data object in $component() callback #113 tracks typed completion and validation for the $component() callback's data object; coordinate with that work rather than creating a second typing contract.

Proposed work

Extend citry-lsp to delegate general JavaScript requests to a JavaScript language server/service and translate results back to authored component source through standard LSP responses.

  • Evaluate an established JavaScript/TypeScript service, including project configuration, library types, imports, and dependency discovery.
  • Reuse Citry's source discovery, projections, and typed context. Cover inline js, owned js_file assets, and supported Alpine expression regions with an explicit capability list.
  • Support completion, hover, navigation, and diagnostics; define which further operations can be mapped safely.
  • Preserve exact positions and edits across Python string decoding, generated helper code, unsaved edits, and multiple components. Reject stale or unmappable results.
  • Define dependency installation, process lifecycle, cancellation, and behavior when the service is missing, incompatible, or unavailable. Keep existing Citry-owned assistance usable.
  • Coordinate with the VS Code bridge so users do not receive duplicate diagnostics or competing edits.

This is an architecture extension. Compare server-side delegation with maintaining separate editor bridges before implementation; do not replace the existing portable analyzer with a second Citry parser.

Acceptance criteria

A representative inline-component fixture receives useful ordinary JavaScript completion, hover, navigation, and diagnostics through standard LSP in VS Code and a second editor. Verify project symbols through runtime-supported imports or JSDoc types, Citry-provided data, incomplete input, unsaved changes, and mapping failures. Document supported regions and any intentionally deferred operations.

Browser breakpoint source maps are separate runtime artifacts and are tracked in the debugging issue.

Related work

Activity

  1. added
    enhancement
    on Sep 10, 2026
  2. added
    next-sprint
    on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementnext-sprint

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions