https://github.com/dafny-lang/ide-vscode

VSCode IDE Integration for Dafny

https://github.com/dafny-lang/ide-vscode

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.6%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

VSCode IDE Integration for Dafny

Basic Info
Statistics
  • Stars: 26
  • Watchers: 10
  • Forks: 22
  • Open Issues: 93
  • Releases: 61
Created about 6 years ago · Last pushed 10 months ago
Metadata Files
Readme Changelog Contributing License

README.md

Dafny for Visual Studio Code

This extension supports Dafny version 3 and beyond. If you require Dafny 2 support, consider using the legacy extension.

Features

  • Compile and Run .dfy files.
  • Verification as one types.
  • Syntax highlighting thanks to sublime-dafny. See file LICENSE_sublime-dafny.rst for license.
  • Display the verification trace for failing assertions.
  • IntelliSense to suggest symbols.
  • Go to definition 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 | | F5 | Compile and run, if the source file has a Main method | | F6 | Compile with custom arguments | | F7 | Show verification trace | | F8 | Hide verification trace |

Requirements

The plugin requires at least .NET Core 5.0 (the ASP.NET Core 5.0 or 6.0 runtimes 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.

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 the verification trace

Press F7 to show the verification trace.

VerificationTrace

Press F8 to hide the verification trace.

Additionally the context menu helps you show/hide the verification trace, as well as copy it to the clipboard with the assume keyword to insert it into the code if needed. VerificationTraceMenu

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:

```sh

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.

Building Locally

To build Dafny VSCode locally, first clone this repository.

sh git clone https://github.com/dafny-lang/ide-vscode.git

Change into the root directory of the previously cloned repository and install the node modules.

sh npm install

To build and debug using Visual Studio Code, install the TypeScript + Webpack Problem Matchers extension. After the installation, open the root folder within VSCode and hit F5 to debug the Dafny extension.

To debug the extension from source, with a custom version of Dafny, you can use the launch configuration "Run with $DAFNYDEVSERVER", which looks at the environment variable DAFNY_DEV_SERVER to determine which Dafny CLI to use to run the language server. For example, if you have a local checkout of Dafny at location /my/path/to/dafny, you can set DAFNY_DEV_SERVER to /my/path/to/dafny/Binaries/Dafny.dll.

Packaging

To create a VSIX package of the previously built sources, create the package through the CLI:

sh npx vsce package

Coding Conventions

We use ESLint with the TypeScript plugin to ensure code consistency across the whole source. Install the ESLint extension in VSCode to have live feedback. Alternatively, you can check your code from the command line by running npm run lint.

Owner

  • Name: Dafny
  • Login: dafny-lang
  • Kind: organization

Dafny is a verification-aware programming language

GitHub Events

Total
  • Create event: 14
  • Release event: 4
  • Issues event: 32
  • Watch event: 3
  • Delete event: 6
  • Issue comment event: 28
  • Push event: 28
  • Pull request review comment event: 6
  • Pull request review event: 21
  • Pull request event: 36
  • Fork event: 2
Last Year
  • Create event: 14
  • Release event: 4
  • Issues event: 32
  • Watch event: 3
  • Delete event: 6
  • Issue comment event: 28
  • Push event: 28
  • Pull request review comment event: 6
  • Pull request review event: 21
  • Pull request event: 36
  • Fork event: 2

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 69
  • Total pull requests: 83
  • Average time to close issues: 5 months
  • Average time to close pull requests: 4 days
  • Total issue authors: 30
  • Total pull request authors: 11
  • Average comments per issue: 1.13
  • Average comments per pull request: 0.12
  • Merged pull requests: 58
  • Bot issues: 0
  • Bot pull requests: 8
Past Year
  • Issues: 22
  • Pull requests: 37
  • Average time to close issues: 11 days
  • Average time to close pull requests: 6 days
  • Issue authors: 10
  • Pull request authors: 4
  • Average comments per issue: 0.55
  • Average comments per pull request: 0.05
  • Merged pull requests: 23
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • kjx (13)
  • RustanLeino (8)
  • erniecohen (7)
  • keyboardDrummer (6)
  • MikaelMayer (4)
  • seebees (3)
  • tchajed (3)
  • ethanbb (2)
  • TonyP4N (2)
  • jtristan (1)
  • AndrzejBlikle (1)
  • masecla22 (1)
  • damienstanton (1)
  • cdstanford (1)
  • emantrigo (1)
Pull Request Authors
  • MikaelMayer (27)
  • keyboardDrummer (26)
  • dependabot[bot] (8)
  • robin-aws (5)
  • alex-chew (4)
  • atomb (3)
  • RiscadoA (2)
  • dschoepe (2)
  • anthowan (2)
  • emantrigo (2)
  • BurstingF (2)
Top Labels
Issue Labels
bug (6) enhancement (4) language server (2) ci (1) question (1) performance (1)
Pull Request Labels
dependencies (8) github_actions (1)

Dependencies

.github/workflows/azure-pipelines.yml actions
  • actions/checkout v2 composite
  • actions/setup-node v3 composite
.github/workflows/ci.yaml actions
  • actions/checkout v2 composite
  • actions/create-release v1 composite
  • actions/download-artifact v2 composite
  • actions/setup-node v1 composite
  • actions/upload-artifact v2 composite
  • actions/upload-release-asset v1 composite
package-lock.json npm
  • 416 dependencies
package.json npm
  • @types/glob ^7.1.4 development
  • @types/mocha ^9.1.0 development
  • @types/node ^16.11.43 development
  • @types/promise.any ^2.0.0 development
  • @types/proxyquire ^1.3.28 development
  • @types/vscode ^1.68.0 development
  • @types/which ^2.0.1 development
  • @typescript-eslint/eslint-plugin ^4.31.1 development
  • @typescript-eslint/parser ^4.31.1 development
  • @vscode/test-electron ^1.6.2 development
  • eslint ^7.32.0 development
  • glob ^7.1.7 development
  • mocha ^9.2.0 development
  • ts-loader ^9.2.5 development
  • typescript ^4.4.3 development
  • webpack ^5.52.1 development
  • webpack-cli ^4.10.0 development
  • cross-fetch ^3.1.5
  • extract-zip ^2.0.1
  • got ^11.8.2
  • promise.any ^2.0.2
  • proxyquire ^2.1.3
  • vscode-languageclient ^7.0.0
  • vscode-uri ^3.0.2
  • which ^2.0.2