EasyCrypt language support for Visual Studio Code: syntax highlighting, diagnostics via the easycrypt CLI, and interactive proof development with proof-state navigation.
- Syntax highlighting for EasyCrypt (
.ec,.eca). - Diagnostics / squiggles by running EasyCrypt and parsing its output.
- Manual check via command.
- Optional live checks on change/save.
- Interactive proof navigation backed by a selectable communication channel:
emacschannel (default): EasyCryptcli -emacsprocess.lspchannel: EasyCrypt LSP server with custom proof/query requests.autochannel: compatibility-based selection.- Step forward/backward through statements.
- Jump to cursor.
- Reset proof state.
- Proof State view (Explorer panel) that shows goals/messages/output and includes navigation buttons.
- Status bar indicator for quick “check file” access.
- Verbose logging to the “EasyCrypt” Output channel (optional).
- EasyCrypt installed locally.
- The
easycryptexecutable must be available on yourPATH, or configured explicitly viaeasycrypt.executablePath.
- Install EasyCrypt.
- Open an EasyCrypt file (
.ec/.eca) in VS Code. - Run “EasyCrypt: Check File” from the Command Palette.
- (Optional) Open the Proof State view in the Explorer to step through proofs.
From the Command Palette:
- EasyCrypt: Check File (
easycrypt.checkFile) - EasyCrypt: Start/Restart Process (
easycrypt.startProcess) - starts/restarts current runtime (process or LSP client) - EasyCrypt: Stop Process (
easycrypt.stopProcess) - stops current runtime (process or LSP client) - EasyCrypt: Clear All Diagnostics (
easycrypt.clearAllDiagnostics) - EasyCrypt: Clear File Diagnostics (
easycrypt.clearFileDiagnostics) - EasyCrypt: Show Diagnostic Count (
easycrypt.showDiagnosticCount) - EasyCrypt: Step Forward (
easycrypt.stepForward) - EasyCrypt: Step Backward (
easycrypt.stepBackward) - EasyCrypt: Go to Cursor (
easycrypt.goToCursor) - EasyCrypt: Reset Proof State (
easycrypt.resetProof) - EasyCrypt: Force Recovery (Fix Desync) (
easycrypt.forceRecovery) - EasyCrypt: Toggle Verbose Logging (
easycrypt.toggleVerboseLogging)
The extension provides navigation keybindings when editing EasyCrypt files, controlled by easycrypt.keybindings.profile:
default- Step Forward:
Alt+Down - Step Backward:
Alt+Up - Go to Cursor:
Alt+Right - Reset Proof State:
Alt+Left
- Step Forward:
proof-general- Step Forward:
Ctrl+Alt+Down(macOS:Ctrl+Down) - Step Backward:
Ctrl+Alt+Up(macOS:Ctrl+Up) - Go to Cursor:
Ctrl+Alt+Right(macOS:Ctrl+Right) - Reset Proof State:
Ctrl+Alt+Left(macOS:Ctrl+Left)
- Step Forward:
none- No keybindings are contributed by the extension.
Additionally:
- Check File:
Ctrl+Shift+C(macOS:Cmd+Shift+C)
Settings (see VS Code Settings UI under “EasyCrypt”):
easycrypt.keybindings.profile:default|proof-general|noneeasycrypt.executablePath: path to the EasyCrypt binary (default:easycrypt)easycrypt.arguments: additional CLI args passed to EasyCrypt on startupeasycrypt.proverArgs: args for backend provers (passed through EasyCrypt)
Communication channels:
easycrypt.communication.channel:emacs|lsp|auto(default:emacs)
LSP options:
easycrypt.lsp.serverArgs: additional args foreasycrypt lspeasycrypt.lsp.trace.server:off|messages|verboseeasycrypt.lsp.requestTimeoutMs: timeout for proof/query requestseasycrypt.lsp.logToFile: setsEASYCRYPT_LSP_LOG=1for server logging
Diagnostics:
easycrypt.diagnostics.enabled: enable/disable diagnosticseasycrypt.diagnostics.liveChecks: enable/disable live checkseasycrypt.diagnostics.delay: debounce delay (ms) for live checkseasycrypt.diagnostics.onChange: run checks when text changeseasycrypt.diagnostics.onSave: run checks on save
Logging / debug:
easycrypt.verboseLogging: enable verbose logging to the “EasyCrypt” Output channeleasycrypt.proofStateView.debug.showEmacsPromptMarker: show the EasyCrypt-emacsprompt marker in the Proof State view
emacsremains the baseline/default for maximum context parity.lspis supported for interactive proof commands and queries through custom RPC methods.autoprefers LSP only when context is compatible; otherwise it selects emacs.- For context-sensitive setups (custom include/prover args), emacs is usually the safest choice.
- “EasyCrypt executable not found”
- Set
easycrypt.executablePathto the full path of youreasycryptbinary. - Or ensure
easycryptis on yourPATHand restart VS Code.
- Set
- Desynchronized proof state
- Run “EasyCrypt: Force Recovery (Fix Desync)”.
- If needed, run “EasyCrypt: Reset Proof State”.
- Where are logs?
- Open View → Output and select EasyCrypt.
- Enable verbose logs with “EasyCrypt: Toggle Verbose Logging”.
Prereqs: Node.js 24 + npm.
If you use nvm:
-
nvm install -
nvm use -
Install dependencies:
npm install -
Compile:
npm run compile -
Watch:
npm run watch -
Lint:
npm run lint
- Open this repo in VS Code.
- Press
F5to launch an Extension Development Host. - Open a
.ecfile in the dev host to activate the extension.
- Unit tests:
npm test - E2E tests:
npm run test:e2e
GPL-3.0. See LICENSE.