Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • FileResource

Implements

  • Resource

Index

Constructors

constructor

Properties

Protected _version

_version: undefined | FileResourceVersion

Protected acceptTextOnly

acceptTextOnly: boolean = true

Protected doSaveContentChanges

doSaveContentChanges: undefined | ((changes: TextDocumentContentChangeEvent[], options?: ResourceSaveOptions) => Promise<void>) = ...

Protected Readonly fileService

fileService: FileService

Protected limits

limits: undefined | { memory?: number; size?: number }

Readonly onDidChangeContents

onDidChangeContents: Event<void> = ...

Protected Readonly onDidChangeContentsEmitter

onDidChangeContentsEmitter: Emitter<void> = ...

Protected Readonly options

Optional saveContentChanges

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>

Protected Readonly toDispose

toDispose: DisposableCollection = ...

Readonly uri

uri: default

Accessors

encoding

  • get encoding(): undefined | string

version

Methods

dispose

  • dispose(): void

Protected doWrite

  • doWrite(content: string | Readable<string>, options?: ResourceSaveOptions): Promise<void>

guessEncoding

  • guessEncoding(): Promise<string>

Protected isInSync

  • isInSync(): Promise<boolean>

readContents

  • readContents(options?: { encoding?: string }): Promise<string>

readStream

  • readStream(options?: { encoding?: string }): Promise<ReadableStream<string>>

saveContents

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

saveStream

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

Protected shouldOpenAsText

  • shouldOpenAsText(error: string): Promise<boolean>

Protected shouldOverwrite

  • shouldOverwrite(): Promise<boolean>

Protected sync

  • sync(): Promise<void>

Protected updateSavingContentChanges

  • updateSavingContentChanges(): void