Options
All
  • Public
  • Public/Protected
  • All
Menu

Common namespace for dealing with window and editor, showing messages and user input.

Index

Variables

Let activeTextEditor

activeTextEditor: TextEditor | undefined

The currently active editor or undefined. The active editor is the one that currently has focus or, when none has focus, the one that has changed input most recently.

Const onDidChangeActiveTextEditor

onDidChangeActiveTextEditor: Event<TextEditor | undefined>

An event which fires when the active editor has changed. Note that the event also fires when the active editor changes to undefined.

Const onDidChangeTextEditorOptions

onDidChangeTextEditorOptions: Event<TextEditorOptionsChangeEvent>

An event which fires when the options of an editor have changed.

Const onDidChangeTextEditorSelection

onDidChangeTextEditorSelection: Event<TextEditorSelectionChangeEvent>

An event which fires when the selection in an editor has changed.

Const onDidChangeTextEditorViewColumn

onDidChangeTextEditorViewColumn: Event<TextEditorViewColumnChangeEvent>

An event which fires when the view column of an editor has changed.

Const onDidChangeTextEditorVisibleRanges

onDidChangeTextEditorVisibleRanges: Event<TextEditorVisibleRangesChangeEvent>

An event which fires when the selection in an editor has changed.

Const onDidChangeVisibleTextEditors

onDidChangeVisibleTextEditors: Event<TextEditor[]>

An event which fires when the array of visible editors has changed.

Const onDidChangeWindowState

onDidChangeWindowState: Event<WindowState>

An event which fires when the focus state of the current window changes. The value of the event represents whether the window is focused.

Const onDidCloseTerminal

onDidCloseTerminal: Event<Terminal>

Event which fires when terminal did closed. Event value contains closed terminal definition.

Let state

Represents the current window's state.

readonly

Let visibleTextEditors

visibleTextEditors: TextEditor[]

The currently visible editors or an empty array.

Functions

createOutputChannel

createStatusBarItem

  • Creates a status bar item.

    Parameters

    • Optional alignment: StatusBarAlignment

      The alignment of the item.

    • Optional priority: number

      The priority of the item. Higher values mean the item should be shown more to the left.

    Returns StatusBarItem

    A new status bar item.

createTerminal

  • Create new terminal.

    Parameters

    • Optional name: string

      terminal name to display on the UI.

    • Optional shellPath: string

      path to the executable shell. For example "/bin/bash", "bash", "sh".

    • Optional shellArgs: string[]

      arguments to configure executable shell. For example ["-l"] - run shell without login.

    Returns Terminal

  • Create new terminal with predefined options.

    Parameters

    Returns Terminal

createTextEditorDecorationType

createTreeView

  • createTreeView<T>(viewId: string, options: object): TreeView<T>

registerTreeDataProvider

setStatusBarMessage

  • setStatusBarMessage(text: string): Disposable
  • setStatusBarMessage(text: string, hideAfterTimeout: number): Disposable
  • setStatusBarMessage(text: string, hideWhenDone: PromiseLike<any>): Disposable
  • Set a message to the status bar.

    Parameters

    • text: string

      The message to show, supports icon substitution as in status bar.

    Returns Disposable

    A disposable which hides the status bar message.

  • Set a message to the status bar.

    Parameters

    • text: string

      The message to show, supports icon substitution as in status bar.

    • hideAfterTimeout: number

      Timeout in milliseconds after which the message will be disposed.

    Returns Disposable

    A disposable which hides the status bar message.

  • Set a message to the status bar.

    Parameters

    • text: string

      The message to show, supports icon substitution as in status bar.

    • hideWhenDone: PromiseLike<any>

      PromiseLike on which completion (resolve or reject) the message will be disposed.

    Returns Disposable

    A disposable which hides the status bar message.

showErrorMessage

  • showErrorMessage<T>(message: string, options: MessageOptions, ...items: T[]): PromiseLike<T | undefined>
  • showErrorMessage(message: string, options: MessageOptions, ...items: string[]): PromiseLike<string | undefined>
  • showErrorMessage<T>(message: string, ...items: T[]): PromiseLike<T | undefined>
  • showErrorMessage<T>(message: string, options: MessageOptions, ...items: T[]): PromiseLike<T | undefined>
  • Show an error message.

    Type parameters

    Parameters

    • message: string

      a message to show.

    • options: MessageOptions
    • Rest ...items: T[]

      A set of items that will be rendered as actions in the message.

    Returns PromiseLike<T | undefined>

    A promise that resolves to the selected item or undefined when being dismissed.

  • Show an error message.

    Parameters

    • message: string

      a message to show.

    • options: MessageOptions

      Configures the behaviour of the message.

    • Rest ...items: string[]

      A set of items that will be rendered as actions in the message.

    Returns PromiseLike<string | undefined>

    A promise that resolves to the selected item or undefined when being dismissed.

  • Show an error message.

    Type parameters

    Parameters

    • message: string

      a message to show.

    • Rest ...items: T[]

      A set of items that will be rendered as actions in the message.

    Returns PromiseLike<T | undefined>

    A promise that resolves to the selected item or undefined when being dismissed.

  • Show an error message.

    Type parameters

    Parameters

    • message: string

      a message to show.

    • options: MessageOptions

      Configures the behaviour of the message.

    • Rest ...items: T[]

      A set of items that will be rendered as actions in the message.

    Returns PromiseLike<T | undefined>

    A promise that resolves to the selected item or undefined when being dismissed.

showInformationMessage

  • showInformationMessage(message: string, ...items: string[]): PromiseLike<string | undefined>
  • showInformationMessage(message: string, options: MessageOptions, ...items: string[]): PromiseLike<string | undefined>
  • showInformationMessage<T>(message: string, options: MessageOptions, ...items: T[]): PromiseLike<T | undefined>
  • showInformationMessage<T>(message: string, options: MessageOptions, ...items: T[]): PromiseLike<T | undefined>
  • Show an information message.

    Parameters

    • message: string

      a message to show.

    • Rest ...items: string[]

      A set of items that will be rendered as actions in the message.

    Returns PromiseLike<string | undefined>

    A promise that resolves to the selected item or undefined when being dismissed.

  • Show an information message.

    Parameters

    • message: string

      a message to show.

    • options: MessageOptions

      Configures the behaviour of the message.

    • Rest ...items: string[]

      A set of items that will be rendered as actions in the message.

    Returns PromiseLike<string | undefined>

    A promise that resolves to the selected item or undefined when being dismissed.

  • Show an information message.

    Type parameters

    Parameters

    • message: string

      a message to show.

    • options: MessageOptions
    • Rest ...items: T[]

      A set of items that will be rendered as actions in the message.

    Returns PromiseLike<T | undefined>

    A promise that resolves to the selected item or undefined when being dismissed.

  • Show an information message.

    Type parameters

    Parameters

    • message: string

      a message to show.

    • options: MessageOptions

      Configures the behaviour of the message.

    • Rest ...items: T[]

      A set of items that will be rendered as actions in the message.

    Returns PromiseLike<T | undefined>

    A promise that resolves to the selected item or undefined when being dismissed.

showInputBox

  • Opens an input box to ask the user for input.

    The returned value will be undefined if the input box was canceled (e.g. pressing ESC). Otherwise the returned value will be the string typed by the user or an empty string if the user did not type anything but dismissed the input box with OK.

    Parameters

    • Optional options: InputBoxOptions

      Configures the behavior of the input box.

    • Optional token: CancellationToken

      A token that can be used to signal cancellation.

    Returns PromiseLike<string | undefined>

    A promise that resolves to a string the user provided or to undefined in case of dismissal.

showOpenDialog

  • Shows a file open dialog to the user which allows to select a file for opening-purposes.

    Parameters

    Returns PromiseLike<Uri[] | undefined>

    A promise that resolves to the selected resources or undefined.

showQuickPick

showSaveDialog

  • Shows a file save dialog to the user which allows to select a file for saving-purposes.

    Parameters

    Returns PromiseLike<Uri | undefined>

    A promise that resolves to the selected resource or undefined.

showWarningMessage

  • showWarningMessage<T>(message: string, options: MessageOptions, ...items: T[]): PromiseLike<T | undefined>
  • showWarningMessage(message: string, options: MessageOptions, ...items: string[]): PromiseLike<string | undefined>
  • showWarningMessage<T>(message: string, ...items: T[]): PromiseLike<T | undefined>
  • showWarningMessage<T>(message: string, options: MessageOptions, ...items: T[]): PromiseLike<T | undefined>
  • Show a warning message.

    Type parameters

    Parameters

    • message: string

      a message to show.

    • options: MessageOptions
    • Rest ...items: T[]

      A set of items that will be rendered as actions in the message.

    Returns PromiseLike<T | undefined>

    A promise that resolves to the selected item or undefined when being dismissed.

  • Show a warning message.

    Parameters

    • message: string

      a message to show.

    • options: MessageOptions

      Configures the behaviour of the message.

    • Rest ...items: string[]

      A set of items that will be rendered as actions in the message.

    Returns PromiseLike<string | undefined>

    A promise that resolves to the selected item or undefined when being dismissed.

  • Show a warning message.

    Type parameters

    Parameters

    • message: string

      a message to show.

    • Rest ...items: T[]

      A set of items that will be rendered as actions in the message.

    Returns PromiseLike<T | undefined>

    A promise that resolves to the selected item or undefined when being dismissed.

  • Show a warning message.

    Type parameters

    Parameters

    • message: string

      a message to show.

    • options: MessageOptions

      Configures the behaviour of the message.

    • Rest ...items: T[]

      A set of items that will be rendered as actions in the message.

    Returns PromiseLike<T | undefined>

    A promise that resolves to the selected item or undefined when being dismissed.

showWorkspaceFolderPick