Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Variables

appHost: string

The hosted location of the application On desktop this is 'desktop' In the web this is the specified embedder i.e. 'github.dev', 'codespaces', or 'web' if the embedder does not provide that information

appName: string

The application name of the editor, like 'Eclipse Theia'.

appRoot: string

The application root folder from which the editor is running.

clipboard: Clipboard

The system clipboard.

isNewAppInstall: boolean

Indicates that this is a fresh install of the application. true if within the first day of installation otherwise false.

isTelemetryEnabled: boolean

Indicates whether the users has telemetry enabled. Can be observed to determine if the extension should send telemetry.

language: string

Represents the preferred user-language, like de-CH, fr, or en-US.

logLevel: LogLevel

The current log level of the editor.

machineId: string

A unique identifier for the computer.

remoteName: string | undefined

The name of a remote. Defined by extensions, popular samples are wsl for the Windows Subsystem for Linux or ssh-remote for remotes using a secure shell.

Note that the value is undefined when there is no remote extension host but that the value is defined in all extension hosts (local and remote) in case a remote extension host exists. Use Extension.extensionKind to know if a specific extension runs remote or not.

sessionId: string

A unique identifier for the current session. Changes each time the editor is started.

shell: string

The detected default shell for the extension host.

uiKind: UIKind

The UI kind property indicates from which UI extensions are accessed from. For example, extensions could be accessed from a desktop application or a web browser.

uriScheme: string

The custom uri scheme the editor registers to in the operating system.

Functions

  • Resolves an external uri, such as a http: or https: link, from where the extension is running to a uri to the same resource on the client machine.

    This is a no-op if the extension is running on the client machine. Currently only supports https: and http: uris.

    If the extension is running remotely, this function automatically establishes a port forwarding tunnel from the local machine to target on the remote and returns a local uri to the tunnel. The lifetime of the port forwarding tunnel is managed by VS Code and the tunnel can be closed by the user.

    Extensions should not cache the result of asExternalUri as the resolved uri may become invalid due to a system or user action — for example, in remote cases, a user may close a port forwarding tunnel that was opened by asExternalUri.

    Note that uris passed through openExternal are automatically resolved and you should not call asExternalUri on them.

    Parameters

    Returns Thenable<Uri>

    A uri that can be used on the client machine.

  • getEnvVariable(envVarName: string): Thenable<string | undefined>
  • Gets environment variable value by name.

    Parameters

    • envVarName: string

      name of environment variable to get

    Returns Thenable<string | undefined>

    value of the given environment variable name or undefined if there is no such variable.

  • getQueryParameter(queryParamName: string): string | string[] | undefined
  • Gets query parameter value by name.

    Parameters

    • queryParamName: string

      name of query parameter to get.

    Returns string | string[] | undefined

    value of the given query parameter or undefined if there is no such variable.

  • getQueryParameters(): {} | undefined
  • onDidChangeTelemetryEnabled(listener: ((e: boolean) => any), thisArgs?: any, disposables?: Disposable[]): Disposable
  • An Event which fires when the user enabled or disables telemetry. true if the user has enabled telemetry or false if the user has disabled telemetry.

    Parameters

    • listener: ((e: boolean) => any)
        • (e: boolean): any
        • Parameters

          • e: boolean

          Returns any

    • Optional thisArgs: any
    • Optional disposables: Disposable[]

    Returns Disposable

  • Opens an external item, e.g. a http(s) or mailto-link, using the default application.

    Note that showTextDocument is the right way to open a text document inside the editor, not this function.

    Parameters

    • target: Uri

      The uri that should be opened.

    Returns Thenable<boolean>

    A promise indicating if open was successful.