Revert "Rename iconPath to icon" (#1764)

* Revert "Rename iconPath to icon (#1742)"

This reverts commit 93b6abeeb4.

* Add comment to explain things
This commit is contained in:
Charis Kyriakou
2022-11-14 16:38:59 +00:00
committed by GitHub
parent 9b0fe4ddc7
commit 345125994a
2 changed files with 8 additions and 5 deletions

View File

@@ -15,8 +15,11 @@ import {
*/
export class DbTreeViewItem extends vscode.TreeItem {
constructor(
// iconPath and tooltip must have those names because
// they are part of the vscode.TreeItem interface
public readonly dbItem: DbItem | undefined,
public readonly icon: vscode.ThemeIcon | undefined,
public readonly iconPath: vscode.ThemeIcon | undefined,
public readonly label: string,
public readonly tooltip: string | undefined,
public readonly collapsibleState: vscode.TreeItemCollapsibleState,

View File

@@ -240,7 +240,7 @@ describe('db panel', async () => {
): void {
expect(item.label).to.equal(`Top ${n} repositories`);
expect(item.tooltip).to.equal(`Top ${n} repositories of a language`);
expect(item.icon).to.deep.equal(new vscode.ThemeIcon('github'));
expect(item.iconPath).to.deep.equal(new vscode.ThemeIcon('github'));
expect(item.collapsibleState).to.equal(vscode.TreeItemCollapsibleState.None);
}
@@ -251,7 +251,7 @@ describe('db panel', async () => {
): void {
expect(item.label).to.equal(listName);
expect(item.tooltip).to.be.undefined;
expect(item.icon).to.be.undefined;
expect(item.iconPath).to.be.undefined;
expect(item.collapsibleState).to.equal(vscode.TreeItemCollapsibleState.Collapsed);
expect(item.children).to.be.ok;
expect(item.children.length).to.equal(repos.length);
@@ -267,7 +267,7 @@ describe('db panel', async () => {
): void {
expect(item.label).to.equal(ownerName);
expect(item.tooltip).to.be.undefined;
expect(item.icon).to.deep.equal(new vscode.ThemeIcon('organization'));
expect(item.iconPath).to.deep.equal(new vscode.ThemeIcon('organization'));
expect(item.collapsibleState).to.equal(vscode.TreeItemCollapsibleState.None);
expect(item.children).to.be.ok;
expect(item.children.length).to.equal(0);
@@ -279,7 +279,7 @@ describe('db panel', async () => {
): void {
expect(item.label).to.equal(repoName);
expect(item.tooltip).to.be.undefined;
expect(item.icon).to.deep.equal(new vscode.ThemeIcon('database'));
expect(item.iconPath).to.deep.equal(new vscode.ThemeIcon('database'));
expect(item.collapsibleState).to.equal(vscode.TreeItemCollapsibleState.None);
}
});