• Public
  • Public/Protected
  • All



Const appName

appName: string

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

Const appRoot

appRoot: string

The application root folder from which the editor is running.

Const clipboard

clipboard: Clipboard

The system clipboard.

Const language

language: string

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

Const machineId

machineId: string

A unique identifier for the computer.

Const sessionId

sessionId: string

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

Const shell

shell: string

The detected default shell for the extension host.

Const uriScheme

uriScheme: string

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



  • asExternalUri(target: Uri): PromiseLike<Uri>
  • 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 fowarding 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 forwardng tunnel that was opened by asExternalUri.

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


    Returns PromiseLike<Uri>

    A uri that can be used on the client machine.


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


    • envVarName: string

      name of environment variable to get

    Returns PromiseLike<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.


    • 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(): object | undefined


  • openExternal(target: Uri): PromiseLike<boolean>
  • 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.


    • target: Uri

      The uri that should be opened.

    Returns PromiseLike<boolean>

    A promise indicating if open was successful.