6 references to GetAncestor
Microsoft.CodeAnalysis.Workspaces (6)
Recommendations\AbstractRecommendationServiceRunner.cs (1)
274
var 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)
74
var nodeToRightOrIn = tokenToRightOrIn.
GetAncestor
<TNode>();
86
return tokenToRightOrIn.GetPreviousToken().
GetAncestor
<TNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
108
let statement = token.
GetAncestor
<TStatementSyntax>()