Interface DiagnosticCollection

interface DiagnosticCollection {
    name: string;
    clear(): void;
    delete(uri): void;
    dispose(): void;
    forEach(callback, thisArg?): void;
    get(uri): undefined | readonly Diagnostic[];
    has(uri): boolean;
    set(uri, diagnostics): void;
    set(entries): void;
}

Implemented by

Properties

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

  • 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

  • Iterate over each entry in this collection.

    Parameters

    • callback: ((uri, diagnostics, collection) => any)

      Function to execute for each entry.

    • Optional thisArg: any

      The this context used when invoking the handler function.

    Returns void

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

  • Assign diagnostics for given resource. Will replace existing diagnostics for that resource.

    Parameters

    • uri: Uri

      A resource identifier.

    • diagnostics: undefined | Diagnostic[]

      Array of diagnostics or undefined

    Returns void

  • Replace all entries in this collection for given uris.

    Diagnostics of 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: undefined | [Uri, undefined | Diagnostic[]][]

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

    Returns void