ExtensionContext class

An extension context is a collection of utilities private to an extension.

An instance of an ExtensionContext is provided as the first parameter to the activate-call of an extension.

Available extensions
Annotations
  • @JS()
  • @staticInterop
  • @anonymous

Constructors

ExtensionContext.new({List<IInline32>? subscriptions, Memento? workspaceState, _Intersection61? globalState, SecretStorage? secrets, Uri? extensionUri, String? extensionPath, GlobalEnvironmentVariableCollection? environmentVariableCollection, Uri? storageUri, String? storagePath, Uri? globalStorageUri, String? globalStoragePath, Uri? logUri, String? logPath, ExtensionMode? extensionMode, Extension? extension, String asAbsolutePath(String)?})
factory

Properties

asAbsolutePath String Function(String)

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

getter/setter pair
environmentVariableCollection GlobalEnvironmentVariableCollection

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

Gets the extension's global environment variable collection for this workspace, enabling changes to be applied to terminal environment variables.
no setter
extension Extension

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

The current Extension instance.
no setter
extensionMode ExtensionMode

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

The mode the extension is running in. See {@link ExtensionMode} for possible values and scenarios.
no setter
extensionPath String

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

The absolute file path of the directory containing the extension. Shorthand notation for {@link TextDocument.uriExtensionContext.extensionUri.fsPath} (independent of the uri scheme).
no setter
extensionUri Uri

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

The uri of the directory containing the extension.
no setter
globalState → _Intersection61

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

A memento object that stores state independent of the current opened {@link workspace.workspaceFoldersworkspace}.
no setter
globalStoragePath String

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

An absolute file path in which the extension can store global state. The directory might not exist on disk and creation is up to the extension. However, the parent directory is guaranteed to be existent.
no setter
globalStorageUri Uri

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

The uri of a directory in which the extension can store global state. The directory might not exist on disk and creation is up to the extension. However, the parent directory is guaranteed to be existent.
no setter
hashCode int
The hash code for this object.
no setterinherited
logPath String

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

An absolute file path of a directory in which the extension can create log files. The directory might not exist on disk and creation is up to the extension. However, the parent directory is guaranteed to be existent.
no setter
logUri Uri

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

The uri of a directory in which the extension can create log files. The directory might not exist on disk and creation is up to the extension. However, the parent directory is guaranteed to be existent.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secrets SecretStorage

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

A storage utility for secrets. Secrets are persisted across reloads and are independent of the current opened {@link workspace.workspaceFoldersworkspace}.
no setter
storagePath String?

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

An absolute file path of a workspace specific directory in which the extension can store private state. The directory might not exist on disk and creation is up to the extension. However, the parent directory is guaranteed to be existent.
no setter
storageUri Uri?

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

The uri of a workspace specific directory in which the extension can store private state. The directory might not exist and creation is up to the extension. However, the parent directory is guaranteed to be existent. The value is undefined when no workspace nor folder has been opened.
no setter
subscriptions List

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

An array to which disposables can be added. When this extension is deactivated the disposables will be disposed.
no setter
workspaceState Memento

Available on ExtensionContext, provided by the ExtensionContext$Typings extension

A memento object that stores state in the context of the currently opened {@link workspace.workspaceFoldersworkspace}.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited