Skip to content

Commit d42fad2

Browse files
authored
eng: move selfhost test provider as a workspace extension (microsoft#208699)
Testing microsoft#208184, closes microsoft#207756
1 parent baa003c commit d42fad2

20 files changed

+2008
-2
lines changed

.vscode/extensions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"editorconfig.editorconfig",
77
"github.vscode-pull-request-github",
88
"ms-vscode.vscode-github-issue-notebooks",
9-
"ms-vscode.vscode-selfhost-test-provider",
109
"ms-vscode.extension-test-runner",
1110
"jrieken.vscode-pr-pinger"
1211
]
7.52 KB
Loading
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"name": "vscode-selfhost-test-provider",
3+
"displayName": "VS Code Selfhost Test Provider",
4+
"description": "Test provider for the VS Code project",
5+
"enabledApiProposals": [
6+
"testObserver"
7+
],
8+
"engines": {
9+
"vscode": "^1.88.0"
10+
},
11+
"contributes": {
12+
"commands": [
13+
{
14+
"command": "selfhost-test-provider.updateSnapshot",
15+
"title": "Update Snapshot",
16+
"icon": "$(merge)"
17+
}
18+
],
19+
"menus": {
20+
"commandPalette": [
21+
{
22+
"command": "selfhost-test-provider.updateSnapshot",
23+
"when": "false"
24+
}
25+
],
26+
"testing/message/context": [
27+
{
28+
"command": "selfhost-test-provider.updateSnapshot",
29+
"group": "inline@1",
30+
"when": "testMessage == isSelfhostSnapshotMessage && !testResultOutdated"
31+
}
32+
],
33+
"testing/message/content": [
34+
{
35+
"command": "selfhost-test-provider.updateSnapshot",
36+
"when": "testMessage == isSelfhostSnapshotMessage && !testResultOutdated"
37+
}
38+
]
39+
}
40+
},
41+
"icon": "icon.png",
42+
"version": "0.4.0",
43+
"publisher": "ms-vscode",
44+
"categories": [
45+
"Other"
46+
],
47+
"activationEvents": [
48+
"workspaceContains:src/vs/loader.js"
49+
],
50+
"workspaceTrust": {
51+
"request": "onDemand",
52+
"description": "Trust is required to execute tests in the workspace."
53+
},
54+
"main": "./out/extension.js",
55+
"prettier": {
56+
"printWidth": 100,
57+
"singleQuote": true,
58+
"tabWidth": 2,
59+
"arrowParens": "avoid"
60+
},
61+
"repository": {
62+
"type": "git",
63+
"url": "https://github.com/microsoft/vscode.git"
64+
},
65+
"license": "MIT",
66+
"scripts": {
67+
"compile": "gulp compile-extension:vscode-selfhost-test-provider",
68+
"watch": "gulp watch-extension:vscode-selfhost-test-provider"
69+
},
70+
"devDependencies": {
71+
"@types/node": "18.x"
72+
},
73+
"dependencies": {
74+
"@jridgewell/trace-mapping": "^0.3.25",
75+
"ansi-styles": "^5.2.0",
76+
"istanbul-to-vscode": "^2.0.1"
77+
}
78+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*---------------------------------------------------------
2+
* Copyright (C) Microsoft Corporation. All rights reserved.
3+
*--------------------------------------------------------*/
4+
5+
import { IstanbulCoverageContext } from 'istanbul-to-vscode';
6+
7+
export const coverageContext = new IstanbulCoverageContext();
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*---------------------------------------------------------
2+
* Copyright (C) Microsoft Corporation. All rights reserved.
3+
*--------------------------------------------------------*/
4+
5+
/**
6+
* Debounces the function call for an interval.
7+
*/
8+
export function debounce(duration: number, fn: () => void): (() => void) & { clear: () => void } {
9+
let timeout: NodeJS.Timeout | void;
10+
const debounced = () => {
11+
if (timeout !== undefined) {
12+
clearTimeout(timeout);
13+
}
14+
15+
timeout = setTimeout(() => {
16+
timeout = undefined;
17+
fn();
18+
}, duration);
19+
};
20+
21+
debounced.clear = () => {
22+
if (timeout) {
23+
clearTimeout(timeout);
24+
timeout = undefined;
25+
}
26+
};
27+
28+
return debounced;
29+
}

0 commit comments

Comments
 (0)