133 references to SimpleLambdaExpressionSyntax
Microsoft.AspNetCore.App.Analyzers (2)
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (2)
369var lambdaExpression = arguments?.Expression as SimpleLambdaExpressionSyntax;
Microsoft.AspNetCore.App.CodeFixes (1)
Authorization\AddAuthorizationBuilderFixer.cs (1)
62&& arguments[0].Expression is SimpleLambdaExpressionSyntax lambda)
Microsoft.CodeAnalysis.CSharp (23)
Binder\Binder_Expressions.cs (1)
10993resultIsUsed = (((SimpleLambdaExpressionSyntax)parent).Body != node) || MethodOrLambdaRequiresValue(ContainingMemberOrLambda, Compilation);
Binder\Binder_Lambda.cs (2)
71var simple = (SimpleLambdaExpressionSyntax)syntax;
Binder\ExpressionVariableFinder.cs (1)
290public override void VisitSimpleLambdaExpression(SimpleLambdaExpressionSyntax node) { }
Binder\LocalBinderFactory.cs (1)
374public override void VisitSimpleLambdaExpression(SimpleLambdaExpressionSyntax node)
BoundTree\UnboundLambda.cs (1)
1507return ((SimpleLambdaExpressionSyntax)syntax).Parameter.Identifier.GetLocation();
Compilation\MemberSemanticModel.cs (2)
834var simpleLambda = parameter.Parent as SimpleLambdaExpressionSyntax;
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
613var lambdaSyntax = (SimpleLambdaExpressionSyntax)node.Syntax;
Syntax\LookupPosition.cs (2)
483SimpleLambdaExpressionSyntax simple = (SimpleLambdaExpressionSyntax)lambdaExpressionOrQueryNode;
Syntax\SimpleLambdaExpressionSyntax.cs (9)
11public new SimpleLambdaExpressionSyntax WithBody(CSharpSyntaxNode body) 16public SimpleLambdaExpressionSyntax Update(SyntaxToken asyncKeyword, ParameterSyntax parameter, SyntaxToken arrowToken, CSharpSyntaxNode body) 27public new SimpleLambdaExpressionSyntax WithAsyncKeyword(SyntaxToken asyncKeyword) 30public SimpleLambdaExpressionSyntax Update(SyntaxToken asyncKeyword, ParameterSyntax parameter, SyntaxToken arrowToken, BlockSyntax? block, ExpressionSyntax? expressionBody) 33public SimpleLambdaExpressionSyntax Update(SyntaxTokenList modifiers, ParameterSyntax parameter, SyntaxToken arrowToken, BlockSyntax? block, ExpressionSyntax? expressionBody) 42public static SimpleLambdaExpressionSyntax SimpleLambdaExpression(SyntaxToken asyncKeyword, ParameterSyntax parameter, SyntaxToken arrowToken, BlockSyntax? block, ExpressionSyntax? expressionBody) 45public static SimpleLambdaExpressionSyntax SimpleLambdaExpression(ParameterSyntax parameter, BlockSyntax? block, ExpressionSyntax? expressionBody) 48public static SimpleLambdaExpressionSyntax SimpleLambdaExpression(SyntaxTokenList modifiers, ParameterSyntax parameter, SyntaxToken arrowToken, BlockSyntax? block, ExpressionSyntax? expressionBody) 51public static SimpleLambdaExpressionSyntax SimpleLambdaExpression(SyntaxTokenList modifiers, ParameterSyntax parameter, BlockSyntax? block, ExpressionSyntax? expressionBody)
Syntax\SyntaxFactory.cs (2)
2743public static SimpleLambdaExpressionSyntax SimpleLambdaExpression(ParameterSyntax parameter, CSharpSyntaxNode body) 2748public static SimpleLambdaExpressionSyntax SimpleLambdaExpression(SyntaxToken asyncKeyword, ParameterSyntax parameter, SyntaxToken arrowToken, CSharpSyntaxNode body)
Microsoft.CodeAnalysis.CSharp.CodeStyle (6)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
295SimpleLambdaExpressionSyntax simpleLambda => [simpleLambda.Parameter],
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
154case SimpleLambdaExpressionSyntax simpleLambda:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (4)
237var originalSimpleLambda = (SimpleLambdaExpressionSyntax)originalLambda; 238var replacedSimpleLambda = (SimpleLambdaExpressionSyntax)replacedLambda;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\MakeMethodSynchronous\CSharpMakeMethodSynchronousCodeFixProvider.cs (1)
40case SimpleLambdaExpressionSyntax lambda: return RemoveAsyncModifierHelpers.WithoutAsyncModifier(lambda);
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\CSharpRemoveAsyncModifierCodeFixProvider.cs (1)
58SimpleLambdaExpressionSyntax lambda => AnnotateBlock(generator, RemoveAsyncModifierHelpers.WithoutAsyncModifier(lambda)),
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\RemoveAsyncModifierHelpers.cs (1)
27internal static SyntaxNode WithoutAsyncModifier(SimpleLambdaExpressionSyntax lambda)
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
273case SimpleLambdaExpressionSyntax simpleLambda:
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
1772else if (lambdaExpression is SimpleLambdaExpressionSyntax simpleLambda) 1790SimpleLambdaExpressionSyntax lambdaExpression)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Structure\SimpleLambdaExpressionStructureTests.cs (1)
15public class SimpleLambdaExpressionStructureTests : AbstractCSharpSyntaxNodeStructureTests<SimpleLambdaExpressionSyntax>
SymbolKey\SymbolKeyTestBase.cs (1)
372IEnumerable<ExpressionSyntax> exprs = body.DescendantNodes().OfType<SimpleLambdaExpressionSyntax>();
Microsoft.CodeAnalysis.CSharp.Features (18)
ChangeSignature\CSharpChangeSignatureService.cs (1)
366if (updatedNode is SimpleLambdaExpressionSyntax lambda)
Completion\CompletionProviders\AwaitCompletionProvider.cs (1)
49SimpleLambdaExpressionSyntax simpleLambda => simpleLambda.Parameter.SpanStart,
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
1872return ((SimpleLambdaExpressionSyntax)node).Parameter.Span; 1956return ((SimpleLambdaExpressionSyntax)lambda).Parameter.Identifier.Span;
EditAndContinue\SyntaxComparer.cs (2)
977var simple = (SimpleLambdaExpressionSyntax)nestedFunction;
ExtractMethod\CSharpSelectionResult.cs (1)
95SimpleLambdaExpressionSyntax or
ExtractMethod\CSharpSelectionResult.StatementResult.cs (2)
37SimpleLambdaExpressionSyntax lambda => lambda.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword, 57SimpleLambdaExpressionSyntax or
ExtractMethod\Extensions.cs (1)
47case SimpleLambdaExpressionSyntax s: return s.Body as BlockSyntax;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
295SimpleLambdaExpressionSyntax simpleLambda => [simpleLambda.Parameter],
src\Analyzers\CSharp\CodeFixes\MakeMethodSynchronous\CSharpMakeMethodSynchronousCodeFixProvider.cs (1)
40case SimpleLambdaExpressionSyntax lambda: return RemoveAsyncModifierHelpers.WithoutAsyncModifier(lambda);
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\CSharpRemoveAsyncModifierCodeFixProvider.cs (1)
58SimpleLambdaExpressionSyntax lambda => AnnotateBlock(generator, RemoveAsyncModifierHelpers.WithoutAsyncModifier(lambda)),
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\RemoveAsyncModifierHelpers.cs (1)
27internal static SyntaxNode WithoutAsyncModifier(SimpleLambdaExpressionSyntax lambda)
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
273case SimpleLambdaExpressionSyntax simpleLambda:
Structure\CSharpBlockStructureProvider.cs (1)
48builder.Add<SimpleLambdaExpressionSyntax, SimpleLambdaExpressionStructureProvider>();
Structure\Providers\SimpleLambdaExpressionStructureProvider.cs (2)
12internal class SimpleLambdaExpressionStructureProvider : AbstractSyntaxNodeStructureProvider<SimpleLambdaExpressionSyntax> 16SimpleLambdaExpressionSyntax lambdaExpression,
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (10)
Semantics\AnonymousFunctionTests.cs (4)
984var simpleLambdaSyntax = root.DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().Single(); 1018var simpleLambdaSyntax = root.DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().Single();
Semantics\BindingAsyncTests.cs (2)
58var simple = tree.GetCompilationUnitRoot().DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().Single();
Semantics\BindingTests.cs (2)
3939var lambda = tree.GetRoot().DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().Single(s => s.Parameter.Identifier.Text == "x");
Semantics\RefFieldTests.cs (1)
11389var lambdas = tree.GetRoot().DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().Select(e => model.GetSymbolInfo(e).Symbol.GetSymbol<LambdaSymbol>()).ToArray();
Semantics\SuppressAccessibilityChecksTests.cs (1)
123var expr = (ExpressionSyntax)tree.GetCompilationUnitRoot().DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().Single().Body;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (17)
Compilation\GetSemanticInfoTests.cs (2)
2356var lambdaSyntax = tree.GetCompilationUnitRoot().DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().Single();
Compilation\SemanticModelAPITests.cs (1)
3127var syntax = tree.GetRoot().DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().Single().
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (3)
4415var lambda = (SimpleLambdaExpressionSyntax)tree.GetCompilationUnitRoot().DescendantNodes().First(x => x is SimpleLambdaExpressionSyntax);
Compilation\SemanticModelGetSemanticInfoTests.cs (2)
5690var semanticInfo = GetSemanticInfoForTest<SimpleLambdaExpressionSyntax>(sourceCode); 6997var semanticInfo = GetSemanticInfoForTest<SimpleLambdaExpressionSyntax>(code);
Symbols\Source\DeclaringSyntaxNodeTests.cs (1)
720CheckLambdaDeclaringSyntax<SimpleLambdaExpressionSyntax>(comp, tree, "/*2*/");
Symbols\Source\EventTests.cs (4)
435var lambdaSyntax = tree.GetRoot().DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().First(); 481var lambdaSyntax = tree.GetRoot().DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().First();
Symbols\Source\NullablePublicAPITests.cs (2)
4047var lambda = root.DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().First();
Symbols\SymbolEqualityTests.cs (2)
935var lambdaSyntax = root.DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().First();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (20)
Diagnostics\LineSpanDirectiveTests.cs (1)
453case SimpleLambdaExpressionSyntax lambda:
Generated\Syntax.Test.xml.Generated.cs (5)
10394private static SimpleLambdaExpressionSyntax GenerateSimpleLambdaExpression() 11605var node = GenerateSimpleLambdaExpression(); 11613var newNode = node.WithAttributeLists(node.AttributeLists).WithModifiers(node.Modifiers).WithParameter(node.Parameter).WithArrowToken(node.ArrowToken).WithBlock(node.Block).WithExpressionBody(node.ExpressionBody); 15529var oldNode = GenerateSimpleLambdaExpression(); 15545var oldNode = GenerateSimpleLambdaExpression();
Parsing\ExpressionParsingTests.cs (6)
2037var lambda = (SimpleLambdaExpressionSyntax)expr; 2055var lambda = (SimpleLambdaExpressionSyntax)expr; 2073var lambda = (SimpleLambdaExpressionSyntax)expr;
Syntax\SyntaxNodeTests.cs (8)
3850var expression = (SimpleLambdaExpressionSyntax)SyntaxFactory.ParseExpression(text); 3877var expression = (SimpleLambdaExpressionSyntax)SyntaxFactory.ParseExpression(text); 3904var expression = (SimpleLambdaExpressionSyntax)SyntaxFactory.ParseExpression(text); 3931var expression = (SimpleLambdaExpressionSyntax)SyntaxFactory.ParseExpression(text);
Microsoft.CodeAnalysis.CSharp.Workspaces (24)
CodeGeneration\CSharpSyntaxGenerator.cs (7)
2149: declaration is SimpleLambdaExpressionSyntax simpleLambda 2249var lambda = (SimpleLambdaExpressionSyntax)declaration; 2279return ((SimpleLambdaExpressionSyntax)declaration).Body as ExpressionSyntax; 2335return ((SimpleLambdaExpressionSyntax)declaration).WithBody((CSharpSyntaxNode)expr ?? CreateBlock()); 2490SyntaxKind.SimpleLambdaExpression => (((SimpleLambdaExpressionSyntax)declaration).Body as BlockSyntax)?.Statements, 2525return ((SimpleLambdaExpressionSyntax)declaration).WithBody(body);
Recommendations\CSharpRecommendationServiceRunner.cs (1)
42SimpleLambdaExpressionSyntax => 1,
Rename\CSharpRenameRewriterLanguageService.cs (3)
161var lambdas = node.GetAncestorsOrThis(n => n is SimpleLambdaExpressionSyntax or ParenthesizedLambdaExpressionSyntax); 298var expandParameter = !originalNode.GetAncestorsOrThis(n => n is SimpleLambdaExpressionSyntax or ParenthesizedLambdaExpressionSyntax).Any(); 1161? token.GetAncestors(n => n is SimpleLambdaExpressionSyntax or ParenthesizedLambdaExpressionSyntax).FirstOrDefault()
Rename\LocalConflictVisitor.cs (1)
112public override void VisitSimpleLambdaExpression(SimpleLambdaExpressionSyntax node)
Simplification\CSharpSimplificationService.Expander.cs (2)
208public override SyntaxNode VisitSimpleLambdaExpression(SimpleLambdaExpressionSyntax node) 212if (newNode is SimpleLambdaExpressionSyntax simpleLambda)
Simplification\Reducers\CSharpEscapingReducer.cs (2)
55var enclosingLambdaExpression = parent.GetAncestorsOrThis(n => (n is SimpleLambdaExpressionSyntax or ParenthesizedLambdaExpressionSyntax)).FirstOrDefault(); 58if (enclosingLambdaExpression is SimpleLambdaExpressionSyntax simpleLambda)
Simplification\Reducers\CSharpMiscellaneousReducer.cs (1)
98var newSimpleLambda = SyntaxFactory.SimpleLambdaExpression(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
154case SimpleLambdaExpressionSyntax simpleLambda:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (4)
237var originalSimpleLambda = (SimpleLambdaExpressionSyntax)originalLambda; 238var replacedSimpleLambda = (SimpleLambdaExpressionSyntax)replacedLambda;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
1772else if (lambdaExpression is SimpleLambdaExpressionSyntax simpleLambda) 1790SimpleLambdaExpressionSyntax lambdaExpression)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (4)
CodeGeneration\SyntaxGeneratorTests.cs (4)
710VerifySyntax<SimpleLambdaExpressionSyntax>( 722VerifySyntax<SimpleLambdaExpressionSyntax>( 734VerifySyntax<SimpleLambdaExpressionSyntax>( 746VerifySyntax<SimpleLambdaExpressionSyntax>(