Skip to content

Commit e3a6e87

Browse files
Add verification symbols test (#234)
Fixes #236 ### Changes - Run VSCode backed integration tests using the nightly Dafny language server - Always use a mocked `vscode` in the existing tests in `src/test/suite/extension.test.ts`. Note the missing `@global: true` annotation was added in the proxyquire usage. - Fix a bug that prevented verification management from working with unsaved files - Fix a bug that broke the restart server feature ### Testing - [WIP] Add a test for the `dafny.restartServer` command. I had to turn this test off because it causes the following test to fail. It triggers an issue described here: microsoft/vscode-languageserver-node#755 - Add a integration test for verification management
1 parent 1970f81 commit e3a6e87

10 files changed

+251
-167
lines changed

.vscode/launch.json

+2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@
3939
"request": "launch",
4040
"runtimeExecutable": "${execPath}",
4141
"args": [
42+
"--disable-extensions",
4243
"--extensionDevelopmentPath=${workspaceFolder}",
4344
"--extensionTestsPath=${workspaceFolder}/out/src/test/suite/index"
4445
],
46+
"env": { "dafnyIdeVersion": "latest nightly" },
4547
"outFiles": [
4648
"${workspaceFolder}/out/**/*.js",
4749
"${workspaceFolder}/dist/**/*.js"

dist/.gitkeep

Whitespace-only changes.

package-lock.json

+82-137
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,13 @@
287287
"eslint": "^7.32.0",
288288
"glob": "^7.1.7",
289289
"mocha": "^9.2.0",
290-
"node-fetch": "^3.2.6",
291290
"ts-loader": "^9.2.5",
292291
"typescript": "^4.4.3",
293292
"webpack": "^5.52.1",
294293
"webpack-cli": "^4.10.0"
295294
},
296295
"dependencies": {
296+
"cross-fetch": "^3.1.5",
297297
"extract-zip": "^2.0.1",
298298
"got": "^11.8.2",
299299
"promise.any": "^2.0.2",
@@ -302,4 +302,4 @@
302302
"vscode-uri": "^3.0.2",
303303
"which": "^2.0.2"
304304
}
305-
}
305+
}

src/language/dafnyInstallation.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ import { ConfigurationConstants, LanguageServerConstants } from '../constants';
1313
import Configuration from '../configuration';
1414
import { exec } from 'child_process';
1515
import { chdir as processChdir, cwd as processCwd } from 'process';
16-
import { RequestInfo, RequestInit } from 'node-fetch';
17-
18-
const fetch = (url: RequestInfo, init?: RequestInit) =>
19-
import('node-fetch').then(({ default: fetch }) => fetch(url, init));
16+
import fetch from 'cross-fetch';
2017

2118
const execAsync = promisify(exec);
2219

@@ -45,7 +42,7 @@ async function getConfiguredTagAndVersion(): Promise<[string, string]> {
4542
}
4643

4744
async function getConfiguredGitTagAndVersionUncached(): Promise<[string, string]> {
48-
let version = Configuration.get<string>(ConfigurationConstants.PreferredVersion);
45+
let version = process.env['dafnyIdeVersion'] ?? Configuration.get<string>(ConfigurationConstants.PreferredVersion);
4946
switch(version) {
5047
case LanguageServerConstants.LatestStable:
5148
version = LanguageServerConstants.LatestVersion;

0 commit comments

Comments
 (0)