Skip to main content

Class: FakeIDE

libs/common/ide/fake/FakeIDE.FakeIDE

Implements

Constructors

constructor

new FakeIDE()

Properties

assetsRoot_

Private assetsRoot_: undefined | string

Defined in

libs/common/ide/fake/FakeIDE.ts:37


capabilities

capabilities: FakeCapabilities

The capabilities of the IDE

Implementation of

IDE.capabilities

Defined in

libs/common/ide/fake/FakeIDE.ts:31


clipboard

clipboard: FakeClipboard

Implementation of

IDE.clipboard

Defined in

libs/common/ide/fake/FakeIDE.ts:30


configuration

configuration: FakeConfiguration

Implementation of

IDE.configuration

Defined in

libs/common/ide/fake/FakeIDE.ts:27


disposables

Private disposables: Disposable[] = []

Defined in

libs/common/ide/fake/FakeIDE.ts:36


globalState

globalState: FakeGlobalState

Implementation of

IDE.globalState

Defined in

libs/common/ide/fake/FakeIDE.ts:29


hats

hats: FakeHats

Implementation of

IDE.hats

Defined in

libs/common/ide/fake/FakeIDE.ts:32


messages

messages: FakeMessages

Implementation of

IDE.messages

Defined in

libs/common/ide/fake/FakeIDE.ts:28


onDidChangeActiveTextEditor

onDidChangeActiveTextEditor: Event<undefined | TextEditor> = dummyEvent

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

libs/common/ide/fake/FakeIDE.ts:53


onDidChangeTextEditorSelection

onDidChangeTextEditorSelection: Event<TextEditorSelectionChangeEvent> = dummyEvent

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

Implementation of

IDE.onDidChangeTextEditorSelection

Defined in

libs/common/ide/fake/FakeIDE.ts:55


onDidChangeTextEditorVisibleRanges

onDidChangeTextEditorVisibleRanges: Event<TextEditorVisibleRangesChangeEvent> = dummyEvent

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

Implementation of

IDE.onDidChangeTextEditorVisibleRanges

Defined in

libs/common/ide/fake/FakeIDE.ts:57


onDidChangeVisibleTextEditors

onDidChangeVisibleTextEditors: Event<TextEditor[]> = dummyEvent

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

Implementation of

IDE.onDidChangeVisibleTextEditors

Defined in

libs/common/ide/fake/FakeIDE.ts:54


onDidCloseTextDocument

onDidCloseTextDocument: Event<TextDocument> = dummyEvent

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

libs/common/ide/fake/FakeIDE.ts:52


onDidOpenTextDocument

onDidOpenTextDocument: Event<TextDocument> = dummyEvent

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

libs/common/ide/fake/FakeIDE.ts:51


runMode

runMode: RunMode = "test"

Whether we are running in development, test, or production

Implementation of

IDE.runMode

Defined in

libs/common/ide/fake/FakeIDE.ts:34


workspaceFolders

workspaceFolders: undefined | readonly WorkspaceFolder[] = undefined

A list of workspace folders for the currently active workspace

Implementation of

IDE.workspaceFolders

Defined in

libs/common/ide/fake/FakeIDE.ts:35

Accessors

activeEditableTextEditor

get activeEditableTextEditor(): undefined | EditableTextEditor

Same as activeTextEditor but editable

Returns

undefined | EditableTextEditor

Implementation of

IDE.activeEditableTextEditor

Defined in

libs/common/ide/fake/FakeIDE.ts:76


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

libs/common/ide/fake/FakeIDE.ts:72


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

libs/common/ide/fake/FakeIDE.ts:64


visibleTextEditors

get visibleTextEditors(): TextEditor[]

The currently visible editors or an empty array.

Returns

TextEditor[]

Implementation of

IDE.visibleTextEditors

Defined in

libs/common/ide/fake/FakeIDE.ts:80

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

libs/common/ide/fake/FakeIDE.ts:117


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

libs/common/ide/fake/FakeIDE.ts:107


exit

exit(): void

Returns

void

Defined in

libs/common/ide/fake/FakeIDE.ts:123


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

libs/common/ide/fake/FakeIDE.ts:88


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

libs/common/ide/fake/FakeIDE.ts:39


getEditableTextEditor

getEditableTextEditor(_editor): EditableTextEditor

Get an editable version of the text editor.

Parameters

NameType
_editorTextEditor

Returns

EditableTextEditor

Implementation of

IDE.getEditableTextEditor

Defined in

libs/common/ide/fake/FakeIDE.ts:84


mockAssetsRoot

mockAssetsRoot(_assetsRoot): void

Parameters

NameType
_assetsRootstring

Returns

void

Defined in

libs/common/ide/fake/FakeIDE.ts:60


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

libs/common/ide/fake/FakeIDE.ts:111


openTextDocument

openTextDocument(_path): Promise<TextEditor>

Opens a document.

Parameters

NameType
_pathstring

Returns

Promise<TextEditor>

Implementation of

IDE.openTextDocument

Defined in

libs/common/ide/fake/FakeIDE.ts:92


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

libs/common/ide/fake/FakeIDE.ts:43


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?any

Returns

Promise<undefined | string>

Implementation of

IDE.showInputBox

Defined in

libs/common/ide/fake/FakeIDE.ts:103


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

libs/common/ide/fake/FakeIDE.ts:96