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

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

Uploaded Python 3

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

Hashes for mclsp-0.5.1.tar.gz
Algorithm Hash digest
SHA256 db317745e52a5eda501e1a6e1e104b83cfa4c5db1a5eafc9e3d8f2ceba01ca29
MD5 fc6de146ef3ad030c1705d0a3f5cd465
BLAKE2b-256 73ec0a06bce9c3a9a1cec88877a0d7ca6c50f98af869f45f4c38ce1f0bbaccdf

See more details on using hashes here.

Provenance

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

Hashes for mclsp-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 649ca2afb725718f598c67c878bf8adbf053eadc1050cc19fea4665a3ea15d28
MD5 d7557a1c68cb9f76da8c7396a6784b60
BLAKE2b-256 8b8b82dcc675fcbde661f22f2ed2ed44e7a3c8bf139ce9c71a09c36bfd7c4ccb

See more details on using hashes here.

Provenance

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