7 references to GetAncestorsOrThis
Microsoft.CodeAnalysis.CSharp.Features (2)
CSharpInlineDeclarationCodeFixProvider.cs (1)
388return expression.GetAncestorsOrThis(
CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (1)
59=> declarationSyntax.GetAncestorsOrThis(n => n.IsKind(SyntaxKind.FieldDeclaration) && n.Contains(node)).Any();
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
Rename\CSharpRenameRewriterLanguageService.cs (3)
161var lambdas = node.GetAncestorsOrThis(n => n is SimpleLambdaExpressionSyntax or ParenthesizedLambdaExpressionSyntax); 301var expandParameter = originalNode.GetAncestorsOrThis(n => n is SimpleLambdaExpressionSyntax or ParenthesizedLambdaExpressionSyntax).Count() == 0; 1257var nodeToSpeculate = node.GetAncestorsOrThis(n => SpeculationAnalyzer.CanSpeculateOnNode(n)).LastOrDefault();
Simplification\Reducers\CSharpEscapingReducer.cs (2)
56var enclosingLambdaExpression = parent.GetAncestorsOrThis(n => (n is SimpleLambdaExpressionSyntax or ParenthesizedLambdaExpressionSyntax)).FirstOrDefault(); 76var enclosingMethodBlock = parent.GetAncestorsOrThis(n => n is MethodDeclarationSyntax).FirstOrDefault();