Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DiagnosticCollection

A diagnostics collection is a container that manages a set of diagnostics. Diagnostics are always scopes to a diagnostics collection and a resource.

To get an instance of a DiagnosticCollection use createDiagnosticCollection.

层级

  • DiagnosticCollection

索引

Properties(1)

Methods(7)

Properties(1)

Readonly name

name: string

The name of this diagnostic collection, for instance typescript. Every diagnostic from this collection will be associated with this name. Also, the task framework uses this name when defining problem matchers.

Methods(7)

set

  • set(uri: Uri, diagnostics: undefined | readonly Diagnostic[]): void
  • set(entries: readonly [Uri, undefined | readonly Diagnostic[]][]): void
  • Assign diagnostics for given resource. Will replace existing diagnostics for that resource.

    Parameters

    • uri: Uri

      A resource identifier.

    • diagnostics: undefined | readonly Diagnostic[]

      Array of diagnostics or undefined

    Returns void

  • Replace diagnostics for multiple resources in this collection.

    Note that multiple tuples of the same uri will be merged, e.g [[file1, [d1]], [file1, [d2]]] is equivalent to [[file1, [d1, d2]]]. If a diagnostics item is undefined as in [file1, undefined] all previous but not subsequent diagnostics are removed.

    Parameters

    • entries: readonly [Uri, undefined | readonly Diagnostic[]][]

      An array of tuples, like [[file1, [d1, d2]], [file2, [d3, d4, d5]]], or undefined.

    Returns void

delete

  • delete(uri: Uri): void
  • Remove all diagnostics from this collection that belong to the provided uri. The same as #set(uri, undefined).

    Parameters

    • uri: Uri

      A resource identifier.

    Returns void

clear

  • clear(): void
  • Remove all diagnostics from this collection. The same as calling #set(undefined);

    Returns void

forEach

get

  • Get the diagnostics for a given resource. Note that you cannot modify the diagnostics-array returned from this call.

    Parameters

    • uri: Uri

      A resource identifier.

    Returns undefined | readonly Diagnostic[]

    An immutable array of diagnostics or undefined.

has

  • has(uri: Uri): boolean
  • Check if this collection contains diagnostics for a given resource.

    Parameters

    • uri: Uri

      A resource identifier.

    Returns boolean

    true if this collection has diagnostic for the given resource.

dispose

  • dispose(): void

友链:VS Code 中文文档 | VS Code 官网文档 | VS Code 扩展市场

Generated by TypeDoc. Maintained by 洛竹