186 references to IfDirectiveTrivia
Microsoft.CodeAnalysis.CSharp (20)
Parser\Directives.cs (8)
60
case SyntaxKind.
IfDirectiveTrivia
:
181
while (current.Head.Kind != SyntaxKind.
IfDirectiveTrivia
);
199
else if (current.Head.Kind == SyntaxKind.
IfDirectiveTrivia
)
217
return prev != null && prev.Any() && (prev.Head.Kind == SyntaxKind.
IfDirectiveTrivia
|| prev.Head.Kind == SyntaxKind.ElifDirectiveTrivia);
266
if (stack.Head.Kind == SyntaxKind.
IfDirectiveTrivia
)
317
case SyntaxKind.
IfDirectiveTrivia
:
334
case SyntaxKind.
IfDirectiveTrivia
:
412
case SyntaxKind.
IfDirectiveTrivia
:
Parser\Lexer.cs (1)
2371
else if (directive.Kind == SyntaxKind.
IfDirectiveTrivia
)
Syntax\CSharpSyntaxTree.cs (2)
240
case SyntaxKind.
IfDirectiveTrivia
:
256
case SyntaxKind.
IfDirectiveTrivia
:
Syntax\DirectiveTriviaSyntax.cs (7)
23
case SyntaxKind.
IfDirectiveTrivia
:
161
case SyntaxKind.
IfDirectiveTrivia
:
233
case SyntaxKind.
IfDirectiveTrivia
:
266
case SyntaxKind.
IfDirectiveTrivia
:
283
case SyntaxKind.
IfDirectiveTrivia
:
297
case SyntaxKind.
IfDirectiveTrivia
:
335
while (d != null && d.Kind() != SyntaxKind.
IfDirectiveTrivia
)
Syntax\SyntaxKindFacts.cs (1)
276
case SyntaxKind.
IfDirectiveTrivia
:
Syntax\SyntaxNodeRemover.cs (1)
478
case SyntaxKind.
IfDirectiveTrivia
:
Microsoft.CodeAnalysis.CSharp.CodeStyle (7)
src\Analyzers\CSharp\Analyzers\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
106
SyntaxKind.
IfDirectiveTrivia
or SyntaxKind.ElseDirectiveTrivia or SyntaxKind.ElifDirectiveTrivia or SyntaxKind.EndIfDirectiveTrivia))
src\Analyzers\CSharp\Analyzers\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
87
SyntaxKind.
IfDirectiveTrivia
or SyntaxKind.ElseDirectiveTrivia or SyntaxKind.ElifDirectiveTrivia or SyntaxKind.EndIfDirectiveTrivia))
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
109
case SyntaxKind.
IfDirectiveTrivia
or
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (1)
143
SyntaxKind.
IfDirectiveTrivia
or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DirectiveSyntaxExtensions.cs (1)
68
is SyntaxKind.
IfDirectiveTrivia
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
554
if (trivia.GetStructure() is (kind: SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia or SyntaxKind.
IfDirectiveTrivia
or SyntaxKind.EndIfDirectiveTrivia))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
35
public int IfDirectiveTrivia => (int)SyntaxKind.
IfDirectiveTrivia
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
163
if (root.Usings[i].GetLeadingTrivia().Any(trivia => trivia.IsKind(SyntaxKind.
IfDirectiveTrivia
)))
Microsoft.CodeAnalysis.CSharp.Features (8)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
243
var firstRelevantDirective = root.GetFirstDirective(static directive => directive.Kind() is SyntaxKind.NullableDirectiveTrivia or SyntaxKind.
IfDirectiveTrivia
);
ExtractMethod\Extensions.cs (1)
192
case SyntaxKind.
IfDirectiveTrivia
:
src\Analyzers\CSharp\Analyzers\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
106
SyntaxKind.
IfDirectiveTrivia
or SyntaxKind.ElseDirectiveTrivia or SyntaxKind.ElifDirectiveTrivia or SyntaxKind.EndIfDirectiveTrivia))
src\Analyzers\CSharp\Analyzers\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
87
SyntaxKind.
IfDirectiveTrivia
or SyntaxKind.ElseDirectiveTrivia or SyntaxKind.ElifDirectiveTrivia or SyntaxKind.EndIfDirectiveTrivia))
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
109
case SyntaxKind.
IfDirectiveTrivia
or
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (1)
143
SyntaxKind.
IfDirectiveTrivia
or
Structure\Providers\DisabledTextTriviaStructureProvider.cs (2)
49
if (!parentTriviaList[indexInParent - 1].IsKind(SyntaxKind.
IfDirectiveTrivia
) &&
94
case SyntaxKind.
IfDirectiveTrivia
:
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (144)
IncrementalParsing\IncrementalParsingTests.cs (4)
359
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, oldDirectives[0].Kind());
371
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, newDirectives[0].Kind());
405
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, oldDirectives[0].Kind());
414
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, newDirectives[0].Kind());
LexicalAndXml\LexicalTests.cs (2)
546
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, trivia[0].Kind());
577
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, token.GetLeadingTrivia()[0].Kind());
LexicalAndXml\PreprocessorTests.cs (109)
586
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive },
605
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken },
627
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken },
648
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken },
667
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
682
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
699
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
714
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
734
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
758
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
782
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
806
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
830
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
854
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
878
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
904
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
929
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
954
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
981
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1009
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1038
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1061
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1062
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1081
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1082
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsNotActive | NodeStatus.NotBranchTaken | NodeStatus.TrueValue },
1101
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1102
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1122
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1124
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsNotActive | NodeStatus.NotBranchTaken | NodeStatus.TrueValue },
1144
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1146
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsNotActive | NodeStatus.NotBranchTaken | NodeStatus.TrueValue },
1167
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1170
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsNotActive | NodeStatus.NotBranchTaken | NodeStatus.TrueValue },
1192
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1193
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsNotActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1195
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsNotActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1213
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1229
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1245
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1261
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1277
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1292
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1307
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1322
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1337
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1352
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1367
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1382
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1397
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1412
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1427
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1465
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue });
1480
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue });
1493
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue });
1506
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue });
1522
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1539
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1555
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1574
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1595
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1616
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
1703
VerifyDirectives(node, SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.ElseDirectiveTrivia, SyntaxKind.EndIfDirectiveTrivia);
1719
VerifyDirectives(node, SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.ElseDirectiveTrivia, SyntaxKind.EndIfDirectiveTrivia);
1784
SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.EndIfDirectiveTrivia, SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.EndIfDirectiveTrivia,
1785
SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.ErrorDirectiveTrivia, SyntaxKind.ElifDirectiveTrivia, SyntaxKind.ElseDirectiveTrivia, SyntaxKind.ErrorDirectiveTrivia, SyntaxKind.EndIfDirectiveTrivia,
1786
SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.ElseDirectiveTrivia, SyntaxKind.ErrorDirectiveTrivia, SyntaxKind.EndIfDirectiveTrivia,
1787
SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.ElseDirectiveTrivia, SyntaxKind.ErrorDirectiveTrivia, SyntaxKind.EndIfDirectiveTrivia,
1788
SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.ElseDirectiveTrivia, SyntaxKind.ErrorDirectiveTrivia, SyntaxKind.EndIfDirectiveTrivia);
1810
VerifyDirectives(node, SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.ElifDirectiveTrivia, SyntaxKind.ElseDirectiveTrivia, SyntaxKind.EndIfDirectiveTrivia);
1839
VerifyDirectives(node, SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.ElseDirectiveTrivia, SyntaxKind.EndIfDirectiveTrivia, SyntaxKind.EndIfDirectiveTrivia);
1859
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1861
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1886
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1887
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsNotActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
1944
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
2010
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
2029
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
2048
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2067
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2446
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
2465
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2484
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2505
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
2607
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
2628
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2631
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2657
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2662
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2664
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2688
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2690
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsNotActive | NodeStatus.NotBranchTaken | NodeStatus.TrueValue },
2694
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2719
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2722
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2725
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2745
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2763
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.NotBranchTaken | NodeStatus.FalseValue },
2783
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive | NodeStatus.BranchTaken | NodeStatus.TrueValue },
2866
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive },
2871
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive },
2981
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive },
2997
VerifyDirectivesSpecial(node, new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive },
3021
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive },
3057
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive },
3096
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive },
4633
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive },
4651
new DirectiveInfo { Kind = SyntaxKind.
IfDirectiveTrivia
, Status = NodeStatus.IsActive },
Syntax\SyntaxNodeTests.cs (29)
141
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, nodes[0].Kind());
151
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, nodes[0].Kind());
161
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, nodes[0].Kind());
171
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, nodes[0].Kind());
189
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, nodes[1].Kind());
201
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, nodes[1].Kind());
213
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, nodes[1].Kind());
225
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, nodes[1].Kind());
244
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, nodesAndTokens[0].Kind());
281
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, nodesAndTokens[1].Kind());
372
testContainsHelper1("#if true\r\n#elif true", SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.ElifDirectiveTrivia);
373
testContainsHelper1("#if false\r\n#elif true", SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.ElifDirectiveTrivia);
374
testContainsHelper1("#if false\r\n#elif false", SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.ElifDirectiveTrivia);
376
testContainsHelper1("#if true\r\n#else", SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.ElseDirectiveTrivia);
378
testContainsHelper1("#if true\r\n#endif", SyntaxKind.
IfDirectiveTrivia
, SyntaxKind.EndIfDirectiveTrivia);
383
testContainsHelper1("#if true", SyntaxKind.
IfDirectiveTrivia
);
1415
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, d3.Kind());
1440
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, d2.Kind());
1499
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, d.Kind());
1503
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, related[0].Kind());
1530
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, d.Kind());
1534
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, related[0].Kind());
1570
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, related[0].Kind());
1600
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, d.Kind());
1604
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, related[0].Kind());
1634
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, d.Kind());
1638
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, related[0].Kind());
1669
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, related[0].Kind());
1699
Assert.Equal(SyntaxKind.
IfDirectiveTrivia
, related[0].Kind());
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
Classification\Worker.cs (1)
236
case SyntaxKind.
IfDirectiveTrivia
:
Classification\Worker_Preprocesser.cs (1)
21
case SyntaxKind.
IfDirectiveTrivia
:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DirectiveSyntaxExtensions.cs (1)
68
is SyntaxKind.
IfDirectiveTrivia
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
554
if (trivia.GetStructure() is (kind: SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia or SyntaxKind.
IfDirectiveTrivia
or SyntaxKind.EndIfDirectiveTrivia))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
35
public int IfDirectiveTrivia => (int)SyntaxKind.
IfDirectiveTrivia
;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
163
if (root.Usings[i].GetLeadingTrivia().Any(trivia => trivia.IsKind(SyntaxKind.
IfDirectiveTrivia
)))