Skip to main content

mvl-lsp

MVL Language Server — full compiler-backed diagnostics for .mvl files. Shells out to mvl check <path> --format=json and maps the result to LSP diagnostics.

Version: 0.1.3 Tracks: mvl-spec ≥ 0.1.0 Depends on: the mvl compiler binary on PATH (or MVL_BIN) Changelog: CHANGELOG.md

Install

pip install git+https://github.com/mvl-lang/mvl-spec#subdirectory=tools/lsp

For local development:

git clone https://github.com/mvl-lang/mvl-spec
uv pip install -e ./mvl-spec/tools/lsp

You also need the mvl compiler installed. Either put it on PATH (default) or point MVL_BIN at a specific build (useful when iterating on the compiler alongside the LSP):

export MVL_BIN=/path/to/mvl-lang/mvl/target/debug/mvl

Run

The server is invoked over stdio per the LSP spec:

mvl-lsp

Editors don't run this by hand — they spawn mvl-lsp and speak LSP over its stdio. The editor extensions in ../../editors/ do this configuration automatically. For local dev see Makefile: make run sends an initialize handshake and prints the response.

What it covers

Everything mvl check catches: syntax errors, type mismatches, effect violations, IFC label errors, refinement failures, contract violations, termination checks, ownership errors — the compiler's full 11-requirement diagnostic surface, no gaps between LSP and CLI.

Each LSP diagnostic carries the compiler's error code (E0001, etc.) and points at the exact line/column the compiler reported.

Behavior

  • On open / save: run mvl check <path> --format=json against the real file on disk, so sibling use imports resolve correctly. No recheck on change — diagnostics reflect the last-saved state.
  • On close: clear diagnostics for that URI.
  • Timeout: each check is capped at 10s (files that exceed it are probably not .mvl you want the LSP interpreting).
  • Env passed to child: inherits the parent's env with MVL_NO_REEXEC=1 added, so the LSP always runs the binary it was pointed at rather than being redirected by requires-mvl.

Editor integration

Neovim (nvim-lspconfig):

require('lspconfig').mvl.setup({
    cmd = { 'mvl-lsp' },
    filetypes = { 'mvl' },
    root_dir = require('lspconfig.util').root_pattern('mvl.toml', '.git'),
})

VS Code: the vscode-mvl extension in this repo spawns mvl-lsp automatically.

Zed: the zed-mvl extension in this repo configures the LSP.

opencode: add to ~/.config/opencode/opencode.jsonc:

{
  "lsp": {
    "mvl": {
      "command": ["/absolute/path/to/mvl-lsp"],
      "extensions": [".mvl"]
    }
  }
}

Origin

Migrated from mvl-lang/mvl/tools/lsp_server.py under #28. Original design was a two-phase rollout (tree-sitter parse errors first, compiler-backed diagnostics later — #29); since mvl check --stdin --format=json already exists, the phase-1 tree-sitter path was skipped and the server ships with full compiler-backed diagnostics from the start.

License

Apache-2.0.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mvl_lsp-0.1.5.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

mvl_lsp-0.1.5-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file mvl_lsp-0.1.5.tar.gz.

File metadata

  • Download URL: mvl_lsp-0.1.5.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for mvl_lsp-0.1.5.tar.gz
Algorithm Hash digest
SHA256 2f30ec0d01ec361fe01b7af172f35dc4a2949eaf2667176ed281cd333b252399
MD5 11eb32b9b148f6a14455ee8f8a30a03d
BLAKE2b-256 dedd5d71d8de45d42cd7fd6c11c9617c36f6f4a035c417b20cc535cbd323a754

See more details on using hashes here.

Provenance

The following attestation bundles were made for mvl_lsp-0.1.5.tar.gz:

Publisher: publish-lsp.yml on mvl-lang/mvl-spec

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

File details

Details for the file mvl_lsp-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: mvl_lsp-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for mvl_lsp-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2f5bb605f79950b2ec52456a2ccb12782a5c043b29c0d371c23c4f8828ee0ac4
MD5 295be63eff3a02048d7e30eae9dbe14b
BLAKE2b-256 e24fe4a32e0725eb6983df09de3d5bca4e85f97134453ee6bbfbc4ad85a3d16c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mvl_lsp-0.1.5-py3-none-any.whl:

Publisher: publish-lsp.yml on mvl-lang/mvl-spec

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