Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Resource

Hierarchy

Implemented by

Index

Properties

encoding?: 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.

isReadonly?: boolean
onDidChangeContents?: Event<void>
uri: URI
version?: ResourceVersion

Latest read version of this resource.

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

Methods

  • dispose(): void
  • guessEncoding(): Promise<undefined | string>
  • 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.

    throws

    ResourceError.NotFound if a resource not found

    Parameters

    Returns Promise<string>

  • saveContentChanges(changes: TextDocumentContentChangeEvent[], options?: ResourceSaveOptions): Promise<void>
  • Applies incremental content changes to this resource.

    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 to latest.

    throws

    ResourceError.NotFound if a resource not found or was not read yet

    throws

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

    Parameters

    Returns Promise<void>

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

    throws

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

    Parameters

    Returns Promise<void>

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

    throws

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

    Parameters

    Returns Promise<void>