Class UntitledResource

Implements

Constructors

Properties

content?: string
onDidChangeContentsEmitter: Emitter<void> = ...
resources: Map<string, UntitledResource>
uri: URI

Accessors

  • get encoding(): undefined | string
  • Latest read encoding of this resource.

    Optional if a resource does not support encoding, check with in operator`. Undefined if a resource did not read content yet.

    Returns undefined | string

Methods

  • Reads latest content of this resource.

    If a resource supports versioning it updates version to latest. If a resource supports encoding it updates encoding to latest.

    Parameters

    • Optional options: {
          encoding?: string;
      }
      • Optional encoding?: string

    Returns Promise<string>

    Throws

    ResourceError.NotFound if a resource not found

  • Rewrites the complete content for this resource. If a resource does not exist it will be created.

    If a resource supports versioning clients can pass some version to check against it, if it is not provided latest version is used.

    It updates version and encoding to latest.

    Parameters

    • content: string
    • Optional options: {
          encoding?: string;
          overwriteEncoding?: boolean;
      }
      • Optional encoding?: string
      • Optional overwriteEncoding?: boolean

    Returns Promise<void>

    Throws

    ResourceError.OutOfSync if latest resource version is out of sync with the given