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
Defined in
libs/common/ide/fake/FakeIDE.ts:31
clipboard
• clipboard: FakeClipboard
Implementation of
Defined in
libs/common/ide/fake/FakeIDE.ts:30
configuration
• configuration: FakeConfiguration
Implementation of
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
Defined in
libs/common/ide/fake/FakeIDE.ts:29
hats
• hats: FakeHats
Implementation of
Defined in
libs/common/ide/fake/FakeIDE.ts:32
messages
• messages: FakeMessages
Implementation of
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
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
Defined in
libs/common/ide/fake/FakeIDE.ts:51
runMode
• runMode: RunMode
= "test"
Whether we are running in development, test, or production
Implementation of
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
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
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
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
Defined in
libs/common/ide/fake/FakeIDE.ts:64
visibleTextEditors
• get
visibleTextEditors(): TextEditor
[]
The currently visible editors or an empty array.
Returns
Implementation of
Defined in
libs/common/ide/fake/FakeIDE.ts:80
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
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
Name | Type |
---|---|
_command | string |
..._args | any [] |
Returns
Promise
<undefined
| T
>
Implementation of
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
Name | Type |
---|---|
_query | string |
Returns
Promise
<void
>
Implementation of
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
Name | Type |
---|---|
_flashDescriptors | FlashDescriptor [] |
Returns
Promise
<void
>
Implementation of
Defined in
libs/common/ide/fake/FakeIDE.ts:39
getEditableTextEditor
▸ getEditableTextEditor(_editor
): EditableTextEditor
Get an editable version of the text editor.
Parameters
Name | Type |
---|---|
_editor | TextEditor |
Returns
Implementation of
Defined in
libs/common/ide/fake/FakeIDE.ts:84
mockAssetsRoot
▸ mockAssetsRoot(_assetsRoot
): void
Parameters
Name | Type |
---|---|
_assetsRoot | string |
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
Name | Type |
---|---|
_listener | (event : TextDocumentChangeEvent ) => void |
Returns
Implementation of
Defined in
libs/common/ide/fake/FakeIDE.ts:111
openTextDocument
▸ openTextDocument(_path
): Promise
<TextEditor
>
Opens a document.
Parameters
Name | Type |
---|---|
_path | string |
Returns
Promise
<TextEditor
>
Implementation of
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
Name | Type |
---|---|
_highlightId | undefined | string |
_editor | TextEditor |
_ranges | GeneralizedRange [] |
Returns
Promise
<void
>
Implementation of
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
Name | Type |
---|---|
_options? | any |
Returns
Promise
<undefined
| string
>
Implementation of
Defined in
libs/common/ide/fake/FakeIDE.ts:103
showQuickPick
▸ showQuickPick(_items
, _options?
): Promise
<undefined
| string
>
Shows a selection list.
Parameters
Name | Type |
---|---|
_items | readonly string [] |
_options? | QuickPickOptions |
Returns
Promise
<undefined
| string
>