Skip to main content

Citry language server

citry-lsp brings Citry template diagnostics, completion, hover, navigation, symbols, references, and formatting to editors that support the Language Server Protocol.

It understands templates written inside Python, standalone citry-html documents, and template files owned by registered components. It can work without loading an app, while a project-aware installation also understands your registered components and their Python declarations.

Install in your project

Install the server in the same Python environment as the Citry project:

python -m pip install citry-lsp

The server requires Citry 0.6.0 or newer and Python 3.10 through 3.14. It checks catalog and protocol schemas for compatibility. It installs the compatible Citry runtime, pygls, and the supported ty analyzer automatically.

Your editor should launch this command over stdio:

citry-lsp

For an isolated syntax-only process, use:

uvx --from citry-lsp citry-lsp

The isolated form cannot import the project app, so it deliberately omits registry-backed component knowledge.

Choose how much project knowledge to load

Without a project target, the server reports syntax-only mode. Parser diagnostics, Citry structural completion, lexical c-for and c-fill bindings, Citry event/State binding keys and modifiers, Vue directive completion and hover, first-party hover help, and structural formatting remain available. The server does not guess which user components exist.

For component-aware features, the editor supplies a module:attribute target through its citry.app setting:

{
  "citry.app": "my_project.web:app"
}

The target may be a configured Citry instance or a ComponentLibrary:

{
  "citry.app": "citry_ui:__citry_library__"
}

The server imports that target in a bounded worker process. Import errors, invalid targets, crashes, and timeouts produce one visible status message and fall back to syntax-only behavior without corrupting the editor connection.

Clients may also provide an optional envFile initialization option. Relative paths resolve from the workspace:

{
  "protocolVersion": 1,
  "app": "my_project.web:app",
  "envFile": ".env"
}

File values override the environment inherited by the server and apply only to the isolated app-discovery worker. The stdio server and its type analyzer remain unchanged. Each registry reload rereads the file; missing or malformed configured files produce a syntax-only status instead of importing the app with an unintended environment. Citry's environment adapter reports the selected path but never serializes or logs its parsed values.

Registry mode adds:

  • component, input, slot, and typed slot-data completion and hover;
  • navigation to component classes, schema fields, inferred data keys, and template bindings;
  • TemplateData, JsData, and CssData checks across Python, templates, Vue expressions, JavaScript, and CSS;
  • Events handler and native component-prop checks;
  • public State-field completion in :c-* binding names, with errors on unknown fields;
  • callback-parameter navigation, and errors on unknown component.<name> and this.<name> reads when Citry can read every js_data() key (from JsData or the method's return value) and the Vue Options declare every other name;
  • Fluent message, key, argument, formatter, and translation navigation;
  • project lint settings and component-aware diagnostics.

Unknown-field checks wait until the component and its schema are known. Dynamic JavaScript keys, Vue Options built at run time, and open data schemas remain unchecked. Ordinary JavaScript member completion in VS Code uses its installed JavaScript provider.

Each workspace folder should run its own server process so it can use that folder's Python interpreter and registry target.

Type-aware template expressions

The server uses the ty executable installed in the selected project environment. Proven template roots receive Python member and call completion, hover, definitions, signature help, narrowing, and source-mapped diagnostics.

If ty is missing, has the wrong version, exits, or times out, the server shows one degradation notice and keeps parser diagnostics and Citry-owned root features active.

Formatting

Protocol v1 formats citry-html documents and parser-proven templates inside Python through Citry's shared structural formatter. Registry-proven ordinary HTML template files can be formatted through the explicit Citry request without registering Citry as the formatter for every HTML document.

Clients may also negotiate citry/formatComponentAssets and citry/formatEmbedded for one atomic template, JavaScript, and CSS formatting operation. Stale or malformed client responses produce no edit.

Compatibility

The server advertises language-server version 0.2.0, component catalog v1, and client protocol v1. It accepts Citry 0.6.0 and newer without a version upper bound, and checks the catalog and client protocol contracts before returning registry-backed results.

The console command accepts pygls development transports:

citry-lsp --tcp --host 127.0.0.1 --port 2087

Use stdio for normal editor integration.

For editor setup and troubleshooting, see the Citry IDE guide. Report problems through the Citry issue tracker.

Metadata

Release files for citry-lsp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for citry-lsp 0.2.0
File Size Uploaded Provenance
citry_lsp-0.2.0.tar.gz 506.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for citry-lsp 0.2.0
File Interpreter ABI Platform
citry_lsp-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 909.8 kB

Release files / citry_lsp-0.2.0.tar.gz

Download URL citry_lsp-0.2.0.tar.gz
Size 506.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c4ffbaee7709a5f16089674a32e381445eff7783e8acf9e57448195d17388b08
BLAKE2b-256 checksum
How to use checksums
5d266fafe737e501b4bda0b21a25f6dbf7be632897a14a611d3b3db957ea8f51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / citry_lsp-0.2.0-py3-none-any.whl

Download URL citry_lsp-0.2.0-py3-none-any.whl
Size 403.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e703ae9d74f9e334d90ab0f5efb0b460af35634279c525335ed7155cf33ced58
BLAKE2b-256 checksum
How to use checksums
ac963f98b4f8c33697d7d1a3c932fab2f8ac9d82c084dbf1868898c871ecf318
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for citry-lsp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for citry_lsp-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page