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 of .comp files

Installation

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

Requires mccode-antlr >= 0.18.2 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.5.0.tar.gz (98.3 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.5.0-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mclsp-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a80a91bf27d84ff4338615d9ecfc42c66a3e4e9f6ceb1b36ab738dde4c5010b0
MD5 1b3bbe590fb657f02510a7fdaa9c599f
BLAKE2b-256 75524164c03893ac3f4216b6afc1379689299d298c5af6f8e66d62ffb1794c00

See more details on using hashes here.

Provenance

The following attestation bundles were made for mclsp-0.5.0.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.5.0-py3-none-any.whl.

File metadata

  • Download URL: mclsp-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 31.5 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb7d60e615966457eb3f3bb98fa5ff6574d56f9f4b129958f14baf25e8af71e7
MD5 cd9fd23b5e98dde6c0b5bce55e5364ee
BLAKE2b-256 b83cef81baa3a3503a14c34b649df1c8736b9773251a1b9c9bbcdcb664ec65e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mclsp-0.5.0-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