Collagraph LSP Server
A Language Server Protocol (LSP) implementation for Collagraph .cgx files with integrated ruff linting.
Collagraph is a Python port of Vue.js, supporting single-file components in .cgx files. This LSP server provides real-time linting and formatting for Python code within these files.
Features
- Linting with ruff: Uses ruff to lint the Python code within the script tag
- Formatting with ruff: Uses ruff to format the python code within the script tag and template expressions
- Python autocompletion: Provides intelligent code completion for Python code in
<script>sections using Jedi with full component context - Go to Definition: Jump to the definition of variables, functions, classes, and imports defined in
<script>blocks
Installation
Install from PyPi:
uv tool install collagraph-lsp
# or with pip
pip install collagraph-lsp
Install from source
# Clone the repository
git clone https://github.com/fork-tongue/collagraph-lsp.git
cd collagraph-lsp
uv tool install .
Usage
Running the Server
The LSP server communicates over stdin/stdout. To start it:
# Using uv
uv run collagraph-lsp
# Or run directly
uv run python -m collagraph_lsp.server
Configuration
The server works with default Ruff settings, although it should pick up on your configuration in your project root.
Editor Integration
Coming soon:
- Sublime Text
- VS Code
- Zed
LSP settings
Configure which command to use for ruff:
{
"ruff_command": "/path/to/ruff"
}
Development
Running Tests
# Install (development) dependencies
uv sync
# Run tests
uv run pytest
# Run tests with coverage
uv run pytest --cov=collagraph_lsp
# Lint and format
uv run ruff check --fix
uv run ruff format
Related Projects
- collagraph - Python port of Vue.js
- ruff-cgx - Linter and formatter for cgx files
Metadata
Release files for collagraph-lsp 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| collagraph_lsp-0.1.3.tar.gz | 15.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| collagraph_lsp-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.3 kB
Release files / collagraph_lsp-0.1.3.tar.gz
| Download URL | collagraph_lsp-0.1.3.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ffbe6efb2a9138e902a45fb01e370d96e50e61ac6d8a1075de461583db1b560
|
|
BLAKE2b-256 checksum How to use checksums |
0300dc87e91b082597500fc54454c1354974b0df45df0b929e8bca1dddad76e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 12, 2026.
Transparency logRelease files / collagraph_lsp-0.1.3-py3-none-any.whl
| Download URL | collagraph_lsp-0.1.3-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
50a0de9126d2d7df32df16044630476487b395bed7d7d9d3500a89584d7110ee
|
|
BLAKE2b-256 checksum How to use checksums |
10d5cef6069d3ac35368ce01c8b5c86533f693aac5e9ce2508eb2c570e065b70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 12, 2026.
Transparency log