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=jsonagainst the real file on disk, so siblinguseimports 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
.mvlyou want the LSP interpreting). - Env passed to child: inherits the parent's env with
MVL_NO_REEXEC=1added, so the LSP always runs the binary it was pointed at rather than being redirected byrequires-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
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 mvl_lsp-0.1.4.tar.gz.
File metadata
- Download URL: mvl_lsp-0.1.4.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7417da16ff16a7d0a073879e273f7689d8016dd2ca2a31133d32810c2bcdf4e
|
|
| MD5 |
e4d9f718047bd65cc1ce59a0d3afeae3
|
|
| BLAKE2b-256 |
c8affb8af5f08f1afa347005be5e3b12df3ed26d7790f23837173a34acad6733
|
Provenance
The following attestation bundles were made for mvl_lsp-0.1.4.tar.gz:
Publisher:
publish-lsp.yml on mvl-lang/mvl-spec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mvl_lsp-0.1.4.tar.gz -
Subject digest:
b7417da16ff16a7d0a073879e273f7689d8016dd2ca2a31133d32810c2bcdf4e - Sigstore transparency entry: 2281064476
- Sigstore integration time:
-
Permalink:
mvl-lang/mvl-spec@bbed8ac05bacada9b5ceef25dc4c15927415c4ab -
Branch / Tag:
refs/tags/lsp-v0.1.4 - Owner: https://github.com/mvl-lang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-lsp.yml@bbed8ac05bacada9b5ceef25dc4c15927415c4ab -
Trigger Event:
push
-
Statement type:
File details
Details for the file mvl_lsp-0.1.4-py3-none-any.whl.
File metadata
- Download URL: mvl_lsp-0.1.4-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34dacb4c12efafb419585923313ede2a1a878e1c361e56992ec5885a1c2d7381
|
|
| MD5 |
3b4d4caa9538b125f7d721fc0eb460af
|
|
| BLAKE2b-256 |
6c1f68db3193517827b6364f26f39faf21d16d7b700122da5c580205310797cb
|
Provenance
The following attestation bundles were made for mvl_lsp-0.1.4-py3-none-any.whl:
Publisher:
publish-lsp.yml on mvl-lang/mvl-spec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mvl_lsp-0.1.4-py3-none-any.whl -
Subject digest:
34dacb4c12efafb419585923313ede2a1a878e1c361e56992ec5885a1c2d7381 - Sigstore transparency entry: 2281064678
- Sigstore integration time:
-
Permalink:
mvl-lang/mvl-spec@bbed8ac05bacada9b5ceef25dc4c15927415c4ab -
Branch / Tag:
refs/tags/lsp-v0.1.4 - Owner: https://github.com/mvl-lang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-lsp.yml@bbed8ac05bacada9b5ceef25dc4c15927415c4ab -
Trigger Event:
push
-
Statement type: