Hierarchy

  • TreeItem
    • TreeItem

Constructors

Properties

collapsibleState?: TreeItemCollapsibleState

TreeItemCollapsibleState of the tree item.

command?: Command

The command that should be executed when the tree item is selected.

contextValue?: string

Context value of the tree item. This can be used to contribute item specific actions in the tree. For example, a tree item is given a context value as folder. When contributing actions to view/item/context using menus extension point, you can specify context value for key viewItem in when expression like viewItem == folder.

    "contributes": {
"menus": {
"view/item/context": [
{
"command": "extension.deleteFolder",
"when": "viewItem == folder"
}
]
}
}

This will show action extension.deleteFolder only for items with contextValue is folder.

description?: string | boolean

A human readable string which is rendered less prominent. When true, it is derived from resourceUri and when falsy, it is not shown.

iconPath: {
    dark: string;
    light: string;
} = ...

Type declaration

  • dark: string
  • light: string
id?: string

Optional id for the tree item that has to be unique across tree. The id is used to preserve the selection and expansion state of the tree item.

If not provided, an id is generated using the tree item's label. Note that when labels change, ids will change and that selection and expansion state cannot be kept stable anymore.

label: string
resourceUri?: Uri

The uri of the resource representing this item.

Will be used to derive the label, when it is not provided. Will be used to derive the icon from current icon theme, when iconPath has ThemeIcon value.

tooltip?: string

The tooltip text when you hover over this item.