VS Code language support for Mutant.
Included in this MVP
- Language Server integration over stdio
- Diagnostics from the Mutant LSP server
- Hover, completion, go to definition, references, and rename
- Starter syntax highlighting via TextMate grammar
Configuration
mutant.languageServer.path: executable/command path for Mutant LSP (default:
empty string; auto-detect packaged binary first, then workspace)
mutant.languageServer.args: additional CLI args for the server
mutant.lint.rules.duplicateTopLevelDeclaration.severity: severity for the
duplicate declaration lint rule (error, warning, information, hint,
off)
mutant.lint.rules.unusedDeclaration.severity: severity for the unused
declaration lint rule (error, warning, information, hint, off)
mutant.lint.rules.undefinedDeclaration.severity: severity for the undefined
identifier lint rule (error, warning, information, hint, off)
mutant.lint.rules.nestingComplexity.severity: severity for deep nesting
diagnostics in function bodies (error, warning, information, hint,
off)
mutant.format.onType.enabled: opt-in on-type formatting while typing
(false by default)
By default, Mutant files use editor.formatOnSave: true via extension
configuration defaults, so canonical style is enforced when saving. By default,
editor.formatOnType remains disabled for Mutant files; enable
mutant.format.onType.enabled if you want live formatting while typing.
When mutant.languageServer.path is empty, the extension first tries packaged
platform binaries in bin/:
mlsp-windows-amd64.exe
mlsp-windows-arm64.exe
mlsp-linux-amd64
mlsp-linux-arm64
mlsp-darwin-amd64
mlsp-darwin-arm64
If no packaged binary matches the current platform/arch, it then checks common
local paths such as mlsp(.exe) in the workspace and parent folder before
falling back to command lookup from PATH.
Setting a lint rule severity to off suppresses that rule.
Local Development
npm install
npm run compile
- Build the language server binary when needed:
../lsp/build.ps1 -HostOnly
../lsp/build.sh --host-only
This produces mlsp artifacts in lsp/dist/ for local extension use.
- Press
F5 in VS Code to launch the extension development host.
For publishing with bundled binaries:
- Build all LSP targets:
../lsp/build.ps1
../lsp/build.sh
- Stage binaries into extension
bin/:
npm run prepare:lsp-bins
- Package/publish the extension.
vscode:prepublish already runs
prepare:lsp-bins automatically.
Debug configuration is included in .vscode/launch.json and build tasks are in
.vscode/tasks.json.
If your LSP binary is not on PATH, set mutant.languageServer.path to an
absolute path.
Troubleshooting
For full troubleshooting coverage (PATH setup, settings validation, logs,
restart flow), see ../docs/VSCODE_EXTENSION_TROUBLESHOOTING.md.
Quick commands:
Mutant: Show LSP Status
Mutant: Show LSP Logs
Mutant: Copy LSP Logs
Mutant: Restart LSP
Key settings:
mutant.languageServer.path
mutant.languageServer.args
Smoke Test Workflow
- Run the VS Code task
smoke: lsp features.
- Press
F5 to start the extension development host.
- Run command
Mutant: Open Smoke File.
- Run command
Mutant: Run LSP Smoke Checks.
- Run command
Mutant: Show LSP Status to verify server state.
- Run command
Mutant: Show LSP Logs to inspect Mutant-only server logs.
- Run command
Mutant: Copy LSP Logs to copy recent logs for bug reports.
- If needed, run
Mutant: Restart LSP to recover from startup failures.
- Verify:
- Linting: warning on duplicate top-level
answer declaration.
- Semantic colors: keywords, numbers, strings, enum/type identifiers receive
semantic highlighting.
- Formatting: run
Format Document and confirm trailing spaces are removed and
a single final newline remains.
License
This extension is licensed under GNU AGPL v3.0 only.
See LICENSE.