Use URIs for custom view item's icons

This commit is contained in:
Sandeep Somavarapu
2018-08-28 16:46:54 +02:00
parent a3b6f18ac4
commit 03432806c8
3 changed files with 11 additions and 10 deletions

View File

@@ -426,7 +426,7 @@ class ExtHostTreeView<T> extends Disposable {
return handle;
}
private getLightIconPath(extensionTreeItem: vscode.TreeItem): string {
private getLightIconPath(extensionTreeItem: vscode.TreeItem): URI {
if (extensionTreeItem.iconPath && !(extensionTreeItem.iconPath instanceof ThemeIcon)) {
if (typeof extensionTreeItem.iconPath === 'string'
|| extensionTreeItem.iconPath instanceof URI) {
@@ -437,18 +437,18 @@ class ExtHostTreeView<T> extends Disposable {
return void 0;
}
private getDarkIconPath(extensionTreeItem: vscode.TreeItem): string {
private getDarkIconPath(extensionTreeItem: vscode.TreeItem): URI {
if (extensionTreeItem.iconPath && !(extensionTreeItem.iconPath instanceof ThemeIcon) && extensionTreeItem.iconPath['dark']) {
return this.getIconPath(extensionTreeItem.iconPath['dark']);
}
return void 0;
}
private getIconPath(iconPath: string | URI): string {
private getIconPath(iconPath: string | URI): URI {
if (iconPath instanceof URI) {
return iconPath.toString();
return iconPath;
}
return URI.file(iconPath).toString();
return URI.file(iconPath);
}
private addNodeToCache(element: T, node: TreeNode): void {