The name of the workspace. undefined
when no folder
has been opened.
An event that is emitted when the configuration changed.
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 dirty-state changes.
An event that is emitted when a workspace folder is added or removed.
An event that is emitted when a text document is disposed.
To add an event listener when a visible text document is closed, use the TextEditor events in the window namespace. Note that this event is not emitted when a TextEditor is closed but the document remains open in another visible text editor.
An event that is emitted when a text document is opened.
To add an event listener when a visible text document is opened, use the TextEditor events in the window namespace. Note that:
An event that is emitted when a text document is saved to disk.
All text documents currently known to the system.
List of workspace folders or undefined
when no folder is open.
Note that the first entry corresponds to the value of rootPath
.
Find files across all workspace folders in the workspace.
A glob pattern that defines the files to search for. The glob pattern will be matched against the file paths of resulting matches relative to their workspace. Use a relative pattern to restrict the search results to a workspace folder.
A glob pattern that defines files and folders to exclude. The glob pattern
will be matched against the file paths of resulting matches relative to their workspace. When undefined
only default excludes will
apply, when null
no excludes will apply.
An upper-bound for the result.
A token that can be used to signal cancellation to the underlying search engine.
A thenable that resolves to an array of resource identifiers. Will return no results if no workspace folders are opened.
Get a workspace configuration object.
When a section-identifier is provided only that part of the configuration
is returned. Dots in the section-identifier are interpreted as child-access,
like { myExt: { setting: { doIt: true }}}
and getConfiguration('myExt.setting').get('doIt') === true
.
When a resource is provided, configuration scoped to that resource is returned.
A dot-separated identifier.
A resource for which the configuration is asked for
The full configuration or a subset.
Opens a document. Will return early if this document is already open. Otherwise the document is loaded and the didOpen-event fires.
The document is denoted by an uri. Depending on the scheme the following rules apply:
file
-scheme: Open a file on disk, will be rejected if the file does not exist or cannot be loaded.untitled
-scheme: A new file that should be saved on disk, e.g. untitled:c:\frodo\new.js
. The language
will be derived from the file name.Note that the lifecycle of the returned document is owned by the editor and not by the extension. That means an
onDidClose
-event can occur at any time after opening it.
Identifies the resource to open.
A promise that resolves to a document.
A short-hand for openTextDocument(Uri.file(fileName))
.
A name of a file on disk.
A promise that resolves to a document.
Opens an untitled text document. The editor will prompt the user for a file
path when the document is to be saved. The options
parameter allows to
specify the language and/or the content of the document.
Options to control how the document will be created.
A promise that resolves to a document.
Register a filesystem provider for a given scheme, e.g. ftp
.
There can only be one provider per scheme and an error is being thrown when a scheme has been claimed by another provider or when it is reserved.
The uri-scheme the provider registers for.
The filesystem provider.
Immutable metadata about the provider.
A disposable that unregisters this provider when being disposed.
Register a text document content provider.
Only one provider can be registered per scheme.
The uri-scheme to register for.
A content provider.
A disposable that unregisters this provider when being disposed.
Namespace for dealing with the current workspace. A workspace is the representation of the folder that has been opened. There is no workspace when just a file but not a folder has been opened.
The workspace offers support for listening to fs events and for finding files. Both perform well and run outside the editor-process so that they should be always used instead of nodejs-equivalents.