diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index dde953700ed..e73c915cae0 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -5064,18 +5064,18 @@ declare module 'vscode' { } /** - * A category in a File Icon Theme, either [file](#ThemeIconCategory.file) or [folder](#ThemeIconCategory.folder) + * A category in a File Icon Theme, either [file](#ThemeIcon.file) or [folder](#ThemeIcon.folder) */ - export class ThemeIconCategory { + export class ThemeIcon { /** * Use the File Icon Theme for files */ - static readonly File: ThemeIconCategory; + static readonly File: ThemeIcon; /** * Use the File Icon Theme for files */ - static readonly Folder: ThemeIconCategory; + static readonly Folder: ThemeIcon; readonly id: string; @@ -5098,15 +5098,15 @@ declare module 'vscode' { /** * The icon path for the tree item. * When `falsy` it is derived from [resourceUri](#TreeItem.resourceUri) and the current theme (As a file if the node isn't collapsible or for folders otherwise) - * When a [ThemeIconCategory](#ThemeIconCategory) is specified it is derived from [resourceUri](#TreeItem.resourceUri) and the current theme for the specified category. + * When a [ThemeIcon](#ThemeIcon) is specified it is derived from [resourceUri](#TreeItem.resourceUri) and the current theme for the specified category. */ - iconPath?: string | Uri | { light: string | Uri | ThemeIconCategory; dark: string | Uri | ThemeIconCategory } | ThemeIconCategory; + iconPath?: string | Uri | { light: string | Uri | ThemeIcon; dark: string | Uri | ThemeIcon } | ThemeIcon; /** * The [uri](#Uri) of the resource representing this item. * * Will be used to derive the [label](#TreeItem.label), when it is not provided. - * Will be used to derive the icon from current icon theme, when [iconPath](#TreeItem.iconPath) is not provided or is a [ThemeIconCategory](#ThemeIconCategory). + * Will be used to derive the icon from current icon theme, when [iconPath](#TreeItem.iconPath) is not provided or is a [ThemeIcon](#ThemeIcon). */ resourceUri?: Uri; diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 6ebb507e700..66bdc0bb72e 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -620,7 +620,7 @@ export function createApiFactory( WorkspaceEdit: extHostTypes.WorkspaceEdit, ProgressLocation: extHostTypes.ProgressLocation, TreeItemCollapsibleState: extHostTypes.TreeItemCollapsibleState, - ThemeIconCategory: extHostTypes.ThemeIconCategory, + ThemeIcon: extHostTypes.ThemeIcon, TreeItem: extHostTypes.TreeItem, ThemeColor: extHostTypes.ThemeColor, // functions diff --git a/src/vs/workbench/api/node/extHostTreeViews.ts b/src/vs/workbench/api/node/extHostTreeViews.ts index 927d6c52a78..07b53d5be71 100644 --- a/src/vs/workbench/api/node/extHostTreeViews.ts +++ b/src/vs/workbench/api/node/extHostTreeViews.ts @@ -12,11 +12,11 @@ import { debounceEvent } from 'vs/base/common/event'; import { TPromise } from 'vs/base/common/winjs.base'; import { Disposable } from 'vs/base/common/lifecycle'; import { ExtHostTreeViewsShape, MainThreadTreeViewsShape } from './extHost.protocol'; -import { ITreeItem, TreeViewItemHandleArg, IThemeIconCategory } from 'vs/workbench/common/views'; +import { ITreeItem, TreeViewItemHandleArg, IThemeIcon } from 'vs/workbench/common/views'; import { ExtHostCommands, CommandsConverter } from 'vs/workbench/api/node/extHostCommands'; import { asWinJsPromise } from 'vs/base/common/async'; import { coalesce } from 'vs/base/common/arrays'; -import { TreeItemCollapsibleState, ThemeIconCategory } from 'vs/workbench/api/node/extHostTypes'; +import { TreeItemCollapsibleState, ThemeIcon } from 'vs/workbench/api/node/extHostTypes'; import { isUndefinedOrNull } from 'vs/base/common/types'; type TreeItemHandle = string; @@ -214,11 +214,11 @@ class ExtHostTreeView extends Disposable { throw new Error('This should not be reached'); } - private getLightIconPath(extensionTreeItem: vscode.TreeItem): string | IThemeIconCategory { + private getLightIconPath(extensionTreeItem: vscode.TreeItem): string | IThemeIcon { if (extensionTreeItem.iconPath) { if (typeof extensionTreeItem.iconPath === 'string' || extensionTreeItem.iconPath instanceof URI - || extensionTreeItem.iconPath instanceof ThemeIconCategory) { + || extensionTreeItem.iconPath instanceof ThemeIcon) { return this.getIconPath(extensionTreeItem.iconPath); } return this.getIconPath(extensionTreeItem.iconPath['light']); @@ -226,18 +226,18 @@ class ExtHostTreeView extends Disposable { return void 0; } - private getDarkIconPath(extensionTreeItem: vscode.TreeItem): string | IThemeIconCategory { + private getDarkIconPath(extensionTreeItem: vscode.TreeItem): string | IThemeIcon { if (extensionTreeItem.iconPath && extensionTreeItem.iconPath['dark']) { return this.getIconPath(extensionTreeItem.iconPath['dark']); } return void 0; } - private getIconPath(iconPath: string | URI | ThemeIconCategory): string | IThemeIconCategory { + private getIconPath(iconPath: string | URI | ThemeIcon): string | IThemeIcon { if (iconPath instanceof URI) { return iconPath.toString(); } - if (iconPath instanceof ThemeIconCategory) { + if (iconPath instanceof ThemeIcon) { return { id: iconPath.id }; } return URI.file(iconPath).toString(); diff --git a/src/vs/workbench/api/node/extHostTypes.ts b/src/vs/workbench/api/node/extHostTypes.ts index f2894951a96..a3cdf3bbb2d 100644 --- a/src/vs/workbench/api/node/extHostTypes.ts +++ b/src/vs/workbench/api/node/extHostTypes.ts @@ -1544,10 +1544,10 @@ export enum TreeItemCollapsibleState { Expanded = 2 } -export class ThemeIconCategory { - static readonly File = new ThemeIconCategory('file'); +export class ThemeIcon { + static readonly File = new ThemeIcon('file'); - static readonly Folder = new ThemeIconCategory('folder'); + static readonly Folder = new ThemeIcon('folder'); readonly id: string; diff --git a/src/vs/workbench/browser/parts/views/customView.ts b/src/vs/workbench/browser/parts/views/customView.ts index 28aaa5181b9..2a4ff5e6540 100644 --- a/src/vs/workbench/browser/parts/views/customView.ts +++ b/src/vs/workbench/browser/parts/views/customView.ts @@ -13,7 +13,7 @@ import * as DOM from 'vs/base/browser/dom'; import { $ } from 'vs/base/browser/builder'; import { LIGHT } from 'vs/platform/theme/common/themeService'; import { ITree, IDataSource, IRenderer, ContextMenuEvent } from 'vs/base/parts/tree/browser/tree'; -import { TreeItemCollapsibleState, ITreeItem, ITreeViewer, ICustomViewsService, ITreeViewDataProvider, ViewsRegistry, IViewDescriptor, TreeViewItemHandleArg, ICustomViewDescriptor, FileThemeIconCategoryId, FolderThemeIconCategoryId } from 'vs/workbench/common/views'; +import { TreeItemCollapsibleState, ITreeItem, ITreeViewer, ICustomViewsService, ITreeViewDataProvider, ViewsRegistry, IViewDescriptor, TreeViewItemHandleArg, ICustomViewDescriptor, FileThemeIconId, FolderThemeIconId } from 'vs/workbench/common/views'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IExtensionService } from 'vs/platform/extensions/common/extensions'; import { IProgressService2, ProgressLocation } from 'vs/platform/progress/common/progress'; @@ -418,10 +418,10 @@ class TreeRenderer implements IRenderer { let fileKind = node.collapsibleState === TreeItemCollapsibleState.Collapsed || node.collapsibleState === TreeItemCollapsibleState.Expanded ? FileKind.FOLDER : FileKind.FILE; if (icon && icon.id) { switch (icon.id) { - case FileThemeIconCategoryId: + case FileThemeIconId: fileKind = FileKind.FILE; break; - case FolderThemeIconCategoryId: + case FolderThemeIconId: fileKind = FileKind.FOLDER; break; } diff --git a/src/vs/workbench/common/views.ts b/src/vs/workbench/common/views.ts index 99869b43d8d..0f3038d2892 100644 --- a/src/vs/workbench/common/views.ts +++ b/src/vs/workbench/common/views.ts @@ -198,10 +198,10 @@ export enum TreeItemCollapsibleState { Expanded = 2 } -export const FileThemeIconCategoryId = 'file'; -export const FolderThemeIconCategoryId = 'folder'; +export const FileThemeIconId = 'file'; +export const FolderThemeIconId = 'folder'; -export interface IThemeIconCategory { +export interface IThemeIcon { readonly id: string; } @@ -215,9 +215,9 @@ export interface ITreeItem { label?: string; - icon?: string | IThemeIconCategory; + icon?: string | IThemeIcon; - iconDark?: string | IThemeIconCategory; + iconDark?: string | IThemeIcon; resourceUri?: UriComponents;