GithubHelp home page GithubHelp logo

amaurremi / ide-vscode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dafny-lang/ide-vscode

0.0 1.0 0.0 6.07 MB

VSCode IDE Integration for Dafny

Home Page: https://marketplace.visualstudio.com/items?itemName=correctnessLab.dafny-vscode

License: MIT License

Dockerfile 1.51% Batchfile 0.01% TypeScript 98.09% JavaScript 0.39%

ide-vscode's Introduction

Dafny for Visual Studio Code

This extension adds Dafny 3 support to Visual Studio Code. If you require Dafny 2 support, consider using the legacy extension. This VSCode plugin requires the Dafny language server (shipped with the Dafny release since v3.1.0). The plugin will install it automatically upon first use.

Features

  • Compatible to Dafny 3.2.0.
  • Compile and Run .dfy files.
  • Verification as one types.
  • Syntax highlighting thanks to sublime-dafny. See file LICENSE_sublime-dafny.rst for license.
  • Display CounterExample for failing proof.
  • IntelliSense to suggest symbols.
  • GoToDefinition to quickly navigate.
  • Hover Information for symbols.

You can find examples below.

Shortcuts

Shortcut Description
Ctrl+Shift+B or โ‡ง+โŒ˜+B Compile to .dll or, if there is a Main method, to .exe file
F2 Rename a symbol
F5 Compile and run, if the source file has a Main method
F6 Compile with custom arguments
F7 Show CounterExample
F8 Hide CounterExample
F9 Restarts the Dafny Language Server, also installs the latest language server version.

Requirements

The plugin requires at least .NET Core 5.0 (the ASP.NET Core 5.0 runtime to be more specific) to run the Dafny Language Server. Please download a distribution from Microsoft. When you first open a Dafny file, the extension will prompt you to install .NET Core manually. The language server gets installed automatically.

Extension Settings

Setting Description Default
dafny.languageServerRuntimePath Absolute or relative path to the Dafny language server runtime (DafnyLS.dll). ../../dafnyLanguageServer/DafnyLS.dll
dafny.automaticVerification Optional string to control when the document should be verified (choose between never, onchange, and onsave. onchange
dafny.languageServerLaunchArgs Optional array of strings as Dafny language server arguments. [ ]
dafny.compilerRuntimePath Absolute or relative path to the Dafny compiler (Dafny.dll). ../../dafnyLanguageServer/Dafny.dll
dafny.compilerArgs Optional array of strings as Dafny compilation arguments. [ "/verifyAllModules", "/compile:1", "/spillTargetCode:1" ]
dafny.compilerOutputDir Absolute or relative path to the compilation output directory. bin
dafny.dotnetExecutablePath Absolute path to the dotnet executable. Only necessary if dotnet is not in system PATH (you'll get an error if that's the case).
dafny.colorCounterExamples Customize the color (HEX) of Counter Examples. There are two default colors: for dark theme (#0d47a1, #e3f2fd) and light theme (#bbdefb, #102027). This color setting will override both defaults. { "backgroundColor": null, "fontColor": null }
dafny.terminalCommandPrefix The prefix to use when executing a command in the VS Code terminal. Defaults to & on windows.

Please note that in this new plugin version "automatic verification" is always on and a language server side feature.

Examples

Here are a few impressions of the features.

Installation

On the first start, the plugin will install the Dafny language server automatically.

Installation

Error Highlighting

Syntax

Whenever a syntax, semantic, or verification error is present, the plugin will inform the user.

Compile and Run

Press F5 to compile and run the program.

Compile

Show Counter Example

Press F7 to show counterexamples.

Counter

Hover Information

Hover a symbol to get information about that symbol.

Hover

IntelliSense

Type a dot to get a list of possible members of the accessed symbol.

IntelliSense

Automatic Verification

If VSCode appears unresponsive, you may lower the verification frequency or disable it entirely.

Automatic Verification

Troubleshooting

Stuck at Verifying...

Under certain circumstances, the extension appears to be stuck at Verifying.... Until now, this has only been observed for Mac OSX and occurs due to a stack overflow in the language server. To overcome this issue, 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

Contribute

Dafny for Visual Studio Code is an MIT licensed open-source project that lives from code contributions.

We welcome your help! For a description of how you can contribute, as well as a list of issues you can work on, please visit the Dafny-VSCode GitHub repository.

ide-vscode's People

Contributors

camrein avatar fabianhauser avatar just-me- avatar keyboarddrummer avatar rustanleino avatar tom852 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.