Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Resource

Hierarchy

Implemented by

Index

Properties

NULL

NULL: Disposable = create(() => { })

Optional Readonly encoding

encoding: string | undefined

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.

Optional Readonly onDidChangeContents

onDidChangeContents: Event<void>

Readonly uri

uri: URI

Optional Readonly version

version: ResourceVersion | undefined

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.

Functions

save

shouldSaveContent

  • shouldSaveContent(resource: Resource, __namedParameters: { changes: undefined | ({ range: Range; rangeLength?: undefined | number; text: string } | { text: string })[]; contentLength: number }): boolean
  • Parameters

    • resource: Resource
    • __namedParameters: { changes: undefined | ({ range: Range; rangeLength?: undefined | number; text: string } | { text: string })[]; contentLength: number }
      • changes: undefined | ({ range: Range; rangeLength?: undefined | number; text: string } | { text: string })[]
      • contentLength: number

    Returns boolean

trySaveContentChanges

Methods

create

dispose

  • dispose(): void

Optional guessEncoding

  • guessEncoding(): Promise<string | undefined>

is

  • is(arg: any): arg is Disposable

readContents

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

Optional readStream

  • Stream 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<ReadableStream<string>>

Optional saveContentChanges

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

Optional saveContents

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

Optional saveStream

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