Link Search Menu Expand Document

=== window

  • 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.


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.

  • NOTE: text editor passed in is the text editor that will be switched to


Extensions can now determine whether terminals have exited and if they did, which exit code was used (if any).

window.onDidCloseTerminal((t) => {
  if (t.exitStatus && t.exitStatus.code) {
    vscode.window.showInformationMessage(`Exit code: ${t.exitStatus.code}`);


createInputBox(): InputBox

createOutputChannel(name: string): OutputChannel


createQuickPick<T extends QuickPickItem>(): QuickPick<T>


const smallNumberDecorationType = vscode.window.createTextEditorDecorationType({
  borderWidth: '1px',
  borderStyle: 'solid',
  overviewRulerColor: 'blue',
  overviewRulerLane: vscode.OverviewRulerLane.Right,
  light: {
    // this color will be used in light color themes
    borderColor: 'darkblue'
  dark: {
    // this color will be used in dark color themes
    borderColor: 'lightblue'
const largeNumberDecorationType = vscode.window.createTextEditorDecorationType({
  cursor: 'crosshair',
  // use a themable color. See package.json for the declaration and default values.
  backgroundColor: { id: 'myextension.largeNumberBackground' }


  viewType: string, 
  title: string, 
  showOptions: ViewColumn | {preserveFocus: boolean, viewColumn: ViewColumn}, options?: WebviewPanelOptions & WebviewOptions
): WebviewPanel


showInformationMessage(message: string, ...items: string[]): Thenable<string | undefined>
  • params:
    • items: A set of items that will be rendered as actions in the message.
  • return:
    • A thenable that resolves to the selected item or undefined when being dismissed.

vscode.window.showInformationMessage(‘Hello World!’);


(options?: InputBoxOptions, token?: CancellationToken): Thenable<string | undefined>
  • params:
    • options?: InputBoxOptions
    • token?: CancellationToken
    • InputBoxOptions
      • validateInput(value: string): string | undefined | null | Thenable<string | undefined | null>
        • return:
          • A human-readable string which is presented as diagnostic message. Return undefined, null, or the empty string when ‘value’ is valid.
  • return
    • sig: Thenable<string undefined>
    • 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.


  • signature
  items: string[] | Thenable<string[]>, options: QuickPickOptions & {canPickMany: true}, token?: CancellationToken
): Thenable<string[] | undefined>


  • sig1
  document: TextDocument, column?: ViewColumn, preserveFocus?: boolean
): Thenable<TextEditor>
  • sig2
showTextDocument(document: TextDocument, options?: TextDocumentShowOptions): Thenable<TextEditor>
  • sig3
showTextDocument(uri: Uri, options?: TextDocumentShowOptions): Thenable<TextEditor>

  • options: TextDocumentShowOptions
    • preserveFocus?: boolean
    • preview?: boolean
    • selection?: Range
    • viewColumn?: ViewColumn


			location: ProgressLocation.Notification,
			title: "I am long running!",
			cancellable: true
		}, (progress, token) => {
			token.onCancellationRequested(() => {
				console.log("User canceled the long running operation");
			});{ increment: 0 });

			setTimeout(() => {{ increment: 10, message: "I am long running! - still going..." });
			}, 1000);

			setTimeout(() => {{ increment: 40, message: "I am long running! - still going even more..." });
			}, 2000);

			setTimeout(() => {{ increment: 50, message: "I am long running! - almost there..." });
			}, 3000);

			const p = new Promise(resolve => {
				setTimeout(() => {
				}, 5000);

			return p;

Table of contents

Copyright © 2020 Thence LLC