153 references to AnonymousFunctionExpressionSyntax
Microsoft.CodeAnalysis.CSharp (22)
Binder\Binder.IdentifierUsedAsValueFinder.cs (3)
41case AnonymousFunctionExpressionSyntax lambdaSyntax: 150case AnonymousFunctionExpressionSyntax: 171private bool CheckLambda(AnonymousFunctionExpressionSyntax lambdaSyntax, Binder enclosingBinder)
Binder\Binder_Expressions.cs (1)
596return BindAnonymousFunction((AnonymousFunctionExpressionSyntax)node, diagnostics);
Binder\Binder_Lambda.cs (3)
37AnonymousFunctionExpressionSyntax syntax, BindingDiagnosticBag diagnostics) 263static void checkAttributes(AnonymousFunctionExpressionSyntax syntax, SyntaxList<AttributeListSyntax> attributeLists, BindingDiagnosticBag diagnostics) 346private UnboundLambda BindAnonymousFunction(AnonymousFunctionExpressionSyntax syntax, BindingDiagnosticBag diagnostics)
Compilation\PublicSemanticModel.cs (1)
45AnonymousFunctionExpressionSyntax anonymousFunction => GetSymbolInfo(anonymousFunction).Symbol.GetSymbol(),
Lowering\ClosureConversion\ClosureConversion.cs (1)
1448if (syntax is AnonymousFunctionExpressionSyntax anonymousFunction)
Syntax\AnonymousFunctionExpressionSyntax.cs (3)
17public AnonymousFunctionExpressionSyntax WithBody(CSharpSyntaxNode body) 24public AnonymousFunctionExpressionSyntax WithAsyncKeyword(SyntaxToken asyncKeyword) 27internal abstract AnonymousFunctionExpressionSyntax WithAsyncKeywordCore(SyntaxToken asyncKeyword);
Syntax\AnonymousMethodExpressionSyntax.cs (1)
27internal override AnonymousFunctionExpressionSyntax WithAsyncKeywordCore(SyntaxToken asyncKeyword) => WithAsyncKeyword(asyncKeyword);
Syntax\LambdaUtilities.cs (5)
80return ((AnonymousFunctionExpressionSyntax)newLambda).Body; 126AnonymousFunctionExpressionSyntax anonymousFunctionExpressionSyntax => anonymousFunctionExpressionSyntax.Body, 152var anonymousFunction = (AnonymousFunctionExpressionSyntax)parent; 293lambdaBody1 = ((AnonymousFunctionExpressionSyntax)node).Body;
Syntax\ParenthesizedLambdaExpressionSyntax.cs (1)
24internal override AnonymousFunctionExpressionSyntax WithAsyncKeywordCore(SyntaxToken asyncKeyword)
Syntax\SimpleLambdaExpressionSyntax.cs (1)
24internal override AnonymousFunctionExpressionSyntax WithAsyncKeywordCore(SyntaxToken asyncKeyword)
Syntax\SyntaxNodeExtensions.cs (1)
188=> ((AnonymousFunctionExpressionSyntax)lambda).Body;
Syntax\SyntaxNormalizer.cs (1)
370currentTokenParent?.Parent is AnonymousFunctionExpressionSyntax ||
Microsoft.CodeAnalysis.CSharp.CodeStyle (27)
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
300if (initializer is AnonymousFunctionExpressionSyntax)
src\Analyzers\CSharp\Analyzers\MakeAnonymousFunctionStatic\MakeAnonymousFunctionStaticDiagnosticAnalyzer.cs (2)
45var anonymousFunction = (AnonymousFunctionExpressionSyntax)context.Node;
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
116AnonymousFunctionExpressionSyntax)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (5)
73var anonymousFunction = (AnonymousFunctionExpressionSyntax)context.Node; 187n => n is BlockSyntax or ArrowExpressionClauseSyntax or AnonymousFunctionExpressionSyntax or GlobalStatementSyntax); 291private static SeparatedSyntaxList<ParameterSyntax> GetParameters(AnonymousFunctionExpressionSyntax expression) 301AnonymousFunctionExpressionSyntax anonymousFunction,
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (7)
84var anonymousFunction = (AnonymousFunctionExpressionSyntax)syntaxContext.Node; 194AnonymousFunctionExpressionSyntax anonymousFunction, 210AnonymousFunctionExpressionSyntax anonymousFunction, 238AnonymousFunctionExpressionSyntax anonymousFunction, out ImmutableArray<Location> referenceLocations, CancellationToken cancellationToken) 321AnonymousFunctionExpressionSyntax anonymousFunction, 348AnonymousFunctionExpressionSyntax anonymousFunction,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (4)
280=> node is MethodDeclarationSyntax or AnonymousFunctionExpressionSyntax or LocalFunctionStatementSyntax; 346case AnonymousFunctionExpressionSyntax anonymousFunction when anonymousFunction.Modifiers.Any(SyntaxKind.StaticKeyword): 741AnonymousFunctionExpressionSyntax anonymous => anonymous.Modifiers, 754AnonymousFunctionExpressionSyntax anonymous => anonymous.WithModifiers(modifiers),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
212if (node is AnonymousFunctionExpressionSyntax or LocalFunctionStatementSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
318AnonymousFunctionExpressionSyntax anonymous => anonymous.Modifiers,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1539=> node is AnonymousFunctionExpressionSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
334var isAnonymousFunctionCast = castedExpressionNode.WalkDownParentheses() is AnonymousFunctionExpressionSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
696if (originalIsOrAsExpression.Left.WalkDownParentheses() is not AnonymousFunctionExpressionSyntax && 697newIsOrAsExpression.Left.WalkDownParentheses() is AnonymousFunctionExpressionSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
136.DescendantNodesAndSelf(descendIntoChildren: node => node is not AnonymousFunctionExpressionSyntax)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (22)
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (3)
80AnonymousFunctionExpressionSyntax anonymous => FixAnonymousFunction(anonymous), 188private static AnonymousFunctionExpressionSyntax FixAnonymousFunction(AnonymousFunctionExpressionSyntax anonymous)
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\CSharpRemoveAsyncModifierCodeFixProvider.cs (1)
43AnonymousFunctionExpressionSyntax anonymousFunction => anonymousFunction.WithBody(block).WithExpressionBody(null),
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs (1)
47if (current is AnonymousFunctionExpressionSyntax anonymousFunction &&
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (8)
59AnonymousFunctionExpressionSyntax function, 67var anonymousFunction = (AnonymousFunctionExpressionSyntax)diagnostic.AdditionalLocations[1].FindNode(cancellationToken); 106var currentAnonymousFunction = currentRoot.GetCurrentNode(anonymousFunction); 154LocalDeclarationStatementSyntax localDeclaration, AnonymousFunctionExpressionSyntax anonymousFunction, 199AnonymousFunctionExpressionSyntax anonymousFunction, 240SyntaxGenerator generator, AnonymousFunctionExpressionSyntax anonymousFunction, IMethodSymbol delegateMethod) 269private static ParameterListSyntax TryGetOrCreateParameterList(AnonymousFunctionExpressionSyntax anonymousFunction)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (3)
494else if (destinationMember is AnonymousFunctionExpressionSyntax anonymousFunctionSyntax) 610TDeclarationNode destinationMember, IEnumerable<SyntaxNode> statements, AnonymousFunctionExpressionSyntax anonymousFunctionSyntax) where TDeclarationNode : SyntaxNode 627var finalMember = anonymousFunctionSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (1)
251isConflicting = node.HasAncestor<AnonymousFunctionExpressionSyntax>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
495if (node is AnonymousFunctionExpressionSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2834if (expression is AnonymousFunctionExpressionSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
34return node is AnonymousFunctionExpressionSyntax or
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
1597private IEnumerable<TypeInferenceInfo> InferTypeInAnonymousFunctionExpression(AnonymousFunctionExpressionSyntax anonymousFunction) 2014return ancestor is AnonymousFunctionExpressionSyntax anonymousFunction
Microsoft.CodeAnalysis.CSharp.Features (51)
CodeRefactorings\AddAwait\CSharpAddAwaitCodeRefactoringProvider.cs (1)
36case AnonymousFunctionExpressionSyntax anonymousFunction:
Completion\KeywordRecommenders\BreakKeywordRecommender.cs (1)
39if (v is AnonymousFunctionExpressionSyntax)
Completion\KeywordRecommenders\ContinueKeywordRecommender.cs (1)
32if (v is AnonymousFunctionExpressionSyntax)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
393AnonymousFunctionExpressionSyntax lambda => lambda.Body, 1478=> node is AnonymousFunctionExpressionSyntax or LocalFunctionStatementSyntax;
EditAndContinue\SyntaxUtilities.cs (1)
209if (declaration is AnonymousFunctionExpressionSyntax anonymousFunction)
ExtractMethod\CSharpMethodExtractor.cs (1)
62if (currentNode is AnonymousFunctionExpressionSyntax anonymousFunction)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
733AnonymousFunctionExpressionSyntax _ => true,
ExtractMethod\CSharpSelectionResult.StatementResult.cs (1)
91case AnonymousFunctionExpressionSyntax function:
ExtractMethod\CSharpSelectionValidator.cs (1)
116if (ancestor is AnonymousFunctionExpressionSyntax)
Highlighting\KeywordHighlighters\AsyncAwaitHighlighter.cs (1)
74AnonymousFunctionExpressionSyntax anonymousFunction => TryAddAsyncOrAwaitKeyword(anonymousFunction.AsyncKeyword, spans),
InitializeParameter\InitializeParameterHelpers.cs (3)
29or AnonymousFunctionExpressionSyntax; 36AnonymousFunctionExpressionSyntax anonymousFunction => anonymousFunction.Body, 45AnonymousFunctionExpressionSyntax _ => null,
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (2)
74case AnonymousFunctionExpressionSyntax: 100AnonymousFunctionExpressionSyntax
LanguageServices\CSharpSymbolDisplayService.SymbolDescriptionBuilder.cs (1)
199if (syntax.IsKind(SyntaxKind.LocalFunctionStatement) || syntax is AnonymousFunctionExpressionSyntax)
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
300if (initializer is AnonymousFunctionExpressionSyntax)
src\Analyzers\CSharp\Analyzers\MakeAnonymousFunctionStatic\MakeAnonymousFunctionStaticDiagnosticAnalyzer.cs (2)
45var anonymousFunction = (AnonymousFunctionExpressionSyntax)context.Node;
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
116AnonymousFunctionExpressionSyntax)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (5)
73var anonymousFunction = (AnonymousFunctionExpressionSyntax)context.Node; 187n => n is BlockSyntax or ArrowExpressionClauseSyntax or AnonymousFunctionExpressionSyntax or GlobalStatementSyntax); 291private static SeparatedSyntaxList<ParameterSyntax> GetParameters(AnonymousFunctionExpressionSyntax expression) 301AnonymousFunctionExpressionSyntax anonymousFunction,
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (7)
84var anonymousFunction = (AnonymousFunctionExpressionSyntax)syntaxContext.Node; 194AnonymousFunctionExpressionSyntax anonymousFunction, 210AnonymousFunctionExpressionSyntax anonymousFunction, 238AnonymousFunctionExpressionSyntax anonymousFunction, out ImmutableArray<Location> referenceLocations, CancellationToken cancellationToken) 321AnonymousFunctionExpressionSyntax anonymousFunction, 348AnonymousFunctionExpressionSyntax anonymousFunction,
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (3)
80AnonymousFunctionExpressionSyntax anonymous => FixAnonymousFunction(anonymous), 188private static AnonymousFunctionExpressionSyntax FixAnonymousFunction(AnonymousFunctionExpressionSyntax anonymous)
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\CSharpRemoveAsyncModifierCodeFixProvider.cs (1)
43AnonymousFunctionExpressionSyntax anonymousFunction => anonymousFunction.WithBody(block).WithExpressionBody(null),
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs (1)
47if (current is AnonymousFunctionExpressionSyntax anonymousFunction &&
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (8)
59AnonymousFunctionExpressionSyntax function, 67var anonymousFunction = (AnonymousFunctionExpressionSyntax)diagnostic.AdditionalLocations[1].FindNode(cancellationToken); 106var currentAnonymousFunction = currentRoot.GetCurrentNode(anonymousFunction); 154LocalDeclarationStatementSyntax localDeclaration, AnonymousFunctionExpressionSyntax anonymousFunction, 199AnonymousFunctionExpressionSyntax anonymousFunction, 240SyntaxGenerator generator, AnonymousFunctionExpressionSyntax anonymousFunction, IMethodSymbol delegateMethod) 269private static ParameterListSyntax TryGetOrCreateParameterList(AnonymousFunctionExpressionSyntax anonymousFunction)
src\Compilers\CSharp\Portable\Syntax\LambdaUtilities.cs (5)
80return ((AnonymousFunctionExpressionSyntax)newLambda).Body; 126AnonymousFunctionExpressionSyntax anonymousFunctionExpressionSyntax => anonymousFunctionExpressionSyntax.Body, 152var anonymousFunction = (AnonymousFunctionExpressionSyntax)parent; 293lambdaBody1 = ((AnonymousFunctionExpressionSyntax)node).Body;
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
EditAndContinue\SyntaxUtilitiesTests.cs (2)
198var l3 = m3.DescendantNodes().OfType<VariableDeclaratorSyntax>().Single(m => m.Identifier.ValueText == "l3").Initializer. 199DescendantNodes().OfType<AnonymousFunctionExpressionSyntax>().Single();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (6)
Semantics\DelegateTypeTests.cs (6)
895var expr = tree.GetRoot().DescendantNodes().OfType<AnonymousFunctionExpressionSyntax>().Single(); 996var expr = tree.GetRoot().DescendantNodes().OfType<AnonymousFunctionExpressionSyntax>().Single(); 8051var expr = tree.GetRoot().DescendantNodes().OfType<AnonymousFunctionExpressionSyntax>().Single();
Microsoft.CodeAnalysis.CSharp.Workspaces (23)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
1659AnonymousFunctionExpressionSyntax anonymous => anonymous.WithModifiers(modifiers),
Recommendations\CSharpRecommendationService.cs (1)
16internal partial class CSharpRecommendationService : AbstractRecommendationService<CSharpSyntaxContext, AnonymousFunctionExpressionSyntax>
Recommendations\CSharpRecommendationServiceRunner.cs (1)
37protected override int GetLambdaParameterCount(AnonymousFunctionExpressionSyntax lambdaSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (4)
280=> node is MethodDeclarationSyntax or AnonymousFunctionExpressionSyntax or LocalFunctionStatementSyntax; 346case AnonymousFunctionExpressionSyntax anonymousFunction when anonymousFunction.Modifiers.Any(SyntaxKind.StaticKeyword): 741AnonymousFunctionExpressionSyntax anonymous => anonymous.Modifiers, 754AnonymousFunctionExpressionSyntax anonymous => anonymous.WithModifiers(modifiers),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
212if (node is AnonymousFunctionExpressionSyntax or LocalFunctionStatementSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
318AnonymousFunctionExpressionSyntax anonymous => anonymous.Modifiers,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1539=> node is AnonymousFunctionExpressionSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
334var isAnonymousFunctionCast = castedExpressionNode.WalkDownParentheses() is AnonymousFunctionExpressionSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
696if (originalIsOrAsExpression.Left.WalkDownParentheses() is not AnonymousFunctionExpressionSyntax && 697newIsOrAsExpression.Left.WalkDownParentheses() is AnonymousFunctionExpressionSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
136.DescendantNodesAndSelf(descendIntoChildren: node => node is not AnonymousFunctionExpressionSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (3)
494else if (destinationMember is AnonymousFunctionExpressionSyntax anonymousFunctionSyntax) 610TDeclarationNode destinationMember, IEnumerable<SyntaxNode> statements, AnonymousFunctionExpressionSyntax anonymousFunctionSyntax) where TDeclarationNode : SyntaxNode 627var finalMember = anonymousFunctionSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (1)
251isConflicting = node.HasAncestor<AnonymousFunctionExpressionSyntax>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
495if (node is AnonymousFunctionExpressionSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2834if (expression is AnonymousFunctionExpressionSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
34return node is AnonymousFunctionExpressionSyntax or
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
1597private IEnumerable<TypeInferenceInfo> InferTypeInAnonymousFunctionExpression(AnonymousFunctionExpressionSyntax anonymousFunction) 2014return ancestor is AnonymousFunctionExpressionSyntax anonymousFunction