SemanticModel.GetDiagnostics Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Get all the errors within the syntax tree associated with this object. Includes errors involving compiling method bodies or initializers, in addition to the errors returned by GetDeclarationDiagnostics.
public abstract System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic> GetDiagnostics(Microsoft.CodeAnalysis.Text.TextSpan? span = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetDiagnostics : Nullable<Microsoft.CodeAnalysis.Text.TextSpan> * System.Threading.CancellationToken -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>
Public MustOverride Function GetDiagnostics (Optional span As Nullable(Of TextSpan) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic)
Optional span within the syntax tree for which to get diagnostics. If no argument is specified, then diagnostics for the entire tree are returned.
- cancellationToken
- CancellationToken
A cancellation token that can be used to cancel the process of obtaining the diagnostics.
Because this method must semantically bind all method bodies and initializers to check for diagnostics, it may take a significant amount of time. Unlike GetDeclarationDiagnostics, diagnostics for method bodies and initializers are not cached, any semantic information used to obtain the diagnostics is discarded.
Продукт | Версії |
---|---|
Roslyn | 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.7.0, 4.8.0, 4.9.2, 3.0.0, 3.1.0, 3.2.0, 3.2.1, 3.3.1, 3.4.0, 3.5.0, 3.6.0, 3.7.0, 3.8.0, 3.9.0, 3.10.0, 3.11.0, 4.0.1, 4.1.0, 4.12.2, 4.13.0 |
Відгук про .NET
.NET – це проект із відкритим кодом. Виберіть посилання, щоб надати відгук: