Skip to content

Commit 3451259

Browse files
authored
Revert "Rename iconPath to icon" (#1764)
* Revert "Rename iconPath to icon (#1742)" This reverts commit 93b6abe. * Add comment to explain things
1 parent 9b0fe4d commit 3451259

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

extensions/ql-vscode/src/databases/ui/db-tree-view-item.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ import {
1515
*/
1616
export class DbTreeViewItem extends vscode.TreeItem {
1717
constructor(
18+
// iconPath and tooltip must have those names because
19+
// they are part of the vscode.TreeItem interface
20+
1821
public readonly dbItem: DbItem | undefined,
19-
public readonly icon: vscode.ThemeIcon | undefined,
22+
public readonly iconPath: vscode.ThemeIcon | undefined,
2023
public readonly label: string,
2124
public readonly tooltip: string | undefined,
2225
public readonly collapsibleState: vscode.TreeItemCollapsibleState,

extensions/ql-vscode/src/vscode-tests/minimal-workspace/databases/db-panel.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ describe('db panel', async () => {
240240
): void {
241241
expect(item.label).to.equal(`Top ${n} repositories`);
242242
expect(item.tooltip).to.equal(`Top ${n} repositories of a language`);
243-
expect(item.icon).to.deep.equal(new vscode.ThemeIcon('github'));
243+
expect(item.iconPath).to.deep.equal(new vscode.ThemeIcon('github'));
244244
expect(item.collapsibleState).to.equal(vscode.TreeItemCollapsibleState.None);
245245
}
246246

@@ -251,7 +251,7 @@ describe('db panel', async () => {
251251
): void {
252252
expect(item.label).to.equal(listName);
253253
expect(item.tooltip).to.be.undefined;
254-
expect(item.icon).to.be.undefined;
254+
expect(item.iconPath).to.be.undefined;
255255
expect(item.collapsibleState).to.equal(vscode.TreeItemCollapsibleState.Collapsed);
256256
expect(item.children).to.be.ok;
257257
expect(item.children.length).to.equal(repos.length);
@@ -267,7 +267,7 @@ describe('db panel', async () => {
267267
): void {
268268
expect(item.label).to.equal(ownerName);
269269
expect(item.tooltip).to.be.undefined;
270-
expect(item.icon).to.deep.equal(new vscode.ThemeIcon('organization'));
270+
expect(item.iconPath).to.deep.equal(new vscode.ThemeIcon('organization'));
271271
expect(item.collapsibleState).to.equal(vscode.TreeItemCollapsibleState.None);
272272
expect(item.children).to.be.ok;
273273
expect(item.children.length).to.equal(0);
@@ -279,7 +279,7 @@ describe('db panel', async () => {
279279
): void {
280280
expect(item.label).to.equal(repoName);
281281
expect(item.tooltip).to.be.undefined;
282-
expect(item.icon).to.deep.equal(new vscode.ThemeIcon('database'));
282+
expect(item.iconPath).to.deep.equal(new vscode.ThemeIcon('database'));
283283
expect(item.collapsibleState).to.equal(vscode.TreeItemCollapsibleState.None);
284284
}
285285
});

0 commit comments

Comments
 (0)