Skip to main content

Class: VscodeIDE

ide/vscode/VscodeIDE.VscodeIDE

Implements

Constructors

constructor

new VscodeIDE(extensionContext)

Parameters

NameType
extensionContextExtensionContext

Defined in

ide/vscode/VscodeIDE.ts:50

Properties

capabilities

Readonly capabilities: VscodeCapabilities

The capabilities of the IDE

Implementation of

IDE.capabilities

Defined in

ide/vscode/VscodeIDE.ts:44


clipboard

Readonly clipboard: VscodeClipboard

Implementation of

IDE.clipboard

Defined in

ide/vscode/VscodeIDE.ts:43


configuration

Readonly configuration: VscodeConfiguration

Implementation of

IDE.configuration

Defined in

ide/vscode/VscodeIDE.ts:40


editorMap

Private editorMap: WeakMap<TextEditor, VscodeTextEditorImpl>

Defined in

ide/vscode/VscodeIDE.ts:48


flashHandler

Private flashHandler: VscodeFlashHandler

Defined in

ide/vscode/VscodeIDE.ts:46


globalState

Readonly globalState: VscodeGlobalState

Implementation of

IDE.globalState

Defined in

ide/vscode/VscodeIDE.ts:41


hats

Readonly hats: VscodeHats

Implementation of

IDE.hats

Defined in

ide/vscode/VscodeIDE.ts:45


highlights

Private highlights: VscodeHighlights

Defined in

ide/vscode/VscodeIDE.ts:47


messages

Readonly messages: VscodeMessages

Implementation of

IDE.messages

Defined in

ide/vscode/VscodeIDE.ts:42


onDidChangeActiveTextEditor

onDidChangeActiveTextEditor: Event<undefined | VscodeTextEditorImpl>

An Event which fires when the {@link window.activeTextEditor active editor} has changed. Note that the event also fires when the active editor changes to undefined.

Implementation of

IDE.onDidChangeActiveTextEditor

Defined in

ide/vscode/VscodeIDE.ts:165


onDidChangeTextEditorSelection

onDidChangeTextEditorSelection: Event<{ selections: Selection[] ; textEditor: VscodeTextEditorImpl }>

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

Implementation of

IDE.onDidChangeTextEditorSelection

Defined in

ide/vscode/VscodeIDE.ts:173


onDidChangeTextEditorVisibleRanges

onDidChangeTextEditorVisibleRanges: Event<{ textEditor: VscodeTextEditorImpl ; visibleRanges: Range[] }>

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

Implementation of

IDE.onDidChangeTextEditorVisibleRanges

Defined in

ide/vscode/VscodeIDE.ts:180


onDidChangeVisibleTextEditors

onDidChangeVisibleTextEditors: Event<VscodeTextEditorImpl[]>

An Event which fires when the array of {@link window.visibleTextEditors visible editors} has changed.

Implementation of

IDE.onDidChangeVisibleTextEditors

Defined in

ide/vscode/VscodeIDE.ts:169


onDidCloseTextDocument

onDidCloseTextDocument: Event<VscodeTextDocumentImpl>

An event that is emitted when a text document is disposed or when the language id of a text document {@link languages.setTextDocumentLanguage has been changed}.

Note 1: There is no guarantee that this event fires when an editor tab is closed, use the {@linkcode window.onDidChangeVisibleTextEditors onDidChangeVisibleTextEditors}-event to know when editors change.

Note 2: A document can be open but not shown in an editor which means this event can fire for a document that has not been shown in an editor.

Implementation of

IDE.onDidCloseTextDocument

Defined in

ide/vscode/VscodeIDE.ts:161


onDidOpenTextDocument

onDidOpenTextDocument: Event<VscodeTextDocumentImpl>

An event that is emitted when a text document is opened or when the language id of a text document {@link languages.setTextDocumentLanguage has been changed}.

To add an event listener when a visible text document is opened, use the TextEditor events in the {@link window} namespace. Note that:

  • The event is emitted before the document is updated in the {@link window.activeTextEditor active text editor}
  • When a text document is already open (e.g.: open in another {@link window.visibleTextEditors visible text editor}) this event is not emitted

Implementation of

IDE.onDidOpenTextDocument

Defined in

ide/vscode/VscodeIDE.ts:157

Accessors

activeEditableTextEditor

get activeEditableTextEditor(): undefined | EditableTextEditor

Same as activeTextEditor but editable

Returns

undefined | EditableTextEditor

Implementation of

IDE.activeEditableTextEditor

Defined in

ide/vscode/VscodeIDE.ts:109


activeTextEditor

get activeTextEditor(): undefined | TextEditor

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.

Returns

undefined | TextEditor

Implementation of

IDE.activeTextEditor

Defined in

ide/vscode/VscodeIDE.ts:105


assetsRoot

get assetsRoot(): string

The root directory of this shipped code. Can be used to access bundled assets.

Returns

string

Implementation of

IDE.assetsRoot

Defined in

ide/vscode/VscodeIDE.ts:93


runMode

get runMode(): RunMode

Whether we are running in development, test, or production

Returns

RunMode

Implementation of

IDE.runMode

Defined in

ide/vscode/VscodeIDE.ts:97


visibleTextEditors

get visibleTextEditors(): VscodeTextEditorImpl[]

The currently visible editors or an empty array.

Returns

VscodeTextEditorImpl[]

Implementation of

IDE.visibleTextEditors

Defined in

ide/vscode/VscodeIDE.ts:119


workspaceFolders

get workspaceFolders(): undefined | readonly WorkspaceFolder[]

A list of workspace folders for the currently active workspace

Returns

undefined | readonly WorkspaceFolder[]

Implementation of

IDE.workspaceFolders

Defined in

ide/vscode/VscodeIDE.ts:101

Methods

disposeOnExit

disposeOnExit(...disposables): () => void

Register disposables to be disposed of on IDE exit.

Parameters

NameType
...disposablesDisposable[]

Returns

fn

▸ (): void

Returns

void

Implementation of

IDE.disposeOnExit

Defined in

ide/vscode/VscodeIDE.ts:221


executeCommand

executeCommand<T>(command, ...args): Promise<undefined | T>

Executes the built-in ide command denoted by the given command identifier.

Type parameters

Name
T

Parameters

NameType
commandstring
...argsany[]

Returns

Promise<undefined | T>

Implementation of

IDE.executeCommand

Defined in

ide/vscode/VscodeIDE.ts:144


findInWorkspace

findInWorkspace(query): Promise<void>

Find occurrences of query string in all files in the workspace

Parameters

NameType
querystring

Returns

Promise<void>

Implementation of

IDE.findInWorkspace

Defined in

ide/vscode/VscodeIDE.ts:127


flashRanges

flashRanges(flashDescriptors): Promise<void>

Temporarily emphasize the given ranges to the user. This function is used to show ranges that eg are about to be deleted, are the source of a bring, etc. The promise should resolve when the flash is complete.

Parameters

NameType
flashDescriptorsFlashDescriptor[]

Returns

Promise<void>

Implementation of

IDE.flashRanges

Defined in

ide/vscode/VscodeIDE.ts:89


fromVscodeEditor

fromVscodeEditor(editor): VscodeTextEditorImpl

Parameters

NameType
editorTextEditor

Returns

VscodeTextEditorImpl

Defined in

ide/vscode/VscodeIDE.ts:188


getActiveTextEditor

Private getActiveTextEditor(): undefined | VscodeTextEditorImpl

Returns

undefined | VscodeTextEditorImpl

Defined in

ide/vscode/VscodeIDE.ts:113


getEditableTextEditor

getEditableTextEditor(editor): EditableTextEditor

Get an editable version of the text editor.

Parameters

NameType
editorTextEditor

Returns

EditableTextEditor

Implementation of

IDE.getEditableTextEditor

Defined in

ide/vscode/VscodeIDE.ts:123


handleCommandError

handleCommandError(err): void

Parameters

NameType
errError

Returns

void

Defined in

ide/vscode/VscodeIDE.ts:198


init

init(): Promise<void>

Returns

Promise<void>

Defined in

ide/vscode/VscodeIDE.ts:69


onDidChangeTextDocument

onDidChangeTextDocument(listener): Disposable

An event that is emitted when a text document is changed. This usually happens when the contents changes but also when other things like the {@link TextDocument.isDirty dirty}-state changes.

Parameters

NameType
listener(event: TextDocumentChangeEvent) => void

Returns

Disposable

Implementation of

IDE.onDidChangeTextDocument

Defined in

ide/vscode/VscodeIDE.ts:151


openTextDocument

openTextDocument(path): Promise<TextEditor>

Opens a document.

Parameters

NameType
pathstring

Returns

Promise<TextEditor>

Implementation of

IDE.openTextDocument

Defined in

ide/vscode/VscodeIDE.ts:133


setHighlightRanges

setHighlightRanges(highlightId, editor, ranges): Promise<void>

Set the ranges in {@link editor} to which {@link highlightId} should be applied. Removes the given highlight from all other ranges in {@link editor}.

Parameters

NameType
highlightIdundefined | string
editorTextEditor
rangesGeneralizedRange[]

Returns

Promise<void>

Implementation of

IDE.setHighlightRanges

Defined in

ide/vscode/VscodeIDE.ts:73


showInputBox

showInputBox(options?): Promise<undefined | string>

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

NameType
options?InputBoxOptions

Returns

Promise<undefined | string>

Implementation of

IDE.showInputBox

Defined in

ide/vscode/VscodeIDE.ts:138


showQuickPick

showQuickPick(items, options?): Promise<undefined | string>

Shows a selection list.

Parameters

NameType
itemsreadonly string[]
options?QuickPickOptions

Returns

Promise<undefined | string>

Implementation of

IDE.showQuickPick

Defined in

ide/vscode/VscodeIDE.ts:62


showUpdateExtensionErrorMessage

Private showUpdateExtensionErrorMessage(err): Promise<void>

Parameters

NameType
errOutdatedExtensionError

Returns

Promise<void>

Defined in

ide/vscode/VscodeIDE.ts:206