LSP server for Collagraph (.cgx) files with ruff integration
Project description
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
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file collagraph_lsp-0.1.2.tar.gz.
File metadata
- Download URL: collagraph_lsp-0.1.2.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
300d28ef72718af3590e23f5c4fc2859a265a326a11702fc75b565ebe5495fe2
|
|
| MD5 |
6336a17c59dc7c7c8e093c2e607e6269
|
|
| BLAKE2b-256 |
5fe0aed57dbbbb424713551f91eface2c4b2fc3d5291b895a740057f464fecb6
|
Provenance
The following attestation bundles were made for collagraph_lsp-0.1.2.tar.gz:
Publisher:
ci.yml on fork-tongue/collagraph-lsp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
collagraph_lsp-0.1.2.tar.gz -
Subject digest:
300d28ef72718af3590e23f5c4fc2859a265a326a11702fc75b565ebe5495fe2 - Sigstore transparency entry: 666678828
- Sigstore integration time:
-
Permalink:
fork-tongue/collagraph-lsp@89753bd47f908ed72834d4af27d8bdd0514bedad -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/fork-tongue
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@89753bd47f908ed72834d4af27d8bdd0514bedad -
Trigger Event:
push
-
Statement type:
File details
Details for the file collagraph_lsp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: collagraph_lsp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aebab46796cc2d3244d7abbca5260ce851cbfc5d8049148b257a6d121895952b
|
|
| MD5 |
cbf25ad2646dc59f72b35088e18523f1
|
|
| BLAKE2b-256 |
555e772c89c85b7c679088f37e74b2f143fe0af5681718ed5f48bdfde1693d05
|
Provenance
The following attestation bundles were made for collagraph_lsp-0.1.2-py3-none-any.whl:
Publisher:
ci.yml on fork-tongue/collagraph-lsp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
collagraph_lsp-0.1.2-py3-none-any.whl -
Subject digest:
aebab46796cc2d3244d7abbca5260ce851cbfc5d8049148b257a6d121895952b - Sigstore transparency entry: 666678869
- Sigstore integration time:
-
Permalink:
fork-tongue/collagraph-lsp@89753bd47f908ed72834d4af27d8bdd0514bedad -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/fork-tongue
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@89753bd47f908ed72834d4af27d8bdd0514bedad -
Trigger Event:
push
-
Statement type: