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 0.1.x server supports Citry 0.4.x and Python 3.10 through 3.14. 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, 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.

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, Alpine expressions, JavaScript, and CSS;
  • Events handler and $c-props checks;
  • Fluent message, key, argument, formatter, and translation navigation;
  • project lint settings and component-aware diagnostics.

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.1.1, Citry 0.4.x, component catalog v1, and client protocol v1. It refuses incompatible client protocols or Citry series instead of returning results based on a contract it does not understand.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

citry_lsp-0.1.1.tar.gz (197.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

citry_lsp-0.1.1-py3-none-any.whl (132.2 kB view details)

Uploaded Python 3

File details

Details for the file citry_lsp-0.1.1.tar.gz.

File metadata

  • Download URL: citry_lsp-0.1.1.tar.gz
  • Upload date:
  • Size: 197.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for citry_lsp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cc6e8ae8c546f9aec56ff7086933f0b041589c74dd692815d21ef830303226e2
MD5 f8f6ca6c61e6d247e241b650d92402d0
BLAKE2b-256 bfee7acb0ec45bec9ae15ca3be084f074956690f1371b42374c6a55e67e7a8bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for citry_lsp-0.1.1.tar.gz:

Publisher: py--citry-lsp--publish.yml on citry-dev/citry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file citry_lsp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: citry_lsp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 132.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for citry_lsp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 788225e556a9dac5c796e7fe5b8a515afcbae9bed0a4ef292fa0c46a90b0d1f1
MD5 1162d5a29c450ff8d350ecba175efdb0
BLAKE2b-256 82946d1387259e88a3d8059482e3234efc2ab4ed5a90bea620b6166281adb51b

See more details on using hashes here.

Provenance

The following attestation bundles were made for citry_lsp-0.1.1-py3-none-any.whl:

Publisher: py--citry-lsp--publish.yml on citry-dev/citry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.3

2 files

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

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