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.1.0.tar.gz (77.1 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.1.0-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mclsp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3317644b77ea1c990b4c451919353855f84df187770719d2328476b2bddd8d61
MD5 0b03ce0f4d676a9db5c4ca30759cdf76
BLAKE2b-256 c0a70480e9de1f15d29c9349ea58ccca5ee35bce0d2917e5b0dbf126d76f4ff4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: mclsp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e317016e8fb63feb84ad9397d55046db02ede2c1144b8fbe5a76047ea557bc3c
MD5 e8c9b32b9d3eb4d727fa44806a11df66
BLAKE2b-256 4cbe98bb7ddc2d8709c561569549ab4234fa51629589d3f3240d7b079440b3e0

See more details on using hashes here.

Provenance

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