Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • FileResource

Implements

  • Resource

Index

Constructors

Properties

_version: undefined | FileResourceVersion
acceptTextOnly: boolean = true
doSaveContentChanges: undefined | ((changes: TextDocumentContentChangeEvent[], options?: ResourceSaveOptions) => Promise<void>) = ...
fileService: FileService
limits: undefined | { memory?: number; size?: number }
onDidChangeContents: Event<void> = ...
onDidChangeContentsEmitter: Emitter<void> = ...
saveContentChanges?: ((changes: TextDocumentContentChangeEvent[], options?: ResourceSaveOptions) => Promise<void>)

Type declaration

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

      • changes: TextDocumentContentChangeEvent[]
      • Optional options: ResourceSaveOptions

      Returns Promise<void>

saveContents?: ((content: string, options?: ResourceSaveOptions) => Promise<void>)

Type declaration

    • (content: string, options?: ResourceSaveOptions): 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

      • content: string
      • Optional options: ResourceSaveOptions

      Returns Promise<void>

saveStream?: ((content: Readable<string>, options?: ResourceSaveOptions) => Promise<void>)

Type declaration

    • (content: Readable<string>, options?: ResourceSaveOptions): 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

      • content: Readable<string>
      • Optional options: ResourceSaveOptions

      Returns Promise<void>

toDispose: DisposableCollection = ...
uri: URI

Accessors

  • get encoding(): undefined | string
  • get isReadonly(): boolean

Methods

  • dispose(): void
  • doWrite(content: string | Readable<string>, options?: ResourceSaveOptions): Promise<void>
  • guessEncoding(): Promise<string>
  • isInSync(): Promise<boolean>
  • readContents(options?: { encoding?: string }): Promise<string>
  • readStream(options?: { encoding?: string }): Promise<ReadableStream<string>>
  • shouldOpenAsText(error: string): Promise<boolean>
  • shouldOverwrite(): Promise<boolean>
  • sync(): Promise<void>
  • updateSavingContentChanges(): void