6 references to GetAncestor
Microsoft.CodeAnalysis.Workspaces (6)
Recommendations\AbstractRecommendationServiceRunner.cs (1)
274var declarationSyntax = _context.TargetToken.GetAncestor<TNamespaceDeclarationSyntax>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (2)
16=> token.GetAncestor<SyntaxNode>(predicate); 22=> GetAncestor(token, predicate) ?? throw new InvalidOperationException("Could not find a valid ancestor");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (2)
74var nodeToRightOrIn = tokenToRightOrIn.GetAncestor<TNode>(); 86return tokenToRightOrIn.GetPreviousToken().GetAncestor<TNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
108let statement = token.GetAncestor<TStatementSyntax>()