Class: VscodeIDE
ide/vscode/VscodeIDE.VscodeIDE
Implements
Constructors
constructor
• new VscodeIDE(extensionContext)
Parameters
| Name | Type |
|---|---|
extensionContext | ExtensionContext |
Defined in
Properties
capabilities
• Readonly capabilities: VscodeCapabilities
The capabilities of the IDE
Implementation of
Defined in
clipboard
• Readonly clipboard: VscodeClipboard
Implementation of
Defined in
configuration
• Readonly configuration: VscodeConfiguration
Implementation of
Defined in
editorMap
• Private editorMap: WeakMap<TextEditor, VscodeTextEditorImpl>
Defined in
flashHandler
• Private flashHandler: VscodeFlashHandler
Defined in
globalState
• Readonly globalState: VscodeGlobalState
Implementation of
Defined in
hats
• Readonly hats: VscodeHats
Implementation of
Defined in
highlights
• Private highlights: VscodeHighlights
Defined in
messages
• Readonly messages: VscodeMessages
Implementation of
Defined in
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
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
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
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
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
Defined in
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
Defined in
Accessors
activeEditableTextEditor
• get activeEditableTextEditor(): undefined | EditableTextEditor
Same as activeTextEditor but editable
Returns
undefined | EditableTextEditor
Implementation of
Defined in
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
Defined in
assetsRoot
• get assetsRoot(): string
The root directory of this shipped code. Can be used to access bundled assets.
Returns
string
Implementation of
Defined in
runMode
• get runMode(): RunMode
Whether we are running in development, test, or production
Returns
Implementation of
Defined in
visibleTextEditors
• get visibleTextEditors(): VscodeTextEditorImpl[]
The currently visible editors or an empty array.
Returns
Implementation of
Defined in
workspaceFolders
• get workspaceFolders(): undefined | readonly WorkspaceFolder[]
A list of workspace folders for the currently active workspace
Returns
undefined | readonly WorkspaceFolder[]
Implementation of
Defined in
Methods
disposeOnExit
▸ disposeOnExit(...disposables): () => void
Register disposables to be disposed of on IDE exit.
Parameters
| Name | Type |
|---|---|
...disposables | Disposable[] |
Returns
fn
▸ (): void
Returns
void
Implementation of
Defined in
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
| Name | Type |
|---|---|
command | string |
...args | any[] |
Returns
Promise<undefined | T>
Implementation of
Defined in
findInWorkspace
▸ findInWorkspace(query): Promise<void>
Find occurrences of query string in all files in the workspace
Parameters
| Name | Type |
|---|---|
query | string |
Returns
Promise<void>
Implementation of
Defined in
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
| Name | Type |
|---|---|
flashDescriptors | FlashDescriptor[] |
Returns
Promise<void>
Implementation of
Defined in
fromVscodeEditor
▸ fromVscodeEditor(editor): VscodeTextEditorImpl
Parameters
| Name | Type |
|---|---|
editor | TextEditor |
Returns
Defined in
getActiveTextEditor
▸ Private getActiveTextEditor(): undefined | VscodeTextEditorImpl
Returns
undefined | VscodeTextEditorImpl
Defined in
getEditableTextEditor
▸ getEditableTextEditor(editor): EditableTextEditor
Get an editable version of the text editor.
Parameters
| Name | Type |
|---|---|
editor | TextEditor |
Returns
Implementation of
Defined in
handleCommandError
▸ handleCommandError(err): void
Parameters
| Name | Type |
|---|---|
err | Error |
Returns
void
Defined in
init
▸ init(): Promise<void>
Returns
Promise<void>
Defined in
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
| Name | Type |
|---|---|
listener | (event: TextDocumentChangeEvent) => void |
Returns
Implementation of
Defined in
openTextDocument
▸ openTextDocument(path): Promise<TextEditor>
Opens a document.
Parameters
| Name | Type |
|---|---|
path | string |
Returns
Promise<TextEditor>
Implementation of
Defined in
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
| Name | Type |
|---|---|
highlightId | undefined | string |
editor | TextEditor |
ranges | GeneralizedRange[] |
Returns
Promise<void>
Implementation of
Defined in
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
| Name | Type |
|---|---|
options? | InputBoxOptions |
Returns
Promise<undefined | string>
Implementation of
Defined in
showQuickPick
▸ showQuickPick(items, options?): Promise<undefined | string>
Shows a selection list.
Parameters
| Name | Type |
|---|---|
items | readonly string[] |
options? | QuickPickOptions |
Returns
Promise<undefined | string>
Implementation of
Defined in
showUpdateExtensionErrorMessage
▸ Private showUpdateExtensionErrorMessage(err): Promise<void>
Parameters
| Name | Type |
|---|---|
err | OutdatedExtensionError |
Returns
Promise<void>