A Visual Studio Code test extension that allows users to run their Kani Rust Verifier proofs and view traces natively in vscode.
- Open a rust crate or workspace in Visual Studio Code
- Navigate to the testing panel and expand on the Kani Proofs tree where the proofs are stored
- Click on the play button beside the harness or the filename or the crate to run Kani on the respective test case.
- Run proofs natively the same way you run your test
- View verification result and failed properties
- View counter example report for failed proofs
- Visual Studio Code 1.50 or newer
- Kani 0.12 or newer
This extension is still in beta and has not yet been published on the marketplace. If you wish to use it now, you can download the binary and install it manually.
- If you have not already done so, Install kani.
- If you have not already done so, install VSCode.
- Download the Kani extension binary from our release page.
- In VSCode, open the command palette (
Ctrl+Shift+P
orCmd+Shift+P
on Mac) and type ext install - Select the
Extensions: Install from VSIX...
command. - In the file dialog that opens, navigate to the location where you downloaded the
.vsix
file and select it. - The extension should be installed and you should see a message in the VS Code output pane saying that the extension was installed successfully.
If you want to build and package from source directly, see dev-documentation for more information.
There is a known issue where the extension appears to get stuck if the stack size is too small. If you experience this issue, you can increase the stack size or stop the verification. We are working to removing the need to increase the stack size.
Here is the workaround for the issue,
The user can set the environment variable COMPlus_DefaultStackSize
to a sufficiently large value before starting VSCode. For example:
# Increase the stack size
export COMPlus_DefaultStackSize=100000
# Launch VSCode
code
OR
stop the verification using the stop button on the testing panel.
See SECURITY for more information.
This code is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE-APACHE and LICENSE-MIT for details.
This project has adopted the Rust Code Of Conduct. See CODE OF CONDUCT for details.