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