326 references to GetStructure
Microsoft.Analyzers.Local (1)
InternalReferencedInPublicDocAnalyzer.cs (1)
43.Select(trivia => trivia.GetStructure())
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\Infrastructure\SyntaxNodeExtensions.cs (1)
134if (trivia.GetStructure() is ISkippedTokensTriviaSyntax skippedTokensTrivia)
Microsoft.CodeAnalysis (6)
Syntax\SyntaxNode.cs (3)
1137node = trivia.GetStructure()!; 1156node = trivia.GetStructure()!; 1524token = trivia.GetStructure()!.FindTokenInternal(position);
Syntax\SyntaxNodeOrToken.cs (1)
882if (trivia.GetStructure() is TDirective directive &&
Syntax\SyntaxTrivia.cs (1)
214structure = GetStructure();
Syntax\SyntaxWalker.cs (1)
102this.Visit(trivia.GetStructure()!);
Microsoft.CodeAnalysis.CodeStyle (14)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
682documentationComments.AddIfNotNull(trivia.GetStructure() as TDocumentationCommentTriviaSyntax);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (6)
551if (trivia.GetStructure() is ISkippedTokensTriviaSyntax skippedTokensTrivia) 581if (trivia.GetStructure() is ISkippedTokensTriviaSyntax skippedTokensTrivia) 878regionStack.Push((TDirectiveTriviaSyntax)trivia.GetStructure()!); 884ifStack.Push((TDirectiveTriviaSyntax)trivia.GetStructure()!); 890var directive = (TDirectiveTriviaSyntax)trivia.GetStructure()!; 900FinishIf((TDirectiveTriviaSyntax)trivia.GetStructure()!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
151var token = trivia.GetStructure()!.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.StructuredTrivia.cs (3)
20: base(trivia.GetStructure()!) 26var root = trivia.GetStructure()!; 50var root = _trivia.GetStructure()!;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (2)
473var lastToken = trivia1.GetStructure()!.GetLastToken(includeZeroWidth: true); 487var firstToken = trivia2.GetStructure()!.GetFirstToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
130if (!IsOnSingleLine(syntaxFacts, trivia.GetStructure()!, fullSpan: true))
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (1)
85node = editor.OriginalRoot.FindTrivia(location.SourceSpan.Start).GetStructure()!;
Microsoft.CodeAnalysis.CSharp (14)
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (1)
624DocumentationCommentTriviaSyntax structure = (DocumentationCommentTriviaSyntax)trivia.GetStructure();
DocumentationComments\SourceDocumentationCommentUtils.cs (1)
91builder.Add((DocumentationCommentTriviaSyntax)trivia.GetStructure());
Syntax\CompilationUnitSyntax.cs (1)
61if (trivia.GetStructure() is { } structure &&
Syntax\CSharpSyntaxNode.cs (3)
253var d = (DirectiveTriviaSyntax)tr.GetStructure()!; 293var d = (DirectiveTriviaSyntax)tr.GetStructure()!; 391SyntaxToken triviaToken = ((CSharpSyntaxNode)trivia.GetStructure()!).FindTokenInternal(position);
Syntax\CSharpSyntaxRewriter.cs (1)
121var structure = (CSharpSyntaxNode)trivia.GetStructure()!;
Syntax\CSharpSyntaxWalker.cs (1)
99this.Visit((CSharpSyntaxNode)trivia.GetStructure()!);
Syntax\DirectiveTriviaSyntax.cs (2)
77var d = (DirectiveTriviaSyntax)tr.GetStructure()!; 108var d = (DirectiveTriviaSyntax)tr.GetStructure()!;
Syntax\SyntaxFactory.cs (1)
1625DocumentationCommentTriviaSyntax structure = (DocumentationCommentTriviaSyntax)trivia.GetStructure()!;
Syntax\SyntaxNodeRemover.cs (2)
145if (trivia.IsDirective && trivia.GetStructure() is DirectiveTriviaSyntax directive) 436.Select(tr => (DirectiveTriviaSyntax)tr.GetStructure()!);
Syntax\SyntaxNormalizer.cs (1)
1242var node = trivia.GetStructure()!;
Microsoft.CodeAnalysis.CSharp.CodeStyle (17)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
95var directive = trivia.GetStructure()!;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
160if (whenTrue.GetLeadingTrivia().Any(static t => t.GetStructure() is ConditionalDirectiveTriviaSyntax))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (3)
47=> trivia.GetStructure() is ConditionalDirectiveTriviaSyntax; 68var firstDirective = (DirectiveTriviaSyntax)leadingDirectives.First().GetStructure()!; 105if (!conditionalDirectives.Contains((DirectiveTriviaSyntax)closeBraceDirective.GetStructure()!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (3)
553var structure = trivia.GetStructure()!; 554if (trivia.GetStructure() is (kind: SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia or SyntaxKind.IfDirectiveTrivia or SyntaxKind.EndIfDirectiveTrivia)) 568else if (trivia.GetStructure() is (kind: SyntaxKind.ElseDirectiveTrivia or SyntaxKind.ElifDirectiveTrivia))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
198var endsWithNewLine = trivia.GetStructure()!.GetLastToken(includeSkipped: true).Kind() == SyntaxKind.XmlTextLiteralNewLineToken;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
205var pragmaWarning = (PragmaWarningDirectiveTriviaSyntax)trivia.GetStructure();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\CSharpStructuredTriviaFormatEngine.cs (1)
23var root = trivia.GetStructure() ?? throw new ArgumentException();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (2)
123else if (previous.HasStructure && previous.GetStructure() is BranchingDirectiveTriviaSyntax branchingDirectiveTrivia) 184var structuredTrivia = trivia.GetStructure();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (2)
110if (trivia.GetStructure() is { ContainsAnnotations: true } structure) 327var xmlComment = (DocumentationCommentTriviaSyntax)trivia.GetStructure()!;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
312ProcessStructuredTrivia(list, trivia.GetStructure()!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1432if (trivia.GetStructure() is DocumentationCommentTriviaSyntax documentationCommentTrivia)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (1)
46var nodeStructure = node.GetStructure()!;
src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
55var structure = (SkippedTokensTriviaSyntax)firstTrivia.GetStructure()!;
src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (1)
49var structure = (SkippedTokensTriviaSyntax)skippedTrivia.GetStructure()!;
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
509=> memberDeclaration.GetLeadingTrivia().Any(t => t.GetStructure()?.Kind() == SyntaxKind.PragmaWarningDirectiveTrivia)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (1)
47=> (DocumentationCommentTriviaSyntax?)trivia.GetStructure();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
116var syntax = (SkippedTokensTriviaSyntax?)skippedTokensTrivia.GetStructure();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (5)
Emit\NumericIntPtrTests.cs (5)
11172var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 11195var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 11223var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 11248var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 11293var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (5)
RefReadonlyParameterTests.cs (2)
7102var docComment = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().Single(); 7130var docComment = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().Single();
Semantics\PrimaryConstructorTests.cs (1)
6090var doc = tree.GetRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().Single();
Semantics\RecordTests.cs (2)
28186var doc = tree.GetRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().First(); 28343var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
Microsoft.CodeAnalysis.CSharp.Features (12)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (2)
226var pragmaWarning = (PragmaWarningDirectiveTriviaSyntax)trivia.GetStructure(); 239var pragmaWarning = (PragmaWarningDirectiveTriviaSyntax)trivia.GetStructure();
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider_DocumentationComments.cs (1)
23=> (DocumentationCommentTriviaSyntax?)trivia.GetStructure();
DocumentationComments\DocCommentConverter.cs (1)
56var structuredTrivia = (DocumentationCommentTriviaSyntax)trivia.GetStructure();
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (1)
250var structure = trivia.GetStructure();
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
95var directive = trivia.GetStructure()!;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
160if (whenTrue.GetLeadingTrivia().Any(static t => t.GetStructure() is ConditionalDirectiveTriviaSyntax))
src\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (1)
46var nodeStructure = node.GetStructure()!;
src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
55var structure = (SkippedTokensTriviaSyntax)firstTrivia.GetStructure()!;
src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (1)
49var structure = (SkippedTokensTriviaSyntax)skippedTrivia.GetStructure()!;
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
509=> memberDeclaration.GetLeadingTrivia().Any(t => t.GetStructure()?.Kind() == SyntaxKind.PragmaWarningDirectiveTrivia)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (1)
47=> (DocumentationCommentTriviaSyntax?)trivia.GetStructure();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (10)
Semantics\NativeIntegerTests.cs (6)
15316var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 15337var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 15360var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 15388var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 15411var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 15441var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
Semantics\RecordStructTests.cs (4)
3242var doc = tree.GetRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().Single(); 3284var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 3332var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 3383var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
DocumentationComments\CrefTests.cs (1)
6618var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
DocumentationComments\ParameterTests.cs (1)
841var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (128)
LexicalAndXml\SyntaxTokenParserTests.cs (1)
87Assert.NotNull(docCommentTrivia.GetStructure());
LexicalAndXml\XmlDocCommentTests.cs (106)
85var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 154var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 175var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 200var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 222var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 245var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 268var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 295var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 323var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 347var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 372var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 398var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 425var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 452var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 480var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 509var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 539var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 568var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 598var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 629var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 652var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 674var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 696var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 718var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 740var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 760var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 794var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 827var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 858var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 886var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 911var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 937var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 962var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 989var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1020var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1048var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1073var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1098var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1125var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1158var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1189var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1215var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1242var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1270var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1315var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1339var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1364var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1388var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1413var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1437var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1462var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1486var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1566var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1594var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1622var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1648var doc = (DocumentationCommentTriviaSyntax)node.GetStructure(); 1723Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[2].GetStructure().GetType()); 1724var doc = trivias[2].GetStructure() as DocumentationCommentTriviaSyntax; 1757Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 1758Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[3].GetStructure().GetType()); 1761var firstComment = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 1762var secondComment = trivias[3].GetStructure() as DocumentationCommentTriviaSyntax; 1799Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 1800Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[3].GetStructure().GetType()); 1803var firstComment = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 1804var secondComment = trivias[3].GetStructure() as DocumentationCommentTriviaSyntax; 1842Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 1845var firstComment = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 1877Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 1880var firstComment = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 1912Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 1915var firstComment = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 1947Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 1950var firstComment = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 1984Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 1987var firstComment = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 2020Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 2023var firstComment = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 2058Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 2061var firstComment = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 2090Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 2093var firstComment = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 2124Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 2127var firstComment = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 2155Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 2158var firstComment = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 2185Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[2].GetStructure().GetType()); 2188var firstComment = trivias[2].GetStructure() as DocumentationCommentTriviaSyntax; 2217Assert.Equal(typeof(DocumentationCommentTriviaSyntax), trivias[0].GetStructure().GetType()); 2220var outerComment = (trivias[0].GetStructure() as DocumentationCommentTriviaSyntax).Content[1] as XmlElementSyntax; 2264VerifyXmlElement((trivias[0].GetStructure() as DocumentationCommentTriviaSyntax).Content[0] as XmlElementSyntax, "goo", " "); 2266VerifyXmlAttributes(((trivias[0].GetStructure() as DocumentationCommentTriviaSyntax).Content[0] as XmlElementSyntax).StartTag.Attributes, 2291var doc = topTrivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 2331var doc = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 2387var doc = classKeyword.GetLeadingTrivia()[0].GetStructure() as DocumentationCommentTriviaSyntax; 2417var doc = classKeyword.GetLeadingTrivia()[0].GetStructure() as DocumentationCommentTriviaSyntax; 2445var doc = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 2471var doc = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 2498var doc = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 2523var doc = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 2545var doc = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 2571var doc = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 2639var doc = classKeyword.GetLeadingTrivia()[0].GetStructure() as DocumentationCommentTriviaSyntax; 2657var doc = classKeyword.GetLeadingTrivia()[0].GetStructure() as DocumentationCommentTriviaSyntax; 2747var doc = trivias[0].GetStructure() as DocumentationCommentTriviaSyntax; 2771var doc = trivias[1].GetStructure() as DocumentationCommentTriviaSyntax;
ParentChecker.cs (4)
32var parentTrivia = trivia.GetStructure().Parent; 34CheckParents((CSharpSyntaxNode)trivia.GetStructure(), expectedSyntaxTree); 45var parentTrivia = trivia.GetStructure().Parent; 47CheckParents(trivia.GetStructure(), expectedSyntaxTree);
Parsing\CrefParsingTests.cs (1)
30var structure = (DocumentationCommentTriviaSyntax)trivia.GetStructure();
Parsing\NameAttributeValueParsingTests.cs (1)
31var structure = (DocumentationCommentTriviaSyntax)trivia.GetStructure();
Parsing\ScriptParsingTests.cs (1)
9728TestShebang((ShebangDirectiveTriviaSyntax)trivia.GetStructure(), expectedSkippedText);
Parsing\VerbatimCrefParsingTests.cs (1)
30var structure = (DocumentationCommentTriviaSyntax)trivia.GetStructure();
Syntax\StructuredTriviaTests.cs (1)
25var structuredTrivia = trivia1.GetStructure() as IfDirectiveTriviaSyntax;
Syntax\SyntaxNodeTests.cs (12)
1357Assert.NotNull(trivia.GetStructure()); 1358Assert.Null(trivia.GetStructure().Parent); 1368Assert.NotNull(trivia.GetStructure()); 1369var parentTrivia = trivia.GetStructure().ParentTrivia; 1383var structure = trivia.GetStructure(); 1391var tokenStructuredTrivia = tokenTrivia.GetStructure(); 1490var firstDirective = Assert.IsType<RegionDirectiveTriviaSyntax>(leadingTriviaWithDuplicate[0].GetStructure()); 1491var secondDirective = Assert.IsType<RegionDirectiveTriviaSyntax>(leadingTriviaWithDuplicate[1].GetStructure()); 1962var str0 = tt0.GetStructure(); 1963var str1 = tt1.GetStructure(); 1999var str0 = tt0.GetStructure(); 2000var str1 = tt1.GetStructure();
Microsoft.CodeAnalysis.CSharp.Workspaces (20)
Classification\Worker.cs (3)
220ClassifySkippedTokens((SkippedTokensTriviaSyntax)trivia.GetStructure()!); 225ClassifyDocumentationComment((DocumentationCommentTriviaSyntax)trivia.GetStructure()!); 254ClassifyPreprocessorDirective((DirectiveTriviaSyntax)trivia.GetStructure()!);
CodeGeneration\CSharpSyntaxGenerator.cs (1)
93if (trivia.GetStructure() is DocumentationCommentTriviaSyntax documentationCommentTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (3)
47=> trivia.GetStructure() is ConditionalDirectiveTriviaSyntax; 68var firstDirective = (DirectiveTriviaSyntax)leadingDirectives.First().GetStructure()!; 105if (!conditionalDirectives.Contains((DirectiveTriviaSyntax)closeBraceDirective.GetStructure()!))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (3)
553var structure = trivia.GetStructure()!; 554if (trivia.GetStructure() is (kind: SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia or SyntaxKind.IfDirectiveTrivia or SyntaxKind.EndIfDirectiveTrivia)) 568else if (trivia.GetStructure() is (kind: SyntaxKind.ElseDirectiveTrivia or SyntaxKind.ElifDirectiveTrivia))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
198var endsWithNewLine = trivia.GetStructure()!.GetLastToken(includeSkipped: true).Kind() == SyntaxKind.XmlTextLiteralNewLineToken;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
205var pragmaWarning = (PragmaWarningDirectiveTriviaSyntax)trivia.GetStructure();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\CSharpStructuredTriviaFormatEngine.cs (1)
23var root = trivia.GetStructure() ?? throw new ArgumentException();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (2)
123else if (previous.HasStructure && previous.GetStructure() is BranchingDirectiveTriviaSyntax branchingDirectiveTrivia) 184var structuredTrivia = trivia.GetStructure();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (2)
110if (trivia.GetStructure() is { ContainsAnnotations: true } structure) 327var xmlComment = (DocumentationCommentTriviaSyntax)trivia.GetStructure()!;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
312ProcessStructuredTrivia(list, trivia.GetStructure()!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1432if (trivia.GetStructure() is DocumentationCommentTriviaSyntax documentationCommentTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
116var syntax = (SkippedTokensTriviaSyntax?)skippedTokensTrivia.GetStructure();
Microsoft.CodeAnalysis.Features (8)
ChangeSignature\AbstractChangeSignatureService.cs (1)
986var structuredTrivia = trivia.GetStructure();
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (3)
139(trivia.HasStructure && fixer.IsEndOfLine(trivia.GetStructure().DescendantTrivia().FirstOrDefault())); 145(trivia.HasStructure && fixer.IsEndOfLine(trivia.GetStructure().DescendantTrivia().LastOrDefault())); 151(trivia.HasStructure && trivia.GetStructure().DescendantTrivia().Any(fixer.IsEndOfLine));
EmbeddedLanguages\Classification\AbstractEmbeddedLanguageClassificationService.cs (1)
156VisitTokens(trivia.GetStructure()!);
SpellCheck\AbstractSpellCheckSpanService.cs (1)
255ProcessDocComment(trivia.GetStructure()!, cancellationToken);
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
682documentationComments.AddIfNotNull(trivia.GetStructure() as TDocumentationCommentTriviaSyntax);
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (1)
85node = editor.OriginalRoot.FindTrivia(location.SourceSpan.Start).GetStructure()!;
Microsoft.CodeAnalysis.Test.Utilities (1)
Syntax\XmlHelpers.cs (1)
248retVal.Add(trivia.GetStructure().ToXml(syntaxTree, options));
Microsoft.CodeAnalysis.VisualBasic (11)
Compilation\DocumentationComments\DocumentationCommentCompiler.Common.vb (1)
689theOnlyDocCommentTrivia = DirectCast(trivia.GetStructure(), DocumentationCommentTriviaSyntax)
Syntax\SyntaxNodePartials.vb (2)
36Dim d As DirectiveTriviaSyntax = DirectCast(tr.GetStructure, DirectiveTriviaSyntax) 60Dim d As DirectiveTriviaSyntax = DirectCast(tr.GetStructure, DirectiveTriviaSyntax)
Syntax\SyntaxNodeRemover.vb (1)
308.Select(Function(tr) DirectCast(tr.GetStructure(), DirectiveTriviaSyntax))
Syntax\SyntaxNormalizer.vb (2)
629If trivia.GetStructure.GetLastToken.HasTrailingTrivia AndAlso 630trivia.GetStructure.GetLastToken.TrailingTrivia.Last.Kind = SyntaxKind.EndOfLineTrivia Then
Syntax\VisualBasicSyntaxNode.vb (3)
254stack.Push(DirectCast(n.GetStructure, VisualBasicSyntaxNode)) 347Dim d As DirectiveTriviaSyntax = DirectCast(tr.GetStructure, DirectiveTriviaSyntax) 373Dim d As DirectiveTriviaSyntax = DirectCast(tr.GetStructure, DirectiveTriviaSyntax)
Syntax\VisualBasicSyntaxRewriter.vb (1)
62Dim [structure] = DirectCast(trivia.GetStructure(), VisualBasicSyntaxNode)
Syntax\VisualBasicSyntaxWalker.vb (1)
80Visit(DirectCast(trivia.GetStructure(), VisualBasicSyntaxNode))
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (3)
408If trivia.HasStructure AndAlso TypeOf trivia.GetStructure() Is DirectiveTriviaSyntax Then 409Dim parentSpan = trivia.GetStructure().Span 410Dim directiveSyntax = DirectCast(trivia.GetStructure(), DirectiveTriviaSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTriviaExtensions.vb (2)
47Dim pragmaWarning = DirectCast(trivia.GetStructure(), DisableWarningDirectiveTriviaSyntax) 54Dim pragmaWarning = DirectCast(trivia.GetStructure(), EnableWarningDirectiveTriviaSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (1)
1644Dim documentationCommentTrivia = TryCast(trivia.GetStructure(), DocumentationCommentTriviaSyntax)
src\Workspaces\VisualBasic\Portable\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.vb (1)
285Dim xmlComment = CType(trivia.GetStructure(), DocumentationCommentTriviaSyntax)
src\Workspaces\VisualBasic\Portable\Formatting\Engine\VisualBasicStructuredTriviaFormatEngine.vb (1)
20Dim root = trivia.GetStructure()
Microsoft.CodeAnalysis.VisualBasic.Features (12)
BraceCompletion\BracketBraceCompletionService.vb (1)
64If TypeOf trivia.GetStructure() Is SkippedTokensTriviaSyntax Then
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (4)
224Dim pragmaWarning = DirectCast(trivia.GetStructure(), DisableWarningDirectiveTriviaSyntax) 229Dim pragmaWarning = DirectCast(trivia.GetStructure(), EnableWarningDirectiveTriviaSyntax) 246Dim pragmaWarning = DirectCast(trivia.GetStructure(), DisableWarningDirectiveTriviaSyntax) 255Dim pragmaWarning = DirectCast(trivia.GetStructure(), EnableWarningDirectiveTriviaSyntax)
Completion\KeywordRecommenders\PreprocessorDirectives\PreprocessorHelpers.vb (2)
40Visit(leadingTrivia.GetStructure()) 56Visit(followingTrivia.GetStructure())
MetadataAsSource\VisualBasicMetadataAsSourceService.vb (1)
181Dim structuredTrivia = DirectCast(trivia.GetStructure(), DocumentationCommentTriviaSyntax)
ReplacePropertyWithMethods\VisualBasicReplacePropertyWithMethods.vb (1)
194Dim converted = documentationCommentRewriter.Visit(trivia.GetStructure())
SignatureHelp\AbstractIntrinsicOperatorSignatureHelpProvider.vb (1)
92commaTokens.AddRange(leadingTrivia.GetStructure().ChildTokens().Where(Function(token) token.Kind = SyntaxKind.CommaToken))
TaskList\VisualBasicTaskListService.vb (2)
28Dim commentTrivia = trivia.GetStructure().DescendantTrivia().First(Function(t) t.RawKind = SyntaxKind.CommentTrivia) 106trivia.GetStructure().DescendantTrivia().Any(Function(t) t.RawKind = SyntaxKind.CommentTrivia)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (14)
ParserTestUtilities.vb (14)
134Dim triviaStructure = DirectCast(trivia.GetStructure, VisualBasicSyntaxNode) 150Dim triviaStructure = trivia.GetStructure 417InternalVerifyErrorsOnChildrenAlsoPresentOnParent(tr.GetStructure, tree) 424InternalVerifyErrorsOnChildrenAlsoPresentOnParent(tr.GetStructure, tree) 684Dim leadingTriviaStructure = leadingTrivia.GetStructure 693Dim trailingTriviaStructure = trailingTrivia.GetStructure 711Dim trStructure = tr.GetStructure 717Dim trStructure = tr.GetStructure 754Dim triviaStructure = trivia.GetStructure 787InternalVerifyNoMissingChildren(tr.GetStructure) 792InternalVerifyNoMissingChildren(tr.GetStructure) 809InternalVerifyNoZeroWidthNodes(tr.GetStructure) 815InternalVerifyNoZeroWidthNodes(tr.GetStructure) 836InternalVerifyNoAdjacentTriviaHaveSameKind(tr.GetStructure)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (13)
Classification\Worker.vb (4)
118Select Case trivia.GetStructure().Kind 120_docCommentClassifier.Classify(DirectCast(trivia.GetStructure(), DocumentationCommentTriviaSyntax)) 136ClassifyDirectiveSyntax(DirectCast(trivia.GetStructure(), DirectiveTriviaSyntax)) 138ClassifySkippedTokens(DirectCast(trivia.GetStructure(), SkippedTokensTriviaSyntax))
CodeGeneration\VisualBasicSyntaxGenerator.vb (1)
70Dim documentationCommentTrivia = TryCast(trivia.GetStructure(), DocumentationCommentTriviaSyntax)
Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.vb (1)
285Dim xmlComment = CType(trivia.GetStructure(), DocumentationCommentTriviaSyntax)
Formatting\Engine\VisualBasicStructuredTriviaFormatEngine.vb (1)
20Dim root = trivia.GetStructure()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (3)
408If trivia.HasStructure AndAlso TypeOf trivia.GetStructure() Is DirectiveTriviaSyntax Then 409Dim parentSpan = trivia.GetStructure().Span 410Dim directiveSyntax = DirectCast(trivia.GetStructure(), DirectiveTriviaSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTriviaExtensions.vb (2)
47Dim pragmaWarning = DirectCast(trivia.GetStructure(), DisableWarningDirectiveTriviaSyntax) 54Dim pragmaWarning = DirectCast(trivia.GetStructure(), EnableWarningDirectiveTriviaSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (1)
1644Dim documentationCommentTrivia = TryCast(trivia.GetStructure(), DocumentationCommentTriviaSyntax)
Microsoft.CodeAnalysis.Workspaces (16)
Classification\SyntaxClassification\AbstractSyntaxClassificationService.Worker.cs (1)
176_pendingNodes.Push(trivia.GetStructure());
FindSymbols\FindReferences\FindReferenceCache.cs (1)
181stack.Push(trivia.GetStructure()!);
ObsoleteSymbol\AbstractObsoleteSymbolService.cs (1)
98stack.Add(trivia.GetStructure()!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (6)
551if (trivia.GetStructure() is ISkippedTokensTriviaSyntax skippedTokensTrivia) 581if (trivia.GetStructure() is ISkippedTokensTriviaSyntax skippedTokensTrivia) 878regionStack.Push((TDirectiveTriviaSyntax)trivia.GetStructure()!); 884ifStack.Push((TDirectiveTriviaSyntax)trivia.GetStructure()!); 890var directive = (TDirectiveTriviaSyntax)trivia.GetStructure()!; 900FinishIf((TDirectiveTriviaSyntax)trivia.GetStructure()!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
151var token = trivia.GetStructure()!.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.StructuredTrivia.cs (3)
20: base(trivia.GetStructure()!) 26var root = trivia.GetStructure()!; 50var root = _trivia.GetStructure()!;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (2)
473var lastToken = trivia1.GetStructure()!.GetLastToken(includeZeroWidth: true); 487var firstToken = trivia2.GetStructure()!.GetFirstToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
130if (!IsOnSingleLine(syntaxFacts, trivia.GetStructure()!, fullSpan: true))
Microsoft.VisualStudio.LanguageServices (1)
Extensions\DocumentExtensions.cs (1)
36var directive = trivia.GetStructure();