Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adopt VS Code's refresh tests API #1384

Merged
merged 1 commit into from
Mar 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
],
"aiKey": "90c182a8-8dab-45d4-bfb8-1353eb55aa7f",
"engines": {
"vscode": "^1.63.0"
"vscode": "^1.65.0"
},
"categories": [
"Testing"
Expand Down Expand Up @@ -75,13 +75,6 @@
}
],
"menus": {
"view/title": [
{
"command": "java.test.refreshExplorer",
"when": "view == workbench.view.testing",
"group": "zzz@zzz"
}
],
"view/item/context": [
{
"command": "java.test.runFromJavaProjectExplorer",
Expand Down Expand Up @@ -419,7 +412,7 @@
"@types/mocha": "^9.1.0",
"@types/node": "^14.18.11",
"@types/sinon": "^10.0.11",
"@types/vscode": "1.63.0",
"@types/vscode": "1.65.0",
"glob": "^7.2.0",
"mocha": "^9.2.0",
"sinon": "^11.1.2",
Expand Down
2 changes: 1 addition & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"contributes.commands.java.test.editor.debug.title": "Debug Tests",
"contributes.commands.java.test.runFromJavaProjectExplorer.title": "Run Tests",
"contributes.commands.java.test.debugFromJavaProjectExplorer.title": "Debug Tests",
"contributes.commands.java.test.refreshExplorer.title": "Refresh",
"contributes.commands.java.test.refreshExplorer.title": "Refresh Tests",
"contributes.commands.java.test.goToTest.title": "Go to Test",
"contributes.commands.java.test.goToTestSubject.title": "Go to Test Subject",
"configuration.java.test.defaultConfig.description": "Specify the name of the default test configuration",
Expand Down
2 changes: 1 addition & 1 deletion package.nls.zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"contributes.commands.java.test.editor.debug.title": "调试测试用例",
"contributes.commands.java.test.runFromJavaProjectExplorer.title": "运行测试",
"contributes.commands.java.test.debugFromJavaProjectExplorer.title": "调试测试",
"contributes.commands.java.test.refreshExplorer.title": "刷新",
"contributes.commands.java.test.refreshExplorer.title": "刷新测试",
"contributes.commands.java.test.goToTest.title": "转到测试",
"contributes.commands.java.test.goToTestSubject.title": "转到被测试代码",
"configuration.java.test.defaultConfig.description": "设定默认测试配置项的名称",
Expand Down
8 changes: 6 additions & 2 deletions src/controller/testController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Licensed under the MIT license.

import * as _ from 'lodash';
import { CancellationToken, DebugConfiguration, Disposable, FileSystemWatcher, RelativePattern, TestController, TestItem, TestRun, TestRunProfileKind, TestRunRequest, tests, TestTag, Uri, window, workspace, WorkspaceFolder } from 'vscode';
import { CancellationToken, commands, DebugConfiguration, Disposable, FileSystemWatcher, RelativePattern, TestController, TestItem, TestRun, TestRunProfileKind, TestRunRequest, tests, TestTag, Uri, window, workspace, WorkspaceFolder } from 'vscode';
import { instrumentOperation, sendError, sendInfo } from 'vscode-extension-telemetry-wrapper';
import { INVOCATION_PREFIX } from '../constants';
import { INVOCATION_PREFIX, JavaTestRunnerCommands } from '../constants';
import { IProgressReporter } from '../debugger.api';
import { isStandardServerReady, progressProvider } from '../extension';
import { testSourceProvider } from '../provider/testSourceProvider';
Expand Down Expand Up @@ -36,6 +36,10 @@ export function createTestController(): void {
testController.createRunProfile('Run Tests', TestRunProfileKind.Run, runHandler, true, runnableTag);
testController.createRunProfile('Debug Tests', TestRunProfileKind.Debug, runHandler, true, runnableTag);

testController.refreshHandler = () => {
commands.executeCommand(JavaTestRunnerCommands.REFRESH_TEST_EXPLORER);
}

startWatchingWorkspace();
}

Expand Down