194 references to ReturnStatementSyntax
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentParameterAnalyzer.cs (1)
183
if (getter.Body is { Statements: { Count: 1 } } && getter.Body.Statements[0] is
ReturnStatementSyntax
returnStatement)
Microsoft.CodeAnalysis.CSharp (12)
Binder\Binder_Statements.cs (2)
101
result = BindReturn((
ReturnStatementSyntax
)node, diagnostics);
2987
private BoundStatement BindReturn(
ReturnStatementSyntax
syntax, BindingDiagnosticBag diagnostics)
Binder\ExpressionVariableFinder.cs (1)
183
public override void VisitReturnStatement(
ReturnStatementSyntax
node)
Binder\LocalBinderFactory.cs (1)
963
public override void VisitReturnStatement(
ReturnStatementSyntax
node)
FlowAnalysis\DataFlowsInWalker.cs (1)
121
if (node != null && node is
ReturnStatementSyntax
&& RegionContains(node.Span))
FlowAnalysis\DataFlowsOutWalker.cs (1)
266
if (!_dataFlowsOut.Contains(parameter) && (node == null || node is
ReturnStatementSyntax
))
Parser\LanguageParser.cs (1)
9642
private
ReturnStatementSyntax
ParseReturnStatement(SyntaxList<AttributeListSyntax> attributes)
Syntax\LookupPosition.cs (2)
349
return ((
ReturnStatementSyntax
)statement).ReturnKeyword;
412
return ((
ReturnStatementSyntax
)statement).SemicolonToken;
Syntax\ReturnStatementSyntax.cs (2)
11
public
ReturnStatementSyntax
Update(SyntaxToken returnKeyword, ExpressionSyntax? expression, SyntaxToken semicolonToken)
20
public static
ReturnStatementSyntax
ReturnStatement(SyntaxToken returnKeyword, ExpressionSyntax? expression, SyntaxToken semicolonToken)
Syntax\SyntaxFacts.cs (1)
616
node.DescendantNodesAndSelf(child => !IsNestedFunction(child) && !(node is ExpressionSyntax)).Any(n => n is
ReturnStatementSyntax
{ Expression: { } });
Microsoft.CodeAnalysis.CSharp.CodeStyle (10)
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
272
public override SyntaxKind VisitReturnStatement(
ReturnStatementSyntax
node)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
311
if (statement is
ReturnStatementSyntax
{ Expression: { } expression })
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
212
accessorDeclaration.ExpressionBody?.Expression ?? GetSingleStatementFromAccessor<
ReturnStatementSyntax
>(accessorDeclaration)?.Expression,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
436
if (locallyScopedExpression.Parent is
ReturnStatementSyntax
or ArrowExpressionClauseSyntax)
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (1)
256
if (nextStatement is
ReturnStatementSyntax
returnStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
189
else if (firstStatement is
ReturnStatementSyntax
returnStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (2)
930
ReturnStatementSyntax
returnStatement => GetTargetTypeForReturnStatement(returnStatement),
972
ITypeSymbol? GetTargetTypeForReturnStatement(
ReturnStatementSyntax
returnStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
137
(nodeParent is
ReturnStatementSyntax
returnStatement && returnStatement.Expression == node) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
269
=> ((
ReturnStatementSyntax
)node).Expression;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (8)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
277
public override ExpressionSyntax VisitReturnStatement(
ReturnStatementSyntax
node)
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
67
var returnedValue = node is
ReturnStatementSyntax
returnStatement ? returnStatement.Expression : node;
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
47
if (node is not
ReturnStatementSyntax
returnStatement)
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\CSharpRemoveAsyncModifierCodeFixProvider.cs (1)
24
internal sealed partial class CSharpRemoveAsyncModifierCodeFixProvider() : AbstractRemoveAsyncModifierCodeFixProvider<
ReturnStatementSyntax
, ExpressionSyntax>
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
54
if (returnOperation.Syntax is
ReturnStatementSyntax
{ Expression: CheckedExpressionSyntax exp })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
175
ReturnStatementSyntax
returnStatement => InferTypeForReturnStatement(returnStatement),
241
ReturnStatementSyntax
returnStatement => InferTypeForReturnStatement(returnStatement, token),
2006
ReturnStatementSyntax
returnStatement, SyntaxToken? previousToken = null)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (4)
CodeGeneration\SyntaxGeneratorTests.cs (4)
42
var statement = root.DescendantNodes().Single(n => n is
ReturnStatementSyntax
);
76
var statement = root.DescendantNodes().Single(n => n is
ReturnStatementSyntax
);
83
var
replacement = (
ReturnStatementSyntax
)g.ReturnStatement(g.NameOfExpression(g.IdentifierName("M")));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
Emit\NumericIntPtrTests.cs (2)
6009
var expr = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
10547
var returnStatements = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().ToArray();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (24)
FirstClassSpanTests.cs (1)
2823
var arg = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
Semantics\CollectionExpressionTests.cs (6)
14234
var returnValue = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Last().Expression;
14310
var returnValue = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Last().Expression;
14446
var cast = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Last().Expression;
14570
var cast = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Last().Expression;
26723
var operation = VerifyOperationTreeForTest<
ReturnStatementSyntax
>(comp,
26785
var operation = VerifyOperationTreeForTest<
ReturnStatementSyntax
>(comp,
Semantics\OutVarTests.cs (3)
1285
var containingReturnOrThrow = containingStatement as
ReturnStatementSyntax
?? (StatementSyntax)(containingStatement as ThrowStatementSyntax);
13336
var
statement = (
ReturnStatementSyntax
)SyntaxFactory.ParseStatement(@"
Semantics\PatternMatchingTests_Scope.cs (2)
708
var
statement = (
ReturnStatementSyntax
)SyntaxFactory.ParseStatement(@"
Semantics\PatternMatchingTests2.cs (8)
2020
var
returnStatement = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single();
2022
var
modifiedReturnStatement = (
ReturnStatementSyntax
)new RemoveAliasQualifiers().Visit(returnStatement);
2061
var
returnStatement = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single();
2063
var
modifiedReturnStatement = (
ReturnStatementSyntax
)new RemoveAliasQualifiers().Visit(returnStatement);
Semantics\PrimaryConstructorTests.cs (2)
2173
Assert.False(model.TryGetSpeculativeSemanticModel(tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().SpanStart,
2325
Assert.False(model.TryGetSpeculativeSemanticModel(tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().SpanStart,
Semantics\RecordTests.cs (2)
22285
Assert.False(model.TryGetSpeculativeSemanticModel(tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().SpanStart,
22437
Assert.False(model.TryGetSpeculativeSemanticModel(tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().SpanStart,
Microsoft.CodeAnalysis.CSharp.Features (28)
CodeRefactorings\InlineMethod\CSharpInlineMethodRefactoringProvider.cs (1)
43
ReturnStatementSyntax
returnStatementSyntax => returnStatementSyntax.Expression,
ConvertLinq\ConvertForEachToLinqQuery\AbstractToMethodConverter.cs (1)
109
ForEachInfo.ForEachStatement.GetNextStatement() is
ReturnStatementSyntax
returnStatement &&
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (3)
229
return TryConvertIfInReturnStatement((
ReturnStatementSyntax
)parent, queryExpressionProcessingInfo, out documentUpdateInfo);
729
ReturnStatementSyntax
returnStatement,
754
if (memberDeclarationNode.DescendantNodes().OfType<
ReturnStatementSyntax
>().Count() == 1)
Debugging\CSharpProximityExpressionsService.RelevantExpressionsCollector.cs (1)
26
public override void VisitReturnStatement(
ReturnStatementSyntax
node)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
2822
return ((
ReturnStatementSyntax
)statement).Expression!;
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (1)
53
=> jumpOutOfRegionStatements.Where(n => n is
ReturnStatementSyntax
).Any();
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
300
if (statements is [
ReturnStatementSyntax
{ Expression: null }])
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (1)
234
if (statements.ElementAtOrDefault(0) is not LocalDeclarationStatementSyntax declaration || statements.ElementAtOrDefault(1) is not
ReturnStatementSyntax
returnStatement)
ExtractMethod\CSharpSelectionValidator.cs (3)
446
=> jumpsOutOfRegion.Where(n => n is not
ReturnStatementSyntax
).Any();
450
var returnStatements = jumpsOutOfRegion.Where(s => s is
ReturnStatementSyntax
);
468
if (returnStatements.Cast<
ReturnStatementSyntax
>().Any(r => r.Expression != null))
ExtractMethod\CSharpSelectionValidator.Validator.cs (1)
67
ReturnStatementSyntax
or
GenerateConstructorFromMembers\CSharpGenerateConstructorFromMembersCodeRefactoringProvider.cs (1)
86
if (body is
ReturnStatementSyntax
returnStatement)
Highlighting\KeywordHighlighters\ReturnStatementHighlighter.cs (3)
22
internal class ReturnStatementHighlighter : AbstractKeywordHighlighter<
ReturnStatementSyntax
>
31
ReturnStatementSyntax
returnStatement, List<TextSpan> spans, CancellationToken cancellationToken)
52
case
ReturnStatementSyntax
statement:
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
272
public override SyntaxKind VisitReturnStatement(
ReturnStatementSyntax
node)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
311
if (statement is
ReturnStatementSyntax
{ Expression: { } expression })
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
212
accessorDeclaration.ExpressionBody?.Expression ?? GetSingleStatementFromAccessor<
ReturnStatementSyntax
>(accessorDeclaration)?.Expression,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
436
if (locallyScopedExpression.Parent is
ReturnStatementSyntax
or ArrowExpressionClauseSyntax)
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (1)
256
if (nextStatement is
ReturnStatementSyntax
returnStatement)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
277
public override ExpressionSyntax VisitReturnStatement(
ReturnStatementSyntax
node)
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
67
var returnedValue = node is
ReturnStatementSyntax
returnStatement ? returnStatement.Expression : node;
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
47
if (node is not
ReturnStatementSyntax
returnStatement)
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\CSharpRemoveAsyncModifierCodeFixProvider.cs (1)
24
internal sealed partial class CSharpRemoveAsyncModifierCodeFixProvider() : AbstractRemoveAsyncModifierCodeFixProvider<
ReturnStatementSyntax
, ExpressionSyntax>
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
54
if (returnOperation.Syntax is
ReturnStatementSyntax
{ Expression: CheckedExpressionSyntax exp })
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (21)
IOperation\IOperationTests_IConversionExpression.cs (7)
3185
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics,
3217
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics,
5015
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics);
5047
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics);
5080
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics);
5332
public static SyntaxNode ReturnStatementSelector(SyntaxNode syntaxNode) => ((
ReturnStatementSyntax
)syntaxNode).Expression;
5402
case
ReturnStatementSyntax
_:
IOperation\IOperationTests_IParenthesized.cs (9)
81
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics);
125
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics);
173
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics);
217
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics);
298
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics);
345
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics);
385
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics);
456
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics);
501
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics);
IOperation\IOperationTests_IReturnStatement.cs (3)
38
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics);
61
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics);
140
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics);
IOperation\IOperationTests_IUtf8StringOperation.cs (2)
36
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics, targetFramework: Roslyn.Test.Utilities.TargetFramework.NetCoreApp);
101
VerifyOperationTreeAndDiagnosticsForTest<
ReturnStatementSyntax
>(source, expectedOperationTree, expectedDiagnostics, targetFramework: Roslyn.Test.Utilities.TargetFramework.NetCoreApp);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (26)
Semantics\ExpressionBodiedMemberTests.cs (4)
711
var node = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
742
var node = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
777
var node = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
808
var node = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
Semantics\NativeIntegerTests.cs (1)
9495
var expr = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
Semantics\NullableContextTests.cs (4)
350
var
syntax = syntaxTree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Skip(1).Single();
1771
var returnStatements = syntaxTree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().ToArray();
1773
var
syntax = returnStatements[0];
Semantics\NullableReferenceTypesTests.cs (2)
13511
var
returnStatement = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Skip(1).Single();
Semantics\RecordStructTests.cs (2)
2307
var x = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
2331
var x = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
Semantics\Utf8StringsLiteralsTests.cs (13)
2970
var node = tree.GetCompilationUnitRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
2998
var node = tree.GetCompilationUnitRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
3026
var node = tree.GetCompilationUnitRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
3054
var node = tree.GetCompilationUnitRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
3082
var node = tree.GetCompilationUnitRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
3110
var node = tree.GetCompilationUnitRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
3138
var node = tree.GetCompilationUnitRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
3166
var node = tree.GetCompilationUnitRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
3194
var node = tree.GetCompilationUnitRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
3222
var node = tree.GetCompilationUnitRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
3250
var node = tree.GetCompilationUnitRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
3278
var node = tree.GetCompilationUnitRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
3306
var node = tree.GetCompilationUnitRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (21)
Compilation\SemanticModelAPITests.cs (5)
2313
var
statementSyntax = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().Single();
3786
var typeInfo = model.GetTypeInfo(localFunctionBody.DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression!);
3788
var
@return = (
ReturnStatementSyntax
)SyntaxFactory.ParseStatement("return s;");
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (3)
4446
var lookupSymbols = model.LookupSymbols(conversionDecl.DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().SpanStart, name: WellKnownMemberNames.ImplicitConversionName);
4477
var lookupSymbols = model.LookupSymbols(conversionDecl.DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().SpanStart, name: WellKnownMemberNames.ExplicitConversionName);
4508
var lookupSymbols = model.LookupSymbols(operatorDecl.DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().SpanStart, name: WellKnownMemberNames.AdditionOperatorName);
Symbols\FunctionPointerTypeSymbolTests.cs (1)
1746
var returnExpression = mDeclSyntax.DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression!;
Symbols\Source\NullablePublicAPITests.cs (8)
1441
var
returnStatement = root.DescendantNodes().OfType<
ReturnStatementSyntax
>().Single();
3698
var typeInfo = model.GetTypeInfo(localFunctionBody.DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression!);
3700
var
@return = (
ReturnStatementSyntax
)SyntaxFactory.ParseStatement("return s;");
3733
var typeInfo = model.GetTypeInfo(localFunctionBody.DescendantNodes().OfType<
ReturnStatementSyntax
>().Single().Expression!);
3735
var
@return = (
ReturnStatementSyntax
)SyntaxFactory.ParseStatement("return s;");
Symbols\StaticAbstractMembersInInterfacesTests.cs (4)
30280
var
node = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().First();
30937
var
node = tree.GetRoot().DescendantNodes().OfType<
ReturnStatementSyntax
>().First();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (19)
Generated\Syntax.Test.xml.Generated.cs (5)
10598
private static
ReturnStatementSyntax
GenerateReturnStatement()
12424
var
node = GenerateReturnStatement();
12430
var
newNode = node.WithAttributeLists(node.AttributeLists).WithReturnKeyword(node.ReturnKeyword).WithExpression(node.Expression).WithSemicolonToken(node.SemicolonToken);
17297
var
oldNode = GenerateReturnStatement();
17313
var
oldNode = GenerateReturnStatement();
Parsing\LocalFunctionParsingTests.cs (2)
1367
var
s2 = Assert.IsType<
ReturnStatementSyntax
>(s1.Body.Statements.Single());
Parsing\StatementParsingTests.cs (4)
1104
var
rs = (
ReturnStatementSyntax
)statement;
1124
var
rs = (
ReturnStatementSyntax
)statement;
Syntax\ChildSyntaxListTests.cs (4)
20
var
node1 = SyntaxFactory.ReturnStatement();
21
var
node2 = SyntaxFactory.ReturnStatement();
30
var
node1 = SyntaxFactory.ReturnStatement();
31
var
node2 = SyntaxFactory.ReturnStatement();
Syntax\SyntaxListTests.cs (2)
27
var
node1 = SyntaxFactory.ReturnStatement();
28
var
node2 = SyntaxFactory.ReturnStatement();
Syntax\SyntaxTokenListTests.cs (2)
21
var
node1 = SyntaxFactory.ReturnStatement();
37
var
node1 = SyntaxFactory.ReturnStatement();
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
Simplification\CSharpSimplificationService.Expander.cs (2)
131
public override SyntaxNode VisitReturnStatement(
ReturnStatementSyntax
node)
135
if (newNode is
ReturnStatementSyntax
newReturnStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
189
else if (firstStatement is
ReturnStatementSyntax
returnStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (2)
930
ReturnStatementSyntax
returnStatement => GetTargetTypeForReturnStatement(returnStatement),
972
ITypeSymbol? GetTargetTypeForReturnStatement(
ReturnStatementSyntax
returnStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
137
(nodeParent is
ReturnStatementSyntax
returnStatement && returnStatement.Expression == node) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
269
=> ((
ReturnStatementSyntax
)node).Expression;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
175
ReturnStatementSyntax
returnStatement => InferTypeForReturnStatement(returnStatement),
241
ReturnStatementSyntax
returnStatement => InferTypeForReturnStatement(returnStatement, token),
2006
ReturnStatementSyntax
returnStatement, SyntaxToken? previousToken = null)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
538
VerifySyntax<
ReturnStatementSyntax
>(Generator.ReturnStatement(), "return;");
539
VerifySyntax<
ReturnStatementSyntax
>(Generator.ReturnStatement(Generator.IdentifierName("x")), "return x;");
Mvc.Api.Analyzers.Test (6)
ActualApiResponseMetadataFactoryTest.cs (6)
78
var
returnStatement = methodSyntax.DescendantNodes().OfType<
ReturnStatementSyntax
>().First();
395
var
returnStatement = methodSyntax.DescendantNodes().OfType<
ReturnStatementSyntax
>().First();
414
var
returnStatement = methodSyntax.DescendantNodes().OfType<
ReturnStatementSyntax
>().First();