This is an implementation of #theia.Uri based on vscode-uri. This is supposed to fix https://github.com/eclipse-theia/theia/issues/8752 We cannot simply upgrade the dependency, because the current version 3.x is not compatible with our current codebase

Hierarchy

  • URI
    • URI

Implements

Constructors

Methods

  • There is quite some magic in to vscode URI class related to transferring via JSON.stringify(). Making the CodeURI instance makes sure we transfer this object as a vscode-uri URI.

    Returns UriComponents

  • Override to create the correct class.

    Parameters

    • change: {
          authority?: null | string;
          fragment?: null | string;
          path?: null | string;
          query?: null | string;
          scheme?: string;
      }
      • Optional authority?: null | string
      • Optional fragment?: null | string
      • Optional path?: null | string
      • Optional query?: null | string
      • Optional scheme?: string

    Returns URI

  • Create a new uri which path is the result of joining the path of the base uri with the provided path segments.

    • Note 1: joinPath only affects the path component and all other components (scheme, authority, query, and fragment) are left as they are.
    • Note 2: The base uri must have a path; an error is thrown otherwise.

    The path segments are normalized in the following ways:

    • sequences of path separators (/ or \) are replaced with a single separator
    • for file-uris on windows, the backslash-character (``) is considered a path-separator
    • the ..-segment denotes the parent segment, the . denotes the current segment
    • paths have a root which always remains, for instance on windows drive-letters are roots so that is true: joinPath(Uri.file('file:///c:/root'), '../../other').fsPath === 'c:/other'

    Parameters

    • uri: URI
    • Rest ...pathSegments: string[]

      One more more path fragments

    Returns URI

    A new uri which path is joined with the given fragments

  • Create an URI from a string. Will throw if the given value is not valid.

    Parameters

    • value: string

      The string value of an Uri.

    • Optional _strict: boolean

    Returns URI

    A new Uri instance.