69 references to RegionDirectiveTrivia
Microsoft.CodeAnalysis.CSharp (13)
Parser\Directives.cs (6)
211return prev != null && prev.Any() && prev.Head.Kind != SyntaxKind.RegionDirectiveTrivia; 223return prev != null && prev.Any() && prev.Head.Kind == SyntaxKind.RegionDirectiveTrivia; 300if (stack.Head.Kind == SyntaxKind.RegionDirectiveTrivia) 337case SyntaxKind.RegionDirectiveTrivia: 350while (current != null && current.Any() && current.Head.Kind != SyntaxKind.RegionDirectiveTrivia) 418case SyntaxKind.RegionDirectiveTrivia:
Syntax\DirectiveTriviaSyntax.cs (5)
31case SyntaxKind.RegionDirectiveTrivia: 205case SyntaxKind.RegionDirectiveTrivia: 240case SyntaxKind.RegionDirectiveTrivia: 309if (d.Kind() == SyntaxKind.RegionDirectiveTrivia) 342while (d != null && d.Kind() != SyntaxKind.RegionDirectiveTrivia)
Syntax\SyntaxKindFacts.cs (1)
280case SyntaxKind.RegionDirectiveTrivia:
Syntax\SyntaxNodeRemover.cs (1)
482case SyntaxKind.RegionDirectiveTrivia:
Microsoft.CodeAnalysis.CSharp.CodeStyle (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DirectiveSyntaxExtensions.cs (1)
64=> directive?.Kind() is SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
554if (trivia.GetStructure() is (kind: SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia or SyntaxKind.IfDirectiveTrivia or SyntaxKind.EndIfDirectiveTrivia))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (1)
100if (trivia2.Kind() is SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (2)
65if (trivia.Kind() == SyntaxKind.RegionDirectiveTrivia || 226if (trivia.Kind() is not SyntaxKind.RegionDirectiveTrivia and
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
39public int RegionDirectiveTrivia => (int)SyntaxKind.RegionDirectiveTrivia;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
228if (token.IsKind(SyntaxKind.HashToken) && token.Parent!.Kind() is not (SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia))
Microsoft.CodeAnalysis.CSharp.Features (4)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
225if (firstToken.IsKind(SyntaxKind.HashToken) && firstToken.Parent.IsKind(SyntaxKind.RegionDirectiveTrivia))
ExtractMethod\Extensions.cs (1)
181case SyntaxKind.RegionDirectiveTrivia:
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
228if (token.IsKind(SyntaxKind.HashToken) && token.Parent!.Kind() is not (SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia))
TaskList\CSharpTaskListService.cs (1)
85return trivia.Kind() != SyntaxKind.RegionDirectiveTrivia &&
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (37)
IncrementalParsing\IncrementalParsingTests.cs (4)
360Assert.Equal(SyntaxKind.RegionDirectiveTrivia, oldDirectives[1].Kind()); 372Assert.Equal(SyntaxKind.RegionDirectiveTrivia, newDirectives[1].Kind()); 406Assert.Equal(SyntaxKind.RegionDirectiveTrivia, oldDirectives[1].Kind()); 415Assert.Equal(SyntaxKind.RegionDirectiveTrivia, newDirectives[1].Kind());
LexicalAndXml\PreprocessorTests.cs (28)
1907new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 1924new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 1925new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 1943new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 1962new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 1979VerifyDirectives(node, SyntaxKind.RegionDirectiveTrivia, SyntaxKind.BadDirectiveTrivia, SyntaxKind.EndRegionDirectiveTrivia); 1994VerifyDirectives(node, SyntaxKind.RegionDirectiveTrivia, SyntaxKind.BadDirectiveTrivia, SyntaxKind.EndRegionDirectiveTrivia); 2011new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 2030new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 2049new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsNotActive }, 2068new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsNotActive }, 2084new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 2100new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 2122new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 2148VerifyDirectives(node, SyntaxKind.RegionDirectiveTrivia, SyntaxKind.EndRegionDirectiveTrivia); 2165VerifyDirectives(node, SyntaxKind.RegionDirectiveTrivia, SyntaxKind.EndRegionDirectiveTrivia, SyntaxKind.RegionDirectiveTrivia, SyntaxKind.EndRegionDirectiveTrivia); 2180VerifyDirectives(node, SyntaxKind.RegionDirectiveTrivia, SyntaxKind.EndRegionDirectiveTrivia, SyntaxKind.RegionDirectiveTrivia, SyntaxKind.EndRegionDirectiveTrivia); 2196VerifyDirectives(node, SyntaxKind.RegionDirectiveTrivia, SyntaxKind.EndRegionDirectiveTrivia); 2210new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 2231new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 2252new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 2273new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 2294new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 2315new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 2336new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive }, 2357new DirectiveInfo { Kind = SyntaxKind.RegionDirectiveTrivia, Status = NodeStatus.IsActive },
Syntax\SyntaxNodeTests.cs (5)
380testContainsHelper1("#region\r\n#endregion", SyntaxKind.RegionDirectiveTrivia, SyntaxKind.EndRegionDirectiveTrivia); 385testContainsHelper1("#region enable", SyntaxKind.RegionDirectiveTrivia); 1718Assert.Equal(SyntaxKind.RegionDirectiveTrivia, d.Kind()); 1722Assert.Equal(SyntaxKind.RegionDirectiveTrivia, related[0].Kind()); 1743Assert.Equal(SyntaxKind.RegionDirectiveTrivia, related[0].Kind());
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
Classification\Worker.cs (1)
240case SyntaxKind.RegionDirectiveTrivia:
Classification\Worker_Preprocesser.cs (1)
33case SyntaxKind.RegionDirectiveTrivia:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DirectiveSyntaxExtensions.cs (1)
64=> directive?.Kind() is SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
554if (trivia.GetStructure() is (kind: SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia or SyntaxKind.IfDirectiveTrivia or SyntaxKind.EndIfDirectiveTrivia))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (1)
100if (trivia2.Kind() is SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (2)
65if (trivia.Kind() == SyntaxKind.RegionDirectiveTrivia || 226if (trivia.Kind() is not SyntaxKind.RegionDirectiveTrivia and
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
39public int RegionDirectiveTrivia => (int)SyntaxKind.RegionDirectiveTrivia;