Skip to content

Commit d3f1845

Browse files
committed
implement test tags in test controller
1 parent 2a25024 commit d3f1845

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ All notable changes to the "robotcode" extension will be documented in this file
1010
- Added some more configuration options for log and debug messages when running tests in the debug console
1111
- debug console now shows source and line number from log messages
1212
- use of debugpy from vscode Python extension, no separate installation of debugpy required
13+
- implement test tags in test controller
1314

1415
## 0.2.7
1516

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"url": "https://github.com/d-biehl/robotcode/issues"
2020
},
2121
"engines": {
22-
"vscode": "^1.60.0"
22+
"vscode": "^1.61.0"
2323
},
2424
"categories": [
2525
"Programming Languages",
@@ -586,8 +586,8 @@
586586
"devDependencies": {
587587
"@types/glob": "^7.1.4",
588588
"@types/mocha": "^9.0.0",
589-
"@types/node": "^16.10.2",
590-
"@types/vscode": "^1.60.0",
589+
"@types/node": "^16.10.3",
590+
"@types/vscode": "^1.61.0",
591591
"@typescript-eslint/eslint-plugin": "^4.33.0",
592592
"@typescript-eslint/parser": "^4.33.0",
593593
"eslint": "^7.32.0",
@@ -612,7 +612,7 @@
612612
"vscode-debugadapter-testsupport": "^1.49.0",
613613
"vscode-dts": "^0.3.1",
614614
"vscode-test": "^1.6.1",
615-
"webpack": "^5.56.1",
616-
"webpack-cli": "^4.8.0"
615+
"webpack": "^5.58.0",
616+
"webpack-cli": "^4.9.0"
617617
}
618618
}

vscode-client/testcontrollermanager.ts

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ export class TestControllerManager {
266266
}
267267
testItem.label = ri.label;
268268
testItem.error = ri.error;
269-
// TODO: Tags
270-
// const tags = this.convertTags(ri.tags);
271-
// if (tags) testItem.tags = tags;
269+
270+
const tags = this.convertTags(ri.tags);
271+
if (tags) testItem.tags = tags;
272272

273273
await this.refreshItem(testItem);
274274
}
@@ -315,9 +315,9 @@ export class TestControllerManager {
315315
testItem.canResolveChildren = ri.children !== undefined && ri.children.length > 0;
316316
testItem.label = ri.label;
317317
testItem.error = ri.error;
318-
// TODO: Tags
319-
// const tags = this.convertTags(ri.tags);
320-
// if (tags) testItem.tags = tags;
318+
319+
const tags = this.convertTags(ri.tags);
320+
if (tags) testItem.tags = tags;
321321

322322
await this.refreshItem(testItem);
323323
}
@@ -338,24 +338,23 @@ export class TestControllerManager {
338338
}
339339
}
340340

341-
// TODO: Tags
342-
// private testTags = new WeakValueMap<string, vscode.TestTag>();
341+
private testTags = new WeakValueMap<string, vscode.TestTag>();
343342

344-
// private convertTags(tags: string[] | undefined): vscode.TestTag[] | undefined {
345-
// if (tags === undefined) return undefined;
343+
private convertTags(tags: string[] | undefined): vscode.TestTag[] | undefined {
344+
if (tags === undefined) return undefined;
346345

347-
// const result: vscode.TestTag[] = [];
346+
const result: vscode.TestTag[] = [];
348347

349-
// for (const tag of tags) {
350-
// if (!this.testTags.has(tag)) {
351-
// this.testTags.set(tag, new vscode.TestTag(tag));
352-
// }
353-
// const vstag = this.testTags.get(tag);
354-
// if (vstag !== undefined) result.push(vstag);
355-
// }
348+
for (const tag of tags) {
349+
if (!this.testTags.has(tag)) {
350+
this.testTags.set(tag, new vscode.TestTag(tag));
351+
}
352+
const vstag = this.testTags.get(tag);
353+
if (vstag !== undefined) result.push(vstag);
354+
}
356355

357-
// return result;
358-
// }
356+
return result;
357+
}
359358

360359
private readonly refreshFromUriMutex = new Mutex();
361360

0 commit comments

Comments
 (0)