Theia API Documentation v1.65.0
    Preparing search index...
    • Decodes the content from a Uint8Array to a string. You MUST provide the entire content at once to ensure that the encoding can properly apply. Do not use this method to decode content in chunks, as that may lead to incorrect results.

      Will pick an encoding based on settings and the content of the buffer (for example byte order marks).

      Note that if you decode content that is unsupported by the encoding, the result may contain substitution characters as appropriate.

      Parameters

      • content: Uint8Array

        The text content to decode as a Uint8Array.

      Returns Thenable<string>

      A thenable that resolves to the decoded string.

      This method will throw an error when the content is binary.

    • Decodes the content from a Uint8Array to a string using the provided encoding. You MUST provide the entire content at once to ensure that the encoding can properly apply. Do not use this method to decode content in chunks, as that may lead to incorrect results.

      Note that if you decode content that is unsupported by the encoding, the result may contain substitution characters as appropriate.

      Parameters

      • content: Uint8Array

        The text content to decode as a Uint8Array.

      • options: { encoding: string }

        Additional context for picking the encoding.

        • Readonlyencoding: string

          Allows to explicitly pick the encoding to use. See TextDocument.encoding for more information about valid values for encoding. Using an unsupported encoding will fallback to the default configured encoding.

      Returns Thenable<string>

      A thenable that resolves to the decoded string.

      This method will throw an error when the content is binary.

    • Decodes the content from a Uint8Array to a string. You MUST provide the entire content at once to ensure that the encoding can properly apply. Do not use this method to decode content in chunks, as that may lead to incorrect results.

      The encoding is picked based on settings and the content of the buffer (for example byte order marks).

      Note that if you decode content that is unsupported by the encoding, the result may contain substitution characters as appropriate.

      Parameters

      • content: Uint8Array

        The content to decode as a Uint8Array.

      • options: { uri: Uri }

        Additional context for picking the encoding.

        • Readonlyuri: Uri

          The URI that represents the file if known. This information is used to figure out the encoding related configuration for the file if any.

      Returns Thenable<string>

      A thenable that resolves to the decoded string.

      This method will throw an error when the content is binary.