Skip to content

Commit 5a1b60d

Browse files
committed
Update dependency vscode to v1.82.0
1 parent 63dc620 commit 5a1b60d

File tree

11 files changed

+943
-254
lines changed

11 files changed

+943
-254
lines changed

vscode-testextension/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
out
2-
server
3-
node_modules
2+
node_modules
3+
.vscode-test/

vscode-testextension/.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"args": [
2626
"--disable-extensions",
2727
"--extensionDevelopmentPath=${workspaceRoot}",
28-
"--extensionTestsPath=${workspaceRoot}/out/test"
28+
"--extensionTestsPath=${workspaceRoot}/out/test/suite/index"
2929
],
3030
"stopOnEntry": false,
3131
"sourceMaps": true,

vscode-testextension/package-lock.json

Lines changed: 846 additions & 194 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vscode-testextension/package.json

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"version": "0.0.1",
77
"publisher": "vscode",
88
"engines": {
9-
"vscode": "^1.8.0"
9+
"vscode": "^1.82.0"
1010
},
1111
"categories": [
1212
"Other"
@@ -40,19 +40,25 @@
4040
}
4141
},
4242
"scripts": {
43-
"vscode:prepublish": "tsc -p ./",
43+
"vscode:prepublish": "npm run compile",
4444
"compile": "tsc -p ./",
45-
"update-vscode": "node ./node_modules/vscode/bin/install",
46-
"postinstall": "node ./node_modules/vscode/bin/install"
45+
"watch": "tsc -watch -p ./",
46+
"pretest": "npm run compile",
47+
"test": "node ./out/test/runTest.js"
4748
},
4849
"devDependencies": {
49-
"@types/mocha": "10.0.2",
50-
"@types/node": "18.17.19",
51-
"typescript": "5.2.2",
52-
"vscode": "1.1.37"
50+
"@types/glob": "^7.2.0",
51+
"@types/mocha": "^10.0.2",
52+
"@types/node": "^18.18.0",
53+
"@types/vscode": "^1.82.0",
54+
"@vscode/test-electron": "^2.3.4",
55+
"glob": "^7.2.3",
56+
"mocha": "^10.2.0",
57+
"source-map-support": "^0.5.21",
58+
"typescript": "^5.2.2"
5359
},
5460
"dependencies": {
55-
"vscode-languageclient": "^9.0.0",
61+
"vscode-languageclient": "^9.0.1",
5662
"vscode-languageserver-protocol": "^3.16.0-next.6"
5763
}
5864
}

vscode-testextension/src/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ export async function activate(context: ExtensionContext) {
3838
// run: { command: serverExe, args: ['-lsp', '-d'] },
3939
run: {
4040
command: serverExe,
41-
args: ["D:/Development/Omnisharp/csharp-language-server-protocol/sample/SampleServer/bin/Debug/netcoreapp3.1/win7-x64/SampleServer.dll"],
41+
args: ["D:/Development/Omnisharp/csharp-language-server-protocol/sample/SampleServer/bin/Debug/net6.0/win7-x64/SampleServer.dll"],
4242
transport: TransportKind.pipe,
4343
},
4444
// debug: { command: serverExe, args: ['-lsp', '-d'] }
4545
debug: {
4646
command: serverExe,
47-
args: ["D:/Development/Omnisharp/csharp-language-server-protocol/sample/SampleServer/bin/Debug/netcoreapp3.1/win7-x64/SampleServer.dll"],
47+
args: ["D:/Development/Omnisharp/csharp-language-server-protocol/sample/SampleServer/bin/Debug/net6.0/win7-x64/SampleServer.dll"],
4848
transport: TransportKind.pipe,
4949
runtime: "",
5050
},

vscode-testextension/test/extension.test.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

vscode-testextension/test/index.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

vscode-testextension/test/runTest.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import * as path from 'path';
2+
3+
import { runTests } from '@vscode/test-electron';
4+
5+
async function main() {
6+
try {
7+
// The folder containing the Extension Manifest package.json
8+
// Passed to `--extensionDevelopmentPath`
9+
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
10+
11+
// The path to the extension test script
12+
// Passed to --extensionTestsPath
13+
const extensionTestsPath = path.resolve(__dirname, './suite/index');
14+
15+
// Download VS Code, unzip it and run the integration test
16+
await runTests({ extensionDevelopmentPath, extensionTestsPath });
17+
} catch (err) {
18+
console.error('Failed to run tests');
19+
process.exit(1);
20+
}
21+
}
22+
23+
main();
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import * as assert from 'assert';
2+
3+
// You can import and use all API from the 'vscode' module
4+
// as well as import your extension to test it
5+
import * as vscode from 'vscode';
6+
// import * as myExtension from '../../extension';
7+
8+
suite('Extension Test Suite', () => {
9+
vscode.window.showInformationMessage('Start all tests.');
10+
11+
test('Sample test', () => {
12+
assert.strictEqual([1, 2, 3].indexOf(5), -1);
13+
assert.strictEqual([1, 2, 3].indexOf(0), -1);
14+
});
15+
});
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import * as path from 'path';
2+
import * as Mocha from 'mocha';
3+
import * as glob from 'glob';
4+
5+
export function run(): Promise<void> {
6+
// Create the mocha test
7+
const mocha = new Mocha({
8+
ui: 'tdd'
9+
});
10+
11+
const testsRoot = path.resolve(__dirname, '..');
12+
13+
return new Promise((c, e) => {
14+
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
15+
if (err) {
16+
return e(err);
17+
}
18+
19+
// Add files to the test suite
20+
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
21+
22+
try {
23+
// Run the mocha test
24+
mocha.run(failures => {
25+
if (failures > 0) {
26+
e(new Error(`${failures} tests failed.`));
27+
} else {
28+
c();
29+
}
30+
});
31+
} catch (err) {
32+
console.error(err);
33+
e(err);
34+
}
35+
});
36+
});
37+
}

vscode-testextension/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"module": "commonjs",
55
"moduleResolution": "node",
66
"outDir": "out",
7-
"lib": ["es2016"],
7+
"lib": ["es2020"],
88
"sourceMap": true,
99
"skipLibCheck": true
1010
},
11-
"exclude": ["node_modules", "server"]
11+
"exclude": ["node_modules", ".vscode-test"]
1212
}

0 commit comments

Comments
 (0)