window

object window(source)

Namespace for dealing with the current window of the editor. That is visible and active editors, as well as, UI elements to show messages, selections, and asking for user input.

Online Documentation

Properties

Link copied to clipboard

The currently active color theme as configured in the settings. The active theme can be changed via the workbench.colorTheme setting.

Link copied to clipboard

The currently active notebook 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.

Link copied to clipboard

The currently active terminal or undefined. The active terminal is the one that currently has focus or most recently had focus.

Link copied to clipboard

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.

Link copied to clipboard

An Event which fires when the active color theme is changed or has changes.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Fires when shell integration activates or one of its properties changes in a terminal.

Link copied to clipboard

An Event which fires when a terminal's state has changed.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

An Event which fires when the visible ranges of an editor has changed.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

An Event which fires when a terminal is disposed.

Link copied to clipboard

This will be fired when a terminal command is ended. This event will fire only when shell integration is activated for the terminal.

Link copied to clipboard

An Event which fires when a terminal has been created, either through the createTerminal API or commands.

Link copied to clipboard

This will be fired when a terminal command is started. This event will fire only when shell integration is activated for the terminal.

Link copied to clipboard

Represents the current window's state.

Link copied to clipboard

Represents the grid widget within the main editor area

Link copied to clipboard

The currently opened terminals or an empty array.

Link copied to clipboard

The currently visible notebook editors or an empty array.

Link copied to clipboard

The currently visible editors or an empty array.

Functions

Link copied to clipboard

Creates a InputBox to let the user enter some text input.

Link copied to clipboard
fun createOutputChannel(name: String, languageId: String = definedExternally): OutputChannel

Creates a new output channel with the given name and language id If language id is not provided, then Log is used as default language id.

Link copied to clipboard

Creates a QuickPick to let the user pick an item from a list of items of type T.

Link copied to clipboard
fun createStatusBarItem(alignment: StatusBarAlignment = definedExternally, priority: Int = definedExternally): StatusBarItem
fun createStatusBarItem(id: String, alignment: StatusBarAlignment = definedExternally, priority: Int = definedExternally): StatusBarItem

Creates a status bar item.

Link copied to clipboard

Creates a Terminal where an extension controls its input and output.

Creates a Terminal with a backing shell process.

fun createTerminal(name: String = definedExternally, shellPath: String = definedExternally, shellArgs: JsAny = definedExternally): Terminal

Creates a Terminal with a backing shell process. The cwd of the terminal will be the workspace directory if it exists.

Link copied to clipboard

Create a TextEditorDecorationType that can be used to add decorations to text editors.

Link copied to clipboard
fun <T : JsAny?> createTreeView(viewId: String, options: TreeViewOptions<T>): TreeView<T>

Create a TreeView for the view contributed using the extension point views.

Link copied to clipboard
fun registerCustomEditorProvider(    viewType: String,     provider: JsAny,     options: window.RegisterCustomEditorProviderOptions = definedExternally): Disposable

Register a provider for custom editors for the viewType contributed by the customEditors extension point.

Link copied to clipboard

Register a file decoration provider.

Link copied to clipboard

Register provider that enables the detection and handling of links within the terminal.

Link copied to clipboard

Registers a provider for a contributed terminal profile.

Link copied to clipboard
fun <T : JsAny?> registerTreeDataProvider(viewId: String, treeDataProvider: TreeDataProvider<T>): Disposable

Register a TreeDataProvider for the view contributed using the extension point views. This will allow you to contribute data to the TreeView and update if the data changes.

Link copied to clipboard

Registers a uri handler} capable of handling system-wide {@link Uri uris. In case there are multiple windows open, the topmost window will handle the uri. A uri handler is scoped to the extension it is contributed from; it will only be able to handle uris which are directed to the extension itself. A uri must respect the following rules:

Link copied to clipboard

Registers a webview panel serializer.

Link copied to clipboard
fun registerWebviewViewProvider(    viewId: String,     provider: WebviewViewProvider,     options: window.RegisterWebviewViewProviderOptions = definedExternally): Disposable

Register a new provider for webview views.

Link copied to clipboard
fun setStatusBarMessage(text: String, hideAfterTimeout: Int): Disposable

Set a message to the status bar. This is a short hand for the more powerful status bar items.

Link copied to clipboard
fun <T : MessageItem> showErrorMessage(message: String, vararg items: T): PromiseLike<T?>
fun showErrorMessage(message: String, vararg items: String): PromiseLike<JsString?>
fun <T : MessageItem> showErrorMessage(message: String, options: MessageOptions, vararg items: T): PromiseLike<T?>
fun showErrorMessage(message: String, options: MessageOptions, vararg items: String): PromiseLike<JsString?>

Show an error message.

Link copied to clipboard
fun <T : MessageItem> showInformationMessage(message: String, vararg items: T): PromiseLike<T?>
fun <T : MessageItem> showInformationMessage(message: String, options: MessageOptions, vararg items: T): PromiseLike<T?>

Show an information message.

fun showInformationMessage(message: String, vararg items: String): PromiseLike<JsString?>
fun showInformationMessage(message: String, options: MessageOptions, vararg items: String): PromiseLike<JsString?>

Show an information message to users. Optionally provide an array of items which will be presented as clickable buttons.

Link copied to clipboard
fun showInputBox(options: InputBoxOptions = definedExternally, token: CancellationToken = definedExternally): PromiseLike<JsString?>

Opens an input box to ask the user for input.

Link copied to clipboard
fun showNotebookDocument(    document: NotebookDocument,     options: NotebookDocumentShowOptions = definedExternally): PromiseLike<NotebookEditor>

Show the given NotebookDocument in a notebook editor.

Link copied to clipboard
fun showOpenDialog(options: OpenDialogOptions = definedExternally): PromiseLike<ReadonlyArray<Uri>?>

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

Link copied to clipboard
fun showQuickPick(    items: JsAny,     options: QuickPickOptions = definedExternally,     token: CancellationToken = definedExternally): PromiseLike<JsString?>
fun <T : QuickPickItem> showQuickPick(    items: JsAny,     options: QuickPickOptions = definedExternally,     token: CancellationToken = definedExternally): PromiseLike<T?>

Shows a selection list.

Link copied to clipboard
fun showSaveDialog(options: SaveDialogOptions = definedExternally): PromiseLike<Uri?>

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

Link copied to clipboard
fun showTextDocument(document: TextDocument, options: TextDocumentShowOptions = definedExternally): PromiseLike<TextEditor>

Show the given document in a text editor. Options can be provided to control options of the editor is being shown. Might change the active editor.

fun showTextDocument(uri: Uri, options: TextDocumentShowOptions = definedExternally): PromiseLike<TextEditor>

A short-hand for openTextDocument(uri).then(document => showTextDocument(document, options)).

fun showTextDocument(    document: TextDocument,     column: ViewColumn = definedExternally,     preserveFocus: Boolean = definedExternally): PromiseLike<TextEditor>

Show the given document in a text editor. A column can be provided to control where the editor is being shown. Might change the active editor.

Link copied to clipboard
fun <T : MessageItem> showWarningMessage(message: String, vararg items: T): PromiseLike<T?>
fun showWarningMessage(message: String, vararg items: String): PromiseLike<JsString?>
fun <T : MessageItem> showWarningMessage(message: String, options: MessageOptions, vararg items: T): PromiseLike<T?>
fun showWarningMessage(message: String, options: MessageOptions, vararg items: String): PromiseLike<JsString?>

Show a warning message.

Link copied to clipboard

Shows a selection list of workspace folders to pick from. Returns undefined if no folder is open.