-
Notifications
You must be signed in to change notification settings - Fork 30.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eng: move selfhost test provider as a workspace extension (#208699)
- Loading branch information
1 parent
baa003c
commit d42fad2
Showing
20 changed files
with
2,008 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions
78
.vscode/extensions/vscode-selfhost-test-provider/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"name": "vscode-selfhost-test-provider", | ||
"displayName": "VS Code Selfhost Test Provider", | ||
"description": "Test provider for the VS Code project", | ||
"enabledApiProposals": [ | ||
"testObserver" | ||
], | ||
"engines": { | ||
"vscode": "^1.88.0" | ||
}, | ||
"contributes": { | ||
"commands": [ | ||
{ | ||
"command": "selfhost-test-provider.updateSnapshot", | ||
"title": "Update Snapshot", | ||
"icon": "$(merge)" | ||
} | ||
], | ||
"menus": { | ||
"commandPalette": [ | ||
{ | ||
"command": "selfhost-test-provider.updateSnapshot", | ||
"when": "false" | ||
} | ||
], | ||
"testing/message/context": [ | ||
{ | ||
"command": "selfhost-test-provider.updateSnapshot", | ||
"group": "inline@1", | ||
"when": "testMessage == isSelfhostSnapshotMessage && !testResultOutdated" | ||
} | ||
], | ||
"testing/message/content": [ | ||
{ | ||
"command": "selfhost-test-provider.updateSnapshot", | ||
"when": "testMessage == isSelfhostSnapshotMessage && !testResultOutdated" | ||
} | ||
] | ||
} | ||
}, | ||
"icon": "icon.png", | ||
"version": "0.4.0", | ||
"publisher": "ms-vscode", | ||
"categories": [ | ||
"Other" | ||
], | ||
"activationEvents": [ | ||
"workspaceContains:src/vs/loader.js" | ||
], | ||
"workspaceTrust": { | ||
"request": "onDemand", | ||
"description": "Trust is required to execute tests in the workspace." | ||
}, | ||
"main": "./out/extension.js", | ||
"prettier": { | ||
"printWidth": 100, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"arrowParens": "avoid" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/microsoft/vscode.git" | ||
}, | ||
"license": "MIT", | ||
"scripts": { | ||
"compile": "gulp compile-extension:vscode-selfhost-test-provider", | ||
"watch": "gulp watch-extension:vscode-selfhost-test-provider" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "18.x" | ||
}, | ||
"dependencies": { | ||
"@jridgewell/trace-mapping": "^0.3.25", | ||
"ansi-styles": "^5.2.0", | ||
"istanbul-to-vscode": "^2.0.1" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
.vscode/extensions/vscode-selfhost-test-provider/src/coverageProvider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/*--------------------------------------------------------- | ||
* Copyright (C) Microsoft Corporation. All rights reserved. | ||
*--------------------------------------------------------*/ | ||
|
||
import { IstanbulCoverageContext } from 'istanbul-to-vscode'; | ||
|
||
export const coverageContext = new IstanbulCoverageContext(); |
29 changes: 29 additions & 0 deletions
29
.vscode/extensions/vscode-selfhost-test-provider/src/debounce.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/*--------------------------------------------------------- | ||
* Copyright (C) Microsoft Corporation. All rights reserved. | ||
*--------------------------------------------------------*/ | ||
|
||
/** | ||
* Debounces the function call for an interval. | ||
*/ | ||
export function debounce(duration: number, fn: () => void): (() => void) & { clear: () => void } { | ||
let timeout: NodeJS.Timeout | void; | ||
const debounced = () => { | ||
if (timeout !== undefined) { | ||
clearTimeout(timeout); | ||
} | ||
|
||
timeout = setTimeout(() => { | ||
timeout = undefined; | ||
fn(); | ||
}, duration); | ||
}; | ||
|
||
debounced.clear = () => { | ||
if (timeout) { | ||
clearTimeout(timeout); | ||
timeout = undefined; | ||
} | ||
}; | ||
|
||
return debounced; | ||
} |
Oops, something went wrong.