Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UntitledResource

Hierarchy

  • UntitledResource

Implements

Index

Constructors

Properties

onDidChangeContentsEmitter: Emitter<void> = ...
uri: URI

Accessors

  • get encoding(): undefined | string
  • get onDidChangeContents(): Event<void>

Methods

  • dispose(): void
  • fireDidChangeContents(): void
  • readContents(options?: { encoding?: string }): Promise<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.

    Parameters

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

    Returns Promise<string>

  • saveContents(content: string, options?: { encoding?: string; overwriteEncoding?: boolean }): 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.

    Parameters

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

    Returns Promise<void>