VS Code API
    Preparing search index...

    Interface TreeView<T>

    Represents a Tree view

    interface TreeView<T> {
        badge?: ViewBadge;
        description?: string;
        message?: string;
        onDidChangeCheckboxState: Event<TreeCheckboxChangeEvent<T>>;
        onDidChangeSelection: Event<TreeViewSelectionChangeEvent<T>>;
        onDidChangeVisibility: Event<TreeViewVisibilityChangeEvent>;
        onDidCollapseElement: Event<TreeViewExpansionEvent<T>>;
        onDidExpandElement: Event<TreeViewExpansionEvent<T>>;
        selection: readonly T[];
        title?: string;
        visible: boolean;
        dispose(): any;
        reveal(
            element: T,
            options?: { expand?: number | boolean; focus?: boolean; select?: boolean },
        ): Thenable<void>;
    }

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index

    Properties

    badge?: ViewBadge

    The badge to display for this TreeView. To remove the badge, set to undefined.

    description?: string

    An optional human-readable description which is rendered less prominently in the title of the view. Setting the title description to null, undefined, or empty string will remove the description from the view.

    message?: string

    An optional human-readable message that will be rendered in the view. Setting the message to null, undefined, or empty string will remove the message from the view.

    onDidChangeCheckboxState: Event<TreeCheckboxChangeEvent<T>>

    An event to signal that an element or root has either been checked or unchecked.

    onDidChangeSelection: Event<TreeViewSelectionChangeEvent<T>>

    Event that is fired when the selection has changed

    onDidChangeVisibility: Event<TreeViewVisibilityChangeEvent>

    Event that is fired when visibility has changed

    onDidCollapseElement: Event<TreeViewExpansionEvent<T>>

    Event that is fired when an element is collapsed

    onDidExpandElement: Event<TreeViewExpansionEvent<T>>

    Event that is fired when an element is expanded

    selection: readonly T[]

    Currently selected elements.

    title?: string

    The tree view title is initially taken from the extension package.json Changes to the title property will be properly reflected in the UI in the title of the view.

    visible: boolean

    true if the tree view is visible otherwise false.

    Methods

    • Reveals the given element in the tree view. If the tree view is not visible then the tree view is shown and element is revealed.

      By default revealed element is selected. In order to not to select, set the option select to false. In order to focus, set the option focus to true. In order to expand the revealed element, set the option expand to true. To expand recursively set expand to the number of levels to expand.

      Parameters

      • element: T
      • Optionaloptions: { expand?: number | boolean; focus?: boolean; select?: boolean }
        • Optional Readonlyexpand?: number | boolean

          If true, then the element will be expanded. If a number is passed, then up to that number of levels of children will be expanded

        • Optional Readonlyfocus?: boolean

          If true, then the element will be focused.

        • Optional Readonlyselect?: boolean

          If true, then the element will be selected.

      Returns Thenable<void>