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

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.1.tar.gz (16.7 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.1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: collagraph_lsp-0.1.1.tar.gz
  • Upload date:
  • Size: 16.7 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.1.tar.gz
Algorithm Hash digest
SHA256 ad719bf312bd23f156144ed4ff6f151bae107e7f058bdb5a4895274a972a43be
MD5 cf69f170c077e139352410d4504302af
BLAKE2b-256 5dfd5f6dd68ffcfb9032337dc4b33468126e10ff3b2a4cf02d38382e4761133b

See more details on using hashes here.

Provenance

The following attestation bundles were made for collagraph_lsp-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: collagraph_lsp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b89b178335d88ecdaada2581605e84f2745d8d9addcf05badbf8ed1dfad7657
MD5 abefaa5a30d9bf7049b2cc276483fc9d
BLAKE2b-256 cfa602dcd2907637fbbafaf9946398be374aedb8649ed7968f68b231551175bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for collagraph_lsp-0.1.1-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