Skip to content

Commit 010950a

Browse files
committed
Client in eigenes Git Repo gesplittet
0 parents  commit 010950a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3576
-0
lines changed

.github/ISSUE_TEMPLATE.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## Environment
2+
3+
- VS Code version: XXX
4+
- Extension version (available under the Extensions sidebar): XXX
5+
- Dafny version (Hovertext of `Server Up` in Statusbar): XXX
6+
- OS and version: XXX
7+
- .NET / Mono Version: XXX
8+
9+
## Expected behaviour
10+
11+
XXX
12+
13+
## Actual behaviour
14+
15+
XXX
16+
17+
## Steps to reproduce:
18+
1. XXX
19+
20+
## Logs
21+
Output for `Dafny Language Server` in the `Output` panel (`View``Output`, change the drop-down the upper-right of the `Output` panel to `Dafny Language Server`)
22+
23+
```
24+
XXX
25+
```
26+
27+
Output from `Console` under the `Developer Tools` panel (toggle Developer Tools on under `Help`)
28+
29+
```
30+
XXX
31+
```

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/out
2+
/server
3+
/dafny
4+
.vscode-test
5+
_launch_Tom.bat

.vscode/launch.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
{
3+
"version": "0.1.0",
4+
"configurations": [
5+
{
6+
"name": "Launch Extension",
7+
"type": "extensionHost",
8+
"request": "launch",
9+
"runtimeExecutable": "${execPath}",
10+
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
11+
"stopOnEntry": false,
12+
"sourceMaps": true,
13+
"outFiles": [ "${workspaceRoot}/out/src/**/*.js" ],
14+
"preLaunchTask": "npm"
15+
},
16+
{
17+
"name": "Launch Tests",
18+
"type": "extensionHost",
19+
"request": "launch",
20+
"runtimeExecutable": "${execPath}",
21+
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
22+
"stopOnEntry": false,
23+
"sourceMaps": true,
24+
"outFiles": [ "${workspaceRoot}/out/test/**/*.js" ],
25+
"preLaunchTask": "npm"
26+
}
27+
]
28+
}

.vscode/settings.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"files.exclude": {
4+
"out": false // set this to true to hide the "out" folder with the compiled JS files
5+
},
6+
"search.exclude": {
7+
"out": true // set this to false to include "out" folder in search results
8+
},
9+
"typescript.tsdk": "./node_modules/typescript/lib" // we want to use the TS server from our node_modules folder to control its version
10+
}

.vscode/symbols.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"symbols":{"VerificationResults":{"hasNamespace":false,"type":0,"moduleName":"verificationResults","relativePath":"..\\server\\src\\backend\\verificationResults"},"DafnyServerProvider":{"hasNamespace":false,"type":0,"moduleName":"dafnyProvider","relativePath":"..\\server\\src\\frontend\\dafnyProvider"},"DafnyInstaller":{"hasNamespace":false,"type":0,"moduleName":"dafnyInstaller","relativePath":"src\\dafnyInstaller"},"DafnyClientProvider":{"hasNamespace":false,"type":0,"moduleName":"dafnyProvider","relativePath":"src\\dafnyProvider"},"Context":{"hasNamespace":false,"type":0,"moduleName":"context","relativePath":"src\\context"},"CounterModelProvider":{"hasNamespace":false,"type":0,"moduleName":"counterModelProvider","relativePath":"src\\counterModelProvider"},"DafnyRunner":{"hasNamespace":false,"type":0,"moduleName":"dafnyRunner","relativePath":"src\\dafnyRunner"},"Priority":{"hasNamespace":false,"type":0,"moduleName":"dafnyStatusbar","relativePath":"src\\dafnyStatusbar"},"Statusbar":{"hasNamespace":false,"type":0,"moduleName":"dafnyStatusbar","relativePath":"src\\dafnyStatusbar"},"DotGraphProvider":{"hasNamespace":false,"type":0,"moduleName":"dotGraphProvider","relativePath":"src\\dotGraphProvider"},"CommandFailedException":{"hasNamespace":false,"type":0,"moduleName":"errors","relativePath":"src\\errors"},"RequestFailedException":{"hasNamespace":false,"type":0,"moduleName":"errors","relativePath":"src\\errors"},"CommandEndFailedException":{"hasNamespace":false,"type":0,"moduleName":"errors","relativePath":"src\\errors"},"ByteOutOfRangeException":{"hasNamespace":false,"type":0,"moduleName":"errors","relativePath":"src\\errors"},"DafnyServerExeption":{"hasNamespace":false,"type":0,"moduleName":"errors","relativePath":"src\\errors"},"IncorrectPathExeption":{"hasNamespace":false,"type":0,"moduleName":"errors","relativePath":"src\\errors"},"DafnyUnsupportedPlatform":{"hasNamespace":false,"type":0,"moduleName":"errors","relativePath":"src\\errors"},"Severity":{"hasNamespace":false,"type":0,"moduleName":"stringRessources","relativePath":"src\\stringRessources"},"WarningMsg":{"hasNamespace":false,"type":0,"moduleName":"stringRessources","relativePath":"src\\stringRessources"},"ErrorMsg":{"hasNamespace":false,"type":0,"moduleName":"stringRessources","relativePath":"src\\stringRessources"},"Config":{"hasNamespace":false,"type":0,"moduleName":"stringRessources","relativePath":"src\\stringRessources"},"Application":{"hasNamespace":false,"type":0,"moduleName":"stringRessources","relativePath":"src\\stringRessources"},"Commands":{"hasNamespace":false,"type":0,"moduleName":"stringRessources","relativePath":"src\\stringRessources"},"InfoMsg":{"hasNamespace":false,"type":0,"moduleName":"stringRessources","relativePath":"src\\stringRessources"},"ServerStatus":{"hasNamespace":false,"type":0,"moduleName":"stringRessources","relativePath":"src\\stringRessources"},"Answer":{"hasNamespace":false,"type":0,"moduleName":"stringRessources","relativePath":"src\\stringRessources"},"EnvironmentConfig":{"hasNamespace":false,"type":0,"moduleName":"stringRessources","relativePath":"src\\stringRessources"},"StatusString":{"hasNamespace":false,"type":0,"moduleName":"stringRessources","relativePath":"src\\stringRessources"},"LanguageServerRequest":{"hasNamespace":false,"type":0,"moduleName":"stringRessources","relativePath":"src\\stringRessources"},"LanguageServerNotification":{"hasNamespace":false,"type":0,"moduleName":"stringRessources","relativePath":"src\\stringRessources"},"VerificationResult":{"hasNamespace":false,"type":0,"moduleName":"verificationResult","relativePath":"src\\verificationResult"},"UnitTestCallback":{"hasNamespace":false,"type":0,"moduleName":"extension.test","relativePath":"src\\extension.test"},"LocalQueue":{"hasNamespace":false,"type":0,"moduleName":"localQueue","relativePath":"src\\serverHelper\\localQueue"},"CompilerResult":{"hasNamespace":false,"type":0,"moduleName":"compilerResult","relativePath":"src\\serverHelper\\compilerResult"}},"files":{"src\\dafnyStatusbar.ts":"2017-06-12T06:28:20.277Z","src\\errors.ts":"2017-06-12T06:28:20.281Z","src\\stringRessources.ts":"2017-06-12T06:28:20.297Z","src\\verificationResult.ts":"2017-06-12T06:28:20.297Z","test\\extension.test.ts":"2017-06-12T06:28:20.297Z","test\\index.ts":"2017-06-12T06:28:20.297Z","src\\commands.ts":"2017-06-12T06:28:18.214Z","src\\serverHelper\\dataConversions.ts":"2017-06-12T06:28:20.281Z","..\\server\\src\\frontend\\dafnyProvider.ts":"2017-04-24T12:42:07.367Z","src\\dafnyRunner.ts":"2017-06-12T06:28:20.273Z","src\\serverHelper\\compilerResult.ts":"2017-06-12T06:28:20.281Z","src\\serverHelper\\localQueue.ts":"2017-06-12T06:28:20.281Z","src\\context.ts":"2017-06-12T06:28:18.230Z","src\\counterModelProvider.ts":"2017-06-12T06:28:18.230Z","src\\dotGraphProvider.ts":"2017-06-12T06:28:20.281Z","src\\extension.ts":"2017-06-12T06:28:20.281Z","src\\dafnyProvider.ts":"2017-06-12T06:28:20.269Z","test\\extension.test.1.ts":"2017-06-12T06:28:20.297Z","src\\extension.test.ts":"2017-06-12T06:28:20.281Z"}}

.vscode/tasks.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Available variables which can be used inside of strings.
2+
// ${workspaceRoot}: the root folder of the team
3+
// ${file}: the current opened file
4+
// ${fileBasename}: the current opened file's basename
5+
// ${fileDirname}: the current opened file's dirname
6+
// ${fileExtname}: the current opened file's extension
7+
// ${cwd}: the current working directory of the spawned process
8+
9+
// A task runner that calls a custom npm script that compiles the extension.
10+
{
11+
"version": "0.1.0",
12+
13+
// we want to run npm
14+
"command": "npm",
15+
16+
// the command is a shell script
17+
"isShellCommand": true,
18+
19+
// show the output window only if unrecognized errors occur.
20+
"showOutput": "silent",
21+
22+
// we run the custom script "compile" as defined in package.json
23+
"args": ["run", "compile", "--loglevel", "silent"],
24+
25+
// The tsc compiler is started in watching mode
26+
"isWatching": true,
27+
28+
// use the standard tsc in watch mode problem matcher to find compile problems in the output.
29+
"problemMatcher": "$tsc-watch"
30+
}

.vscodeignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.vscode/**
2+
.vscode-test/**
3+
out/test/**
4+
test/**
5+
src/**
6+
**/*.map
7+
.gitignore
8+
tsconfig.json
9+
vsc-extension-quickstart.md
10+
dafny

CHANGELOG.md

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Release Notes
2+
3+
## 0.17.1
4+
* Correct Dafny Github repository name ([#49](https://github.com/DafnyVSCode/Dafny-VSCode/issues/49))
5+
* Change typescript target from es6 to es2017
6+
* Upgrade `js-yaml` to 3.13.1 to fix security vunerability
7+
* Upgrade Dafny in tests to 2.3.0
8+
9+
## 0.17.0
10+
* Rename configuration option `monoPath` to `monoExecutable` ([#40](https://github.com/DafnyVSCode/Dafny-VSCode/pull/40))
11+
* Update deprecated API calls ([#39](https://github.com/DafnyVSCode/Dafny-VSCode/pull/39))
12+
* Remove deprecated Flow Graph Visualization
13+
* Update minimal VSCode version to 1.25.1
14+
* Update dependencies
15+
* Extension code clean up
16+
17+
## 0.16.0
18+
* Allow customizing the arguments passed to the verify backend ([#42](https://github.com/DafnyVSCode/Dafny-VSCode/pull/42)).
19+
* Update insecure dependencies
20+
21+
## 0.15.0
22+
* Change extension key from FunctionalCorrectness to correctnessLab.
23+
* Fix tslint errors ([#38](https://github.com/DafnyVSCode/Dafny-VSCode/pull/38)).
24+
25+
## 0.14.3
26+
* Rebranding and small readme fixes.
27+
28+
## 0.14.2
29+
* Add workaround for dafny counterExample bug ([#23](https://github.com/DafnyVSCode/Dafny-VSCode/issues/23)).
30+
31+
## 0.14.1
32+
* Clearify mono installation message on macOS.
33+
* Fix incomplete copyright notice and improve contributors section in readme ([#37](https://github.com/DafnyVSCode/Dafny-VSCode/issues/37)).
34+
35+
## 0.14.0
36+
* Fix installation of Dafny on some constellations on Windows ([#7](https://github.com/DafnyVSCode/Dafny-VSCode/issues/7)).
37+
* Check for a recent mono version on launch.
38+
39+
## 0.13.0
40+
41+
* Fixed the CodeLens references counter (Thanks [@GoryMoon](https://github.com/GoryMoon)!)
42+
* Dependencies were upgraded to prevent several vulnerabilities.
43+
44+
## 0.12.0
45+
* The Dafny base path can now alternatively be set via the environment variable DAFNY_PATH.
46+
* Dependencies were upgraded to prevent several vulnerabilities.
47+
48+
## 0.11.1
49+
Use Dafny releases from Microsoft/dafny. Miscellaneous bug fixes.
50+
51+
## 0.10.10
52+
BugFix: Decrease guard
53+
54+
## 0.10.9
55+
BugFix: Rename method
56+
57+
## 0.10.8
58+
Warning if no workspace is used
59+
Changelog
60+
61+
## 0.10.7
62+
BugFix Ubuntu
63+
64+
## 0.10.2
65+
Added Context Menu Commands
66+
67+
## 0.10.1
68+
Manually show counterexample, flow graph
69+
70+
## 0.10.0
71+
Display counter example for failing proof. Switched to typescript implementation to download dependencies. Lots of bugfixes
72+
73+
## 0.9.0
74+
Switched to Language Server. IntelliSense for classes, compile and execute Dafny program in VSCode. QuickFix for decrease, increase and object may be null.
75+
76+
## 0.8.0
77+
CodeLens showing method references, Go to Definition, version checking for newer Dafny release.
78+
79+
## 0.6.0
80+
DafnyDef allows to get SymbolInformation from DafnyServer, which will allow in the future to implement Refactorings. Go to Definition is already implemented.
81+
82+
## 0.5.5
83+
Fallback to wget, if curl is not found.
84+
85+
## 0.5.4
86+
Automatic validation as you type.
87+
88+
## 0.5.1
89+
Smaller bugfixes.
90+
91+
## 0.5.0
92+
Automatic download and installation task on osx and ubuntu `dafny.installDafny`. Also added uninstaller `dafny.uninstallDafny`.
93+
94+
## 0.4.4
95+
Uninstall task of dafny on windows.
96+
97+
## 0.4.0
98+
Automatic download and installation task on windows.
99+
100+
## 0.2.0
101+
Full refactoring of the plugin. issues/3 from ferry~ fixed.
102+
103+
## 0.1.2
104+
Refactored/tweaked UI code, Added `dafny.restartDafnyServer` ("Restart Dafny Server") command.
105+
106+
## 0.1.0
107+
Added syntax highlighting, tested on Ubuntu and OSX.
108+
109+
## 0.0.3
110+
Getting `mono` from PATH when `monoPath` isn't set.
111+
112+
## 0.0.2
113+
Fixed readme and license, added use animation.
114+
115+
## 0.0.1
116+
Initial release, some half baked features turned off.

CodeLens.png

233 KB
Loading

Compile.png

110 KB
Loading

Completion.png

114 KB
Loading

Counter.png

242 KB
Loading

GoTo.png

164 KB
Loading

LICENSE

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
MIT License
2+
Copyright (c) 2016 Jonathan Rosca
3+
Copyright (c) 2017 Markus Schaden, Rafael Krucker
4+
Copyright (c) 2018 Institute for Software - University of Applied Science (HSR) Rapperswil
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9+
10+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Dafny for Visual Studio Code
2+
3+
4+
This extension adds _Dafny_ support to Visual Studio Code.
5+
6+
## Features
7+
8+
* **Compile and run `.dfy` files.**
9+
* Automatic installation of the newest _Dafny_ version.
10+
* **Automatic verification as one types.**
11+
* Errors, warnings and hints are shown through the VSCode interface.
12+
* When there are no errors, you get a 👍 on the status bar.
13+
* **Syntax highlighting** thanks to [sublime-dafny](https://github.com/erggo/sublime-dafny). See file `LICENSE_sublime-dafny.rst` for license.
14+
* **Display counter example** for failing proof.
15+
* _IntelliSense_ for classes and _CodeLens_ showing method references.
16+
17+
![assertions animation](simpleassert.gif)
18+
19+
You can find [more Examples below](#examples).
20+
21+
## Shortcuts
22+
23+
| Shortcut | Description |
24+
| :------------------------ |:-------------------------------------------------------------------- |
25+
| `Ctrl+Shift+B` or `⇧+⌘+B` | Compile `.dfy` file to `.dll` or `.exe`, if there is a `Main` method |
26+
| `F5` | Compile and run, if the source file has a `Main` method |
27+
| `F7` | Show _CounterExample_ |
28+
| `F8` | Hide _CounterExample_ |
29+
30+
## Tasks
31+
32+
Choose `Tasks -> Run Task...` to run one of the following:
33+
34+
| Task | Description |
35+
| :---------------------- |:----------------------------------------------------------------------------------------- |
36+
| `Install DafnyServer` | Downloads and installs the _DafnyServer_ and sets the `dafny.dafnyServerPath accordingly` |
37+
| `Uninstall DafnyServer` | Uninstalls the _DafnyServer_ |
38+
| `Restart DafnyServer` | Restarts the _DafnyServer_ |
39+
40+
## Requirements
41+
42+
* The plugin needs a _.NET_ runtime to run the _DafnyServer_. If you are not on Windows, please download a distribution from [Mono](http://www.mono-project.com).
43+
* Note: When you first open a _Dafny_ file, the extension will prompt you to automatically install _Dafny_ and Mono.
44+
* In case you would like the plugin to use a different _Dafny_ distribution, set the path to the `DafnyServer.exe` file via the `dafny.dafnyServerPath` user setting.
45+
46+
## Extension Settings
47+
48+
| Setting | Description | Default |
49+
| :--------------- |:---------------------------------------- |:---------------- |
50+
| `dafny.basePath` | Absolute path to the _Dafny_ binary directory (which contains `DafnyServer.exe`). | |
51+
| `dafny.monoExecutable` | Mono executable with absolute path. Only necessary if mono is not in system PATH (you'll get an error if that's the case). Ignored on Windows when `useMono` is `false`. | |
52+
| `dafny.useMono` | Only applicable to _Windows_! Requires _.NET_ 4.5 or higher when set to `false`. | `false` |
53+
| `dafny.automaticVerification` | Verify as soon as the document is changed. When `false`, only verify on save. | `true` |
54+
| `dafny.automaticVerificationDelayMS` | Delay in ms to wait after a document change before verifying document. This avoids syntax errors while typing. Only relevant if `automaticVerification` is `true`. | `700` |
55+
| `dafny.automaticShowCounterModel` | Show _CounterModel_ automatically if a proof fails. Might cause performance issues if `true`. | `false` |
56+
| `dafny.serverVerifyArguments` | Additional arguments to pass to the "verify" command of the Dafny Server. E.g.`["/timeLimit:40", "/vcsLoad:1"]` | `[]` |
57+
58+
## Examples
59+
60+
### Installation
61+
On the first start the plugin asks you to install _Dafny_ automatically.
62+
63+
![assertions animation](installation.gif)
64+
65+
### Syntax Error Underlining
66+
![Syntax](Syntax.png)
67+
Whenever a postcondition statement does not hold, the user will be informed.
68+
69+
### Compile and Run
70+
Pressed `F5` to compile and run the program.
71+
72+
![Compile](Compile.png)
73+
74+
### Show Counter Example
75+
Pressed `F7` to show counter examples.
76+
77+
![Counter](Counter.png)
78+
79+
### Auto Completion
80+
Pressed `control + space` to show auto completion suggestions.
81+
82+
![Completion](Completion.png)
83+
84+
### Go to Definition
85+
Pressed `control + space` to show auto completion suggestions.
86+
87+
![Go to Definition](GoTo.png)
88+
Press `F12` to jump to the definition.
89+
90+
### Add null check (coming soon)
91+
Some diagnostics can be directly inserted with a quickfix at the beginning of a line.
92+
93+
![assertions animation](addnullcheck.gif)
94+
95+
## Contribute
96+
97+
This is a MIT licensed open-source project that lives from code contributions. All contributors are listed in our [project readme](https://github.com/DafnyVSCode/Dafny-VSCode#contributors).
98+
99+
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](https://github.com/DafnyVSCode/Dafny-VSCode#contribute).

Syntax.png

171 KB
Loading

ThirdPartyNotices.txt

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
2+
For Microsoft vscode-languageserver-node-example
3+
4+
This project incorporates material from the project(s) listed below (collectively, “Third Party Code”).
5+
Microsoft is not the original author of the Third Party Code. The original copyright notice and license
6+
under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed
7+
to you under their original license terms set forth below. Microsoft reserves all other rights not expressly
8+
granted, whether by implication, estoppel or otherwise.
9+
10+
1. DefinitelyTyped version 0.0.1 (https://github.com/borisyankov/DefinitelyTyped)
11+
12+
This project is licensed under the MIT license.
13+
Copyrights are respective of each contributor listed at the beginning of each definition file.
14+
15+
Permission is hereby granted, free of charge, to any person obtaining a copy
16+
of this software and associated documentation files (the "Software"), to deal
17+
in the Software without restriction, including without limitation the rights
18+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19+
copies of the Software, and to permit persons to whom the Software is
20+
furnished to do so, subject to the following conditions:
21+
22+
The above copyright notice and this permission notice shall be included in
23+
all copies or substantial portions of the Software.
24+
25+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31+
THE SOFTWARE.

0 commit comments

Comments
 (0)