Skip to content

Commit ee1a4b3

Browse files
committed
add option to disable the test controller
1 parent 734c670 commit ee1a4b3

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

package.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,12 @@
412412
"default": true,
413413
"markdownDescription": "Enable/disable inlay hints for namespaces.",
414414
"scope": "resource"
415+
},
416+
"robotcode.testExplorer.enabled": {
417+
"type": "boolean",
418+
"default": true,
419+
"description": "Whether to show robot tests in the test explorer. You may want to disable this if you are using another tool to run robot tests.",
420+
"scope": "resource"
415421
}
416422
}
417423
},
@@ -1464,4 +1470,4 @@
14641470
"webpack": "^5.90.0",
14651471
"webpack-cli": "^5.1.4"
14661472
}
1467-
}
1473+
}

vscode-client/testcontrollermanager.ts

+12
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,18 @@ export class TestControllerManager {
194194
(_) => undefined,
195195
);
196196
}),
197+
vscode.workspace.onDidChangeConfiguration((event) => {
198+
const setting = "robotcode.testExplorer";
199+
for (const ws of vscode.workspace.workspaceFolders ?? []) {
200+
if (event.affectsConfiguration(setting, ws)) {
201+
if (vscode.workspace.getConfiguration(setting, ws).get<boolean>("enabled")) {
202+
this.refresh().catch((_) => undefined);
203+
} else {
204+
if (ws) this.removeWorkspaceFolderItems(ws);
205+
}
206+
}
207+
}
208+
}),
197209
vscode.workspace.onDidCloseTextDocument((document) => this.refreshDocument(document)),
198210
vscode.workspace.onDidSaveTextDocument((document) => this.refreshDocument(document)),
199211
vscode.workspace.onDidOpenTextDocument((document) => this.refreshDocument(document)),

0 commit comments

Comments
 (0)