2 overrides of ReturnStatement
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3107public override SyntaxNode ReturnStatement(SyntaxNode? expression = null)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
CodeGeneration\VisualBasicSyntaxGenerator.vb (1)
366Public Overrides Function ReturnStatement(Optional expressionOpt As SyntaxNode = Nothing) As SyntaxNode
76 references to ReturnStatement
Microsoft.CodeAnalysis.CodeStyle.Fixes (13)
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
178=> generator.WithStatements(node, generator.GetStatements(node).Concat(generator.ReturnStatement())); 227var statement = generator.ReturnStatement(invocation);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
79: (TStatementSyntax)editor.Generator.ReturnStatement(conditionalExpression);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (2)
114: generator.ReturnStatement(invocationExpression); 209return [generator.ReturnStatement(expression)];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
124return [factory.ReturnStatement(factory.FalseLiteralExpression())]; 164[factory.ReturnStatement(factory.FalseLiteralExpression())]);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (6)
47var statement = factory.ReturnStatement( 68statements.Add(factory.ReturnStatement( 92return [factory.ReturnStatement(factory.LiteralExpression(0))]; 122return [factory.ReturnStatement( 163? factory.ReturnStatement(hashCodeNameExpression) 164: factory.ReturnStatement(
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAboveReturnCodeFixProvider.cs (2)
71statements = statements.Add(generator.ReturnStatement(exprOrStatement)); 79var newBody = SyntaxFactory.Block(statements.Add(generator.ReturnStatement(exprOrStatement)).Cast<StatementSyntax>());
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
43var replacement = g.ReturnStatement(g.NameOfExpression(g.IdentifierName("M"))); 83var replacement = (ReturnStatementSyntax)g.ReturnStatement(g.NameOfExpression(g.IdentifierName("M")));
Microsoft.CodeAnalysis.CSharp.Features (4)
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
58var getAccessorStatement = generator.ReturnStatement(generator.IdentifierName(fieldName));
Snippets\CSharpIntMainSnippetProvider.cs (1)
35var returnStatement = (StatementSyntax)generator.ReturnStatement(generator.LiteralExpression(0));
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAboveReturnCodeFixProvider.cs (2)
71statements = statements.Add(generator.ReturnStatement(exprOrStatement)); 79var newBody = SyntaxFactory.Block(statements.Add(generator.ReturnStatement(exprOrStatement)).Cast<StatementSyntax>());
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (10)
CodeGeneration\SyntaxGeneratorTests.cs (10)
538VerifySyntax<ReturnStatementSyntax>(Generator.ReturnStatement(), "return;"); 539VerifySyntax<ReturnStatementSyntax>(Generator.ReturnStatement(Generator.IdentifierName("x")), "return x;"); 735Generator.ValueReturningLambdaExpression("x", [Generator.ReturnStatement(Generator.IdentifierName("y"))]), 739Generator.ValueReturningLambdaExpression(new[] { Generator.LambdaParameter("x"), Generator.LambdaParameter("y") }, [Generator.ReturnStatement(Generator.IdentifierName("z"))]), 743Generator.ValueReturningLambdaExpression(new SyntaxNode[] { }, [Generator.ReturnStatement(Generator.IdentifierName("y"))]), 3409Generator.GetAccessorDeclaration(Accessibility.NotApplicable, [Generator.ReturnStatement()])), 3415Generator.GetAccessorDeclaration(Accessibility.Protected, [Generator.ReturnStatement()])), 3421Generator.SetAccessorDeclaration(Accessibility.Protected, [Generator.ReturnStatement()])), 3430Generator.GetAccessorDeclaration(Accessibility.Protected, [Generator.ReturnStatement()])), 3436Generator.SetAccessorDeclaration(Accessibility.Protected, [Generator.ReturnStatement()])),
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeGeneration\StatementGenerationTests.cs (3)
51Test(f => f.ReturnStatement(), 61Test(f => f.ReturnStatement( 72Test(f => f.ReturnStatement(
Microsoft.CodeAnalysis.Features (11)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
169generator.ReturnStatement(generator.InvocationExpression(
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (2)
890var convertToTupleStatement = generator.ReturnStatement( 893var convertToStructStatement = generator.ReturnStatement(
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
404var body = factory.ReturnStatement(
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (1)
186return [factory.ReturnStatement(
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (1)
184[generator.ReturnStatement(expression)]);
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (2)
391var returnStatement = generator.ReturnStatement(_expression.WithoutTrivia()); 434: generator.ReturnStatement(invocation);
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
178=> generator.WithStatements(node, generator.GetStatements(node).Concat(generator.ReturnStatement())); 227var statement = generator.ReturnStatement(invocation);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
79: (TStatementSyntax)editor.Generator.ReturnStatement(conditionalExpression);
Microsoft.CodeAnalysis.VisualBasic.Features (1)
ConvertAutoPropertyToFullProperty\VisualBasicConvertAutoPropertyToFullProperty.vb (1)
45Dim returnStatement = New SyntaxList(Of StatementSyntax)(DirectCast(generator.ReturnStatement(
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (13)
CodeGeneration\SyntaxGeneratorTests.vb (13)
478VerifySyntax(Of ReturnStatementSyntax)(Generator.ReturnStatement(), "Return") 479VerifySyntax(Of ReturnStatementSyntax)(Generator.ReturnStatement(Generator.IdentifierName("x")), "Return x") 738Generator.ValueReturningLambdaExpression("x", {Generator.ReturnStatement(Generator.IdentifierName("y"))}), 744Generator.ValueReturningLambdaExpression({Generator.LambdaParameter("x"), Generator.LambdaParameter("y")}, {Generator.ReturnStatement(Generator.IdentifierName("z"))}), 750Generator.ValueReturningLambdaExpression(New SyntaxNode() {}, {Generator.ReturnStatement(Generator.IdentifierName("y"))}), 862Generator.MethodDeclaration("m", returnType:=Generator.IdentifierName("x"), statements:={Generator.ReturnStatement(Generator.IdentifierName("y"))}), 1181Generator.GetAccessorDeclaration(Accessibility.NotApplicable, {Generator.ReturnStatement()})), 1191Generator.GetAccessorDeclaration(Accessibility.NotApplicable, {Generator.ReturnStatement()}), 1192Generator.SetAccessorDeclaration(Accessibility.NotApplicable, {Generator.ReturnStatement()})), 1206Generator.GetAccessorDeclaration(Accessibility.Protected, {Generator.ReturnStatement()})), 1216Generator.SetAccessorDeclaration(Accessibility.Protected, {Generator.ReturnStatement()})), 1229Generator.GetAccessorDeclaration(Accessibility.Protected, {Generator.ReturnStatement()})), 1239Generator.SetAccessorDeclaration(Accessibility.Protected, {Generator.ReturnStatement()})),
Microsoft.CodeAnalysis.Workspaces (17)
Shared\Extensions\SyntaxGeneratorExtensions.cs (5)
69getBody = codeFactory.ReturnStatement( 93: codeFactory.ReturnStatement( 111getBody = codeFactory.ReturnStatement( 131getBody = codeFactory.ReturnStatement( 279: [codeFactory.ReturnStatement(body)]);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (2)
114: generator.ReturnStatement(invocationExpression); 209return [generator.ReturnStatement(expression)];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (4)
124return [factory.ReturnStatement(factory.FalseLiteralExpression())]; 164[factory.ReturnStatement(factory.FalseLiteralExpression())]); 212statements.Add(factory.ReturnStatement( 316statements.Add(factory.ReturnStatement(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (6)
47var statement = factory.ReturnStatement( 68statements.Add(factory.ReturnStatement( 92return [factory.ReturnStatement(factory.LiteralExpression(0))]; 122return [factory.ReturnStatement( 163? factory.ReturnStatement(hashCodeNameExpression) 164: factory.ReturnStatement(