Skip to main content

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
  • 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

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

collagraph_lsp-0.1.3.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

collagraph_lsp-0.1.3-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file collagraph_lsp-0.1.3.tar.gz.

File metadata

  • Download URL: collagraph_lsp-0.1.3.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for collagraph_lsp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6ffbe6efb2a9138e902a45fb01e370d96e50e61ac6d8a1075de461583db1b560
MD5 5410c12a32f9c8bf88e36861545f08ae
BLAKE2b-256 0300dc87e91b082597500fc54454c1354974b0df45df0b929e8bca1dddad76e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for collagraph_lsp-0.1.3.tar.gz:

Publisher: ci.yml on fork-tongue/collagraph-lsp

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

File details

Details for the file collagraph_lsp-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: collagraph_lsp-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for collagraph_lsp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 50a0de9126d2d7df32df16044630476487b395bed7d7d9d3500a89584d7110ee
MD5 96e9da9c5c3a527868f93e97b99e5cf1
BLAKE2b-256 10d5cef6069d3ac35368ce01c8b5c86533f693aac5e9ce2508eb2c570e065b70

See more details on using hashes here.

Provenance

The following attestation bundles were made for collagraph_lsp-0.1.3-py3-none-any.whl:

Publisher: ci.yml on fork-tongue/collagraph-lsp

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page