SemanticModel.GetSyntaxDiagnostics Method
Definition
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 of the syntax errors within the syntax tree associated with this object. Does not get errors involving declarations or compiling method bodies or initializers.
public abstract System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic> GetSyntaxDiagnostics (Microsoft.CodeAnalysis.Text.TextSpan? span = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetSyntaxDiagnostics : Nullable<Microsoft.CodeAnalysis.Text.TextSpan> * System.Threading.CancellationToken -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>
Public MustOverride Function GetSyntaxDiagnostics (Optional span As Nullable(Of TextSpan) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic)
Parameters
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.