-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow extensions to specify custom tree view resoure type
The FileKind was previously guessed from the collapsability of the item, extensions now have the capability to set it manually. Fixes #43216
- Loading branch information
Showing
6 changed files
with
72 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5063,6 +5063,25 @@ declare module 'vscode' { | |
getChildren(element?: T): ProviderResult<T[]>; | ||
} | ||
|
||
/** | ||
* A category in a File Icon Theme, either [file](#ThemeIconCategory.file) or [folder](#ThemeIconCategory.folder) | ||
*/ | ||
export class ThemeIconCategory { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
aeschli
Contributor
|
||
/** | ||
* Use the File Icon Theme for files | ||
*/ | ||
static readonly File: ThemeIconCategory; | ||
|
||
/** | ||
* Use the File Icon Theme for files | ||
*/ | ||
static readonly Folder: ThemeIconCategory; | ||
|
||
readonly id: string; | ||
|
||
private constructor(id: string); | ||
} | ||
|
||
export class TreeItem { | ||
/** | ||
* A human-readable string describing this item. When `falsy`, it is derived from [resourceUri](#TreeItem.resourceUri). | ||
|
@@ -5077,15 +5096,17 @@ declare module 'vscode' { | |
id?: string; | ||
|
||
/** | ||
* The icon path for the tree item. When `falsy`, it is derived from [resourceUri](#TreeItem.resourceUri). | ||
* 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. | ||
*/ | ||
iconPath?: string | Uri | { light: string | Uri; dark: string | Uri }; | ||
iconPath?: string | Uri | { light: string | Uri | ThemeIconCategory; dark: string | Uri | ThemeIconCategory } | ThemeIconCategory; | ||
|
||
/** | ||
* 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 file icon theme, when [iconPath](#TreeItem.iconPath) 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). | ||
*/ | ||
resourceUri?: Uri; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@sandy081 Why is this a class (with a private ctor) and not an enum?