SyntaxTree.GetDiagnostics Method

Definition

Overloads

GetDiagnostics(CancellationToken)

Gets a list of all the diagnostics in the syntax tree. This method does not filter diagnostics based on #pragmas and compiler options like nowarn, warnaserror etc.

GetDiagnostics(SyntaxTrivia)

Gets a list of all the diagnostics associated with the trivia. This method does not filter diagnostics based on #pragmas and compiler options like nowarn, warnaserror etc.

GetDiagnostics(SyntaxNodeOrToken)

Gets a list of all the diagnostics in either the sub tree that has the specified node as its root or associated with the token and its related trivia. This method does not filter diagnostics based on #pragmas and compiler options like nowarn, warnaserror etc.

GetDiagnostics(SyntaxNode)

Gets a list of all the diagnostics in the sub tree that has the specified node as its root. This method does not filter diagnostics based on #pragmas and compiler options like nowarn, warnaserror etc.

GetDiagnostics(SyntaxToken)

Gets a list of all the diagnostics associated with the token and any related trivia. This method does not filter diagnostics based on #pragmas and compiler options like nowarn, warnaserror etc.

GetDiagnostics(CancellationToken)

Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs

Gets a list of all the diagnostics in the syntax tree. This method does not filter diagnostics based on #pragmas and compiler options like nowarn, warnaserror etc.

C#
public abstract System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Diagnostic> GetDiagnostics(System.Threading.CancellationToken cancellationToken = default);

Parameters

cancellationToken
CancellationToken

Returns

Applies to

Roslyn 4.13.0 and other versions
Product Versions
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

GetDiagnostics(SyntaxTrivia)

Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs

Gets a list of all the diagnostics associated with the trivia. This method does not filter diagnostics based on #pragmas and compiler options like nowarn, warnaserror etc.

C#
public abstract System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Diagnostic> GetDiagnostics(Microsoft.CodeAnalysis.SyntaxTrivia trivia);

Parameters

trivia
SyntaxTrivia

Returns

Applies to

Roslyn 4.13.0 and other versions
Product Versions
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

GetDiagnostics(SyntaxNodeOrToken)

Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs

Gets a list of all the diagnostics in either the sub tree that has the specified node as its root or associated with the token and its related trivia. This method does not filter diagnostics based on #pragmas and compiler options like nowarn, warnaserror etc.

C#
public abstract System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Diagnostic> GetDiagnostics(Microsoft.CodeAnalysis.SyntaxNodeOrToken nodeOrToken);

Parameters

nodeOrToken
SyntaxNodeOrToken

Returns

Applies to

Roslyn 4.13.0 and other versions
Product Versions
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

GetDiagnostics(SyntaxNode)

Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs

Gets a list of all the diagnostics in the sub tree that has the specified node as its root. This method does not filter diagnostics based on #pragmas and compiler options like nowarn, warnaserror etc.

C#
public abstract System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Diagnostic> GetDiagnostics(Microsoft.CodeAnalysis.SyntaxNode node);

Parameters

node
SyntaxNode

Returns

Applies to

Roslyn 4.13.0 and other versions
Product Versions
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

GetDiagnostics(SyntaxToken)

Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs
Source:
SyntaxTree.cs

Gets a list of all the diagnostics associated with the token and any related trivia. This method does not filter diagnostics based on #pragmas and compiler options like nowarn, warnaserror etc.

C#
public abstract System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Diagnostic> GetDiagnostics(Microsoft.CodeAnalysis.SyntaxToken token);

Parameters

token
SyntaxToken

Returns

Applies to

Roslyn 4.13.0 and other versions
Product Versions
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