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 of .comp files | ✅ |
Installation
pip install mclsp
# or
conda install -c conda-forge mclsp
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
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 mclsp-0.5.1.tar.gz.
File metadata
- Download URL: mclsp-0.5.1.tar.gz
- Upload date:
- Size: 100.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db317745e52a5eda501e1a6e1e104b83cfa4c5db1a5eafc9e3d8f2ceba01ca29
|
|
| MD5 |
fc6de146ef3ad030c1705d0a3f5cd465
|
|
| BLAKE2b-256 |
73ec0a06bce9c3a9a1cec88877a0d7ca6c50f98af869f45f4c38ce1f0bbaccdf
|
Provenance
The following attestation bundles were made for mclsp-0.5.1.tar.gz:
Publisher:
release.yml on mcdotstar/mccode-language-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mclsp-0.5.1.tar.gz -
Subject digest:
db317745e52a5eda501e1a6e1e104b83cfa4c5db1a5eafc9e3d8f2ceba01ca29 - Sigstore transparency entry: 992009572
- Sigstore integration time:
-
Permalink:
mcdotstar/mccode-language-server@0bf6ceffae8110903572f37841d39c893dae1e21 -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/mcdotstar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0bf6ceffae8110903572f37841d39c893dae1e21 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mclsp-0.5.1-py3-none-any.whl.
File metadata
- Download URL: mclsp-0.5.1-py3-none-any.whl
- Upload date:
- Size: 32.8 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 |
649ca2afb725718f598c67c878bf8adbf053eadc1050cc19fea4665a3ea15d28
|
|
| MD5 |
d7557a1c68cb9f76da8c7396a6784b60
|
|
| BLAKE2b-256 |
8b8b82dcc675fcbde661f22f2ed2ed44e7a3c8bf139ce9c71a09c36bfd7c4ccb
|
Provenance
The following attestation bundles were made for mclsp-0.5.1-py3-none-any.whl:
Publisher:
release.yml on mcdotstar/mccode-language-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mclsp-0.5.1-py3-none-any.whl -
Subject digest:
649ca2afb725718f598c67c878bf8adbf053eadc1050cc19fea4665a3ea15d28 - Sigstore transparency entry: 992009608
- Sigstore integration time:
-
Permalink:
mcdotstar/mccode-language-server@0bf6ceffae8110903572f37841d39c893dae1e21 -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/mcdotstar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0bf6ceffae8110903572f37841d39c893dae1e21 -
Trigger Event:
release
-
Statement type: