A diagnostics collection is a container that manages a set of {@link Diagnostic diagnostics}. Diagnostics are always scopes to a diagnostics collection and a resource.

To get an instance of a DiagnosticCollection use {@link languages.createDiagnosticCollection createDiagnosticCollection}.

Fields

set(uri:Uri, diagnostics:Null<ReadOnlyArray<Diagnostic>>):Void

set(entries:ReadOnlyArray<ReadOnlyArray<Any>>):Void

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

Parameters:

uri

A resource identifier.

diagnostics

Array of diagnostics or undefined

read onlyname: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.

has(uri:Uri):Bool

Check if this collection contains diagnostics for a given resource.

Parameters:

uri

A resource identifier.

Returns:

true if this collection has diagnostic for the given resource.

get(uri:Uri):Null<ReadOnlyArray<Diagnostic>>

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

@link Diagnostic diagnostics} or undefined.

Parameters:

uri

A resource identifier.

Returns:

An immutable array of {

forEach(callback:(Uri, ReadOnlyArray<Diagnostic>, DiagnosticCollection) ‑> Void, ?thisArg:Any):Void

Iterate over each entry in this collection.

Parameters:

callback

Function to execute for each entry.

thisArg

The this context used when invoking the handler function.

dispose():Void

Dispose and free associated resources. Calls {@link DiagnosticCollection.clear clear}.

delete(uri:Uri):Void

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

Parameters:

uri

A resource identifier.

clear():Void

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