41 references to NullableDirectiveTrivia
Microsoft.CodeAnalysis.CSharp (5)
Syntax\DirectiveTriviaSyntax.cs (1)
59
case SyntaxKind.
NullableDirectiveTrivia
:
Syntax\NullableContextStateMap.cs (1)
143
if (d.Kind() != SyntaxKind.
NullableDirectiveTrivia
)
Syntax\SyntaxEquivalence.cs (2)
257
if (ignoreChildNode is object && ignoreChildNode(SyntaxKind.
NullableDirectiveTrivia
))
284
if (current.Kind == SyntaxKind.
NullableDirectiveTrivia
)
Syntax\SyntaxKindFacts.cs (1)
294
case SyntaxKind.
NullableDirectiveTrivia
:
Microsoft.CodeAnalysis.CSharp.CodeStyle (4)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (2)
57
if (!root.ContainsDirective(SyntaxKind.
NullableDirectiveTrivia
))
98
case SyntaxKind.
NullableDirectiveTrivia
:
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (2)
280
if (!root.ContainsDirective(SyntaxKind.
NullableDirectiveTrivia
))
301
if (!root.ContainsDirective(SyntaxKind.
NullableDirectiveTrivia
))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpAddImportsService.cs (1)
84
=> SyntaxFactory.AreEquivalent(a, b, kind => kind == SyntaxKind.
NullableDirectiveTrivia
);
Microsoft.CodeAnalysis.CSharp.Features (6)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (2)
27
directive => directive.IsKind(SyntaxKind.
NullableDirectiveTrivia
);
243
var firstRelevantDirective = root.GetFirstDirective(static directive => directive.Kind() is SyntaxKind.
NullableDirectiveTrivia
or SyntaxKind.IfDirectiveTrivia);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (2)
57
if (!root.ContainsDirective(SyntaxKind.
NullableDirectiveTrivia
))
98
case SyntaxKind.
NullableDirectiveTrivia
:
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (2)
280
if (!root.ContainsDirective(SyntaxKind.
NullableDirectiveTrivia
))
301
if (!root.ContainsDirective(SyntaxKind.
NullableDirectiveTrivia
))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (22)
LexicalAndXml\PreprocessorTests.cs (19)
255
case SyntaxKind.
NullableDirectiveTrivia
:
280
Assert.True(SyntaxFacts.IsPreprocessorDirective(SyntaxKind.
NullableDirectiveTrivia
));
4469
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsActive, Text = "enable" });
4480
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsActive, Text = "restore" });
4491
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsActive, Text = "enable" });
4502
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsActive, Text = "disable" });
4513
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsActive, Text = "enable warnings" });
4524
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsActive, Text = "enable annotations" });
4535
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsActive, Text = "disable warnings" });
4546
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsActive, Text = "disable" });
4565
VerifyDirectivesSpecial(root, new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsActive, Text = "enable" });
4582
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsActive, Text = "" });
4593
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsActive, Text = "disable" });
4604
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsActive, Text = "" });
4615
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsActive, Text = "" });
4632
new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsActive, Text = "enable" },
4634
new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsNotActive, Text = "enable" },
4636
new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsActive, Text = "disable" });
4652
new DirectiveInfo { Kind = SyntaxKind.
NullableDirectiveTrivia
, Status = NodeStatus.IsNotActive, Text = "" },
Syntax\SyntaxEquivalenceTests.cs (2)
492
VerifyEquivalent(tree1.GetRoot(), tree2.GetRoot(), ignoreChildNode: k => k == SyntaxKind.
NullableDirectiveTrivia
);
513
VerifyEquivalent(tree3.GetRoot(), tree4.GetRoot(), ignoreChildNode: k => k == SyntaxKind.
NullableDirectiveTrivia
);
Syntax\SyntaxNodeTests.cs (1)
381
testContainsHelper1("#nullable enable", SyntaxKind.
NullableDirectiveTrivia
);
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
Classification\Worker.cs (1)
252
case SyntaxKind.
NullableDirectiveTrivia
:
Classification\Worker_Preprocesser.cs (1)
72
case SyntaxKind.
NullableDirectiveTrivia
:
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpAddImportsService.cs (1)
84
=> SyntaxFactory.AreEquivalent(a, b, kind => kind == SyntaxKind.
NullableDirectiveTrivia
);