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