ProjectManager.GetDiagnostics(Uri) Method

Definition

Gets the diagnostics for a single source file, all source files in a managed project, or all source files in the default manager, depending on the value of file.

public Microsoft.VisualStudio.LanguageServer.Protocol.PublishDiagnosticParams[]? GetDiagnostics (Uri? file);
member this.GetDiagnostics : Uri -> Microsoft.VisualStudio.LanguageServer.Protocol.PublishDiagnosticParams[]
Public Function GetDiagnostics (file As Uri) As PublishDiagnosticParams()

Parameters

file
Uri

The uri of a source file in any of the managed projects, the id of one of the managed projects, or null (for default manager).

Returns

PublishDiagnosticParams[]

Remarks

If file corresponds to the id of one of the managed project, returns the diagnostics for all source files in that project, but *not* the diagnostics generated upon loading.

If file corresponds to a source file in any of the managed projects (including in the DefaultManager), returns an array with a single item containing all current diagnostics for the given file.

If file is null, returns the diagnostics for all source files in the default manager.

This method waits for all currently running or queued tasks to finish before accumulating the diagnostics.

Applies to