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}.
Variables
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.
Methods
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. |
|---|
dispose():Void
Dispose and free associated resources. Calls {@link DiagnosticCollection.clear clear}.
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 |
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 {
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.
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 |