Skip to main content

McCode DSL language server (LSP) for .instr and .comp files

Project description

mclsp — McCode DSL Language Server

A Language Server Protocol implementation for the McCode domain-specific languages: McStas (.instr, .comp) and McXtrace (.instr, .comp).

Built on top of mccode-antlr and pygls.

Features

Feature Status
Syntax error diagnostics
Keyword completion
Component name completion
Parameter completion inside Component(…)
Hover: component signature & description
Syntax highlighting (TextMate grammar)
Go-to-definition 🔜

Installation

pip install mclsp
# or
conda install -c conda-forge mclsp

Requires mccode-antlr >= 0.18.0 and a McCode installation (McStas or McXtrace) for component library lookup.

Editor setup

VS Code

Install the McCode extension from the Marketplace (it bundles mclsp), or point the generic LSP client extension at mclsp --stdio.

A minimal extension stub is provided in vscode-extension/.

Neovim (nvim-lspconfig)

require('lspconfig').mclsp.setup {}

A config will be submitted upstream to nvim-lspconfig once the server stabilises.

Helix

Add to ~/.config/helix/languages.toml:

[[language]]
name = "mccode"
scope = "source.mccode"
file-types = ["instr", "comp"]
language-servers = ["mclsp"]

[language-server.mclsp]
command = "mclsp"
args = ["--stdio"]

Running the server manually

mclsp --stdio          # communicate over stdin/stdout (standard LSP mode)
mclsp --tcp 2087       # listen on TCP port 2087 (useful for debugging)

Development

git clone https://github.com/mcdotstar/mccode-language-server.git mclsp
cd mclsp
uv sync
uv run pytest

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

mclsp-0.4.1.tar.gz (85.5 kB view details)

Uploaded Source

Built Distribution

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

mclsp-0.4.1-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file mclsp-0.4.1.tar.gz.

File metadata

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

File hashes

Hashes for mclsp-0.4.1.tar.gz
Algorithm Hash digest
SHA256 437bc42541eda752c83826fc462fe702750870e158c9d61a3d8e8b9adeff4610
MD5 238d934bd2282aef6178759c0fa3fabd
BLAKE2b-256 f870ce472da150f5a34608c5a6976db854f75ddf50fa89eeffd4a962321f3229

See more details on using hashes here.

Provenance

The following attestation bundles were made for mclsp-0.4.1.tar.gz:

Publisher: release.yml on mcdotstar/mccode-language-server

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

File details

Details for the file mclsp-0.4.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for mclsp-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 02b797d7107d548d8010dabfd7815d8fa224fdab35ce23035963253897b2f985
MD5 81c44bcdbbed22b1747e50f50cccbccc
BLAKE2b-256 e7abb1feafab8579e8cb023617a4242e653652610b274f2f761a9f5358fa01f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for mclsp-0.4.1-py3-none-any.whl:

Publisher: release.yml on mcdotstar/mccode-language-server

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