Skip to content

creusot-rs/creusot-ide

Repository files navigation

Creusot IDE

VSM

A VS Code extension providing support for Creusot, a deductive verifier for Rust code.

This project is work in progress. An official release is upcoming.

Install Creusot IDE

Creusot itself should be installed separately.

Creusot IDE consists of two parts:

  1. The Creusot IDE extension, installed via VS Code: open VS Code > Extensions > Search "Creusot IDE".

  2. The Creusot LSP language server, which must currently be installed separately:

    1. First, install Creusot, Why3, and Why3find; see https://github.com/creusot-rs/creusot for instructions

    2. git clone https://github.com/creusot-rs/creusot-ide

    3. The installation location is the Creusot-local switch, which depends on your OS.

      On Linux:

       opam pin --switch=~/.local/share/creusot creusot-lsp creusot-ide/ -y
      

      On MacOS:

       opam pin --switch=~/.creusot creusot-lsp creusot-ide/ -y
      

At the moment, installing creusot-lsp in another switch or without opam altogether is not supported.

Features

Creusot IDE helps you nagivate between your Rust sources and the verification artifacts generated by Creusot and Why3find.

  • Run and inspect proofs from within the editor.
    • Functions with proof obligations will have a button in the gutter to their left. Click to run the prover (why3find prove). Alt+click to start Why3 IDE (only if the prover fails).
  • Diagnostics underline locations with failed proofs
  • Syntax highlighting:
    • .rs files: Creusot-specific attributes and Pearlite expressions,
    • .coma files.

Commands

Available in the command palette (Ctrl+P):

  • Restart language server
  • Stop language server

Settings

  • creusot.lspPath: Path to the creusot-lsp executable. Default: "", to find the executable in PATH.

Known issues

Compatibility with standard Rust tools (Rust analyzer, etc.)

  • Rust analyzer doesn't know how to parse Creusot specifications (attributes such as ensures, etc.), so they are underlined in red.

    Add this option in settings.json:

    "rust-analyzer.check.overrideCommand": [
            "cargo",
            "creusot",
            "--",
            "--message-format=json"
        ]
    

Developers' corner

To build and install the VS Code extension from source:

npx vsce package

Then, in VS Code: Command Palette > Install from VSIX. Select the creusot-ide-X.Y.Z.vsix file created by the previous command.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages