Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace env

Index

Variables

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 logLevel

logLevel: LogLevel

Current logging level.

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 uiKind

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.

Const uriScheme

uriScheme: string

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

Functions

asExternalUri

  • 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 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 PromiseLike<Uri>

    A uri that can be used on the client machine.

getClientOperatingSystem

getEnvVariable

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

    Parameters

    • 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

  • 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

  • getQueryParameters(): {} | undefined

Const onDidChangeLogLevel

openExternal

  • 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.

    Parameters

    • target: Uri

      The uri that should be opened.

    Returns PromiseLike<boolean>

    A promise indicating if open was successful.