Skip to content

Commit e8c17ab

Browse files
committed
Add icons for test explorer
1 parent 6508897 commit e8c17ab

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

src/VSCode/controllers/testExplorerController.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { DotNetTaskProvider } from '../providers/dotnetTaskProvider';
33
import { TestExtensions } from '../models/test';
44
import { Interop } from '../interop/interop';
55
import { Extensions } from '../extensions';
6+
import { Icons } from '../resources/icons';
67
import * as res from '../resources/constants'
78
import * as vscode from 'vscode';
89
import * as path from 'path';
@@ -40,7 +41,7 @@ export class TestExplorerController {
4041
if (discoveredTests === undefined || discoveredTests.length === 0)
4142
return;
4243

43-
const root = TestExplorerController.controller.createTestItem(projectName, projectName, vscode.Uri.file(projectPath));
44+
const root = TestExplorerController.controller.createTestItem(projectName, `${Icons.solution} ${projectName}`, vscode.Uri.file(projectPath));
4445
root.children.replace(discoveredTests.map(t => TestExtensions.fixtureToTestItem(t, TestExplorerController.controller)));
4546
TestExplorerController.controller.items.delete(root.id);
4647
TestExplorerController.controller.items.add(root);

src/VSCode/features/modulesView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class ModulesView implements TreeDataProvider<any>, DebugAdapterTrackerFa
5050
return item;
5151
} else {
5252
const item = new vscode.TreeItem(element.name, vscode.TreeItemCollapsibleState.Collapsed);
53-
item.iconPath = Icons.module;
53+
item.iconPath = Icons.moduleIcon;
5454
return item;
5555
}
5656
}

src/VSCode/models/test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Range, TestItem, TestController, Uri, TestMessage } from "vscode";
2+
import { Icons } from "../resources/icons";
23

34
export interface TestFixture {
45
id: string;
@@ -25,15 +26,15 @@ export interface TestResult {
2526

2627
export class TestExtensions {
2728
public static fixtureToTestItem(fixture: TestFixture, controller: TestController): TestItem {
28-
const item = controller.createTestItem(fixture.id, fixture.name, Uri.file(fixture.filePath));
29+
const item = controller.createTestItem(fixture.id, `${Icons.module} ${fixture.name}`, Uri.file(fixture.filePath));
2930
if (fixture.range !== null)
3031
item.range = fixture.range;
3132
if (fixture.children !== null && fixture.children !== undefined)
3233
item.children.replace(fixture.children.map(tc => TestExtensions.testCaseToTestItem(tc, controller)));
3334
return item;
3435
}
3536
public static testCaseToTestItem(testCase: TestCase, controller: TestController): TestItem {
36-
const item = controller.createTestItem(testCase.id, testCase.name, Uri.file(testCase.filePath));
37+
const item = controller.createTestItem(testCase.id, `${Icons.test} ${testCase.name}`, Uri.file(testCase.filePath));
3738
if (testCase.range !== null)
3839
item.range = testCase.range;
3940
return item;

src/VSCode/resources/icons.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ export class Icons {
66
public static readonly target = "$(window)";
77
public static readonly computer = "$(vm)";
88
public static readonly active = "$(circle)";
9+
public static readonly module = "$(symbol-namespace)";
10+
public static readonly test = "$(beaker)";
911

10-
public static readonly module = new ThemeIcon("symbol-namespace");
12+
public static readonly moduleIcon = new ThemeIcon("symbol-namespace");
1113
}

0 commit comments

Comments
 (0)