4 implementations of ReturnsVoid
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
42public abstract bool ReturnsVoid { get; }
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\MethodSymbol.cs (1)
321bool IMethodSymbol.ReturnsVoid => _underlying.ReturnsVoid;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\MethodSymbol.vb (1)
1062Private ReadOnly Property IMethodSymbol_ReturnsVoid As Boolean Implements IMethodSymbol.ReturnsVoid, IMethodSymbolInternal.ReturnsVoid
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
42public abstract bool ReturnsVoid { get; }
156 references to ReturnsVoid
ILLink.RoslynAnalyzer (1)
ISymbolExtensions.cs (1)
210 (methodSymbol.ReturnsVoid ||
Microsoft.AspNetCore.App.Analyzers (1)
src\Shared\Roslyn\MvcFacts.cs (1)
123if (!method.ReturnsVoid)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
StaticRouteHandlerModel\EndpointResponse.cs (1)
34HasNoResponse = method.ReturnsVoid || awaitableIsVoid;
Microsoft.AspNetCore.Mvc.Analyzers (1)
src\Shared\Roslyn\MvcFacts.cs (1)
123if (!method.ReturnsVoid)
Microsoft.AspNetCore.Mvc.Api.Analyzers (2)
ApiControllerFacts.cs (1)
18if (method.ReturnsVoid || method.ReturnType.TypeKind == TypeKind.Error)
src\Shared\Roslyn\MvcFacts.cs (1)
123if (!method.ReturnsVoid)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (1)
HubClientProxyGenerator.Parser.cs (1)
301if (!(member.ReturnsVoid || member.ReturnType is INamedTypeSymbol { Arity: 0, Name: "Task" }))
Microsoft.CodeAnalysis (3)
DocumentationCommentId.cs (1)
471if (!symbol.ReturnsVoid)
Symbols\ISymbolExtensions.cs (2)
146if (enterScopeMethod is not { ReturnsVoid: false, RefKind: RefKind.None }) 159if (disposeMethod is not { ReturnsVoid: true })
Microsoft.CodeAnalysis.CodeStyle (8)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
899IsSpecialMethodWithMatchingProperty("Reset") && methodSymbol.ReturnsVoid);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (1)
105(methodSymbol.ReturnsVoid ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (3)
504var delegateType = compilation.GetTypeByMetadataName(method.ReturnsVoid 514if (!method.ReturnsVoid) 697if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (3)
214if (method1.ReturnsVoid != method2.ReturnsVoid || 221if (!method1.ReturnsVoid && !this.SignatureTypeEquivalenceComparer.Equals(method1.ReturnType, method2.ReturnType))
Microsoft.CodeAnalysis.CodeStyle.Fixes (9)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
256if (member is IMethodSymbol { IsStatic: false, ReturnsVoid: true, Arity: 0, Parameters.Length: 0 } disposeMethod)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Method.cs (4)
67return updatedMethod.ReturnsVoid 84if (method.ReturnsVoid != conflictingMethod.ReturnsVoid) 93if (method.ReturnsVoid)
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (2)
75if (methodSymbol.IsOrdinaryMethodOrLocalFunction() && methodSymbol.ReturnsVoid && !isEntryPoint) 140if (methodSymbol.ReturnsVoid)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
112return method.ReturnsVoid
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
149.FirstOrDefault(m => m is IMethodSymbol { DeclaredAccessibility: Accessibility.Public, ReturnsVoid: true, Parameters.Length: 0 }) is IMethodSymbol disposeMethodFromPattern)
Microsoft.CodeAnalysis.CSharp (2)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
366if (symbol.ReturnsVoid)
SymbolDisplay\SymbolDisplayVisitor.Types.cs (1)
261if (invokeMethod.ReturnsVoid)
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
124if (methodSymbol.ReturnsVoid)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (8)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
107if (symbol is not IMethodSymbol method || method.ReturnsVoid)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (1)
40if (methodSymbol?.ReturnType == null || methodSymbol.ReturnsVoid)
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
121if (methodSymbol.ReturnsVoid)
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (3)
51if (currentMethod.ReturnsVoid != originalMethod.ReturnsVoid) 55if (!currentMethod.ReturnsVoid && !Equals(currentMethod.ReturnType, originalMethod.ReturnType))
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
82if (lambdaType.DelegateInvokeMethod!.ReturnsVoid)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
628if (method.ReturnsVoid)
Microsoft.CodeAnalysis.CSharp.Features (9)
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (2)
90createReturnStatement = !method.ReturnsVoid && !method.IsAsyncReturningVoidTask(document.SemanticModel.Compilation); 141if (delegateType.DelegateInvokeMethod.ReturnsVoid)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
107if (symbol is not IMethodSymbol method || method.ReturnsVoid)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (1)
40if (methodSymbol?.ReturnType == null || methodSymbol.ReturnsVoid)
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
121if (methodSymbol.ReturnsVoid)
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (3)
51if (currentMethod.ReturnsVoid != originalMethod.ReturnsVoid) 55if (!currentMethod.ReturnsVoid && !Equals(currentMethod.ReturnType, originalMethod.ReturnType))
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
82if (lambdaType.DelegateInvokeMethod!.ReturnsVoid)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Compilation\GetSemanticInfoTests.cs (2)
4789Assert.False(lambda.ReturnsVoid); 4832Assert.False(methodSymbol.ReturnsVoid);
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (1)
1037Assert.True(methodDispose.ReturnsVoid);
Symbols\Source\MethodTests.cs (1)
119Assert.True(m.ReturnsVoid);
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
Rename\CSharpRenameRewriterLanguageService.cs (2)
1058if (!method.ReturnsVoid && !method.Parameters.Any() && method.ReturnType.SpecialType == SpecialType.System_Boolean) 1067if (!method.ReturnsVoid &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
124if (methodSymbol.ReturnsVoid)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
628if (method.ReturnsVoid)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
AbstractTypeParameterChecker.cs (1)
89if (!symbol.ReturnsVoid)
Microsoft.CodeAnalysis.Features (18)
AddImport\SymbolReferenceFinder.cs (1)
554searchScope, "Deconstruct", type, static m => m.ReturnsVoid, cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractDocCommentCompletionProvider.cs (1)
233var returns = symbol is IMethodSymbol method && !method.ReturnsVoid;
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (1)
215if (methodSymbol.ReturnsVoid || methodSymbol.ReturnType == null || targetTypeSymbols.IsEmpty)
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
379initializeParameterService.InsertStatement(editor, functionDeclaration, method.ReturnsVoid, statementToAddAfter, nullCheckStatement);
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (3)
386&& (callerMethodSymbol.ReturnsVoid 465&& !calleeMethodSymbol.ReturnsVoid 525&& !calleeMethodSymbol.ReturnsVoid
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
432var newStatement = _methodSymbol.ReturnsVoid
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
116!getMethod.ReturnsVoid && 147setMethod.ReturnsVoid &&
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
899IsSpecialMethodWithMatchingProperty("Reset") && methodSymbol.ReturnsVoid);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
256if (member is IMethodSymbol { IsStatic: false, ReturnsVoid: true, Arity: 0, Parameters.Length: 0 } disposeMethod)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Method.cs (4)
67return updatedMethod.ReturnsVoid 84if (method.ReturnsVoid != conflictingMethod.ReturnsVoid) 93if (method.ReturnsVoid)
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (2)
75if (methodSymbol.IsOrdinaryMethodOrLocalFunction() && methodSymbol.ReturnsVoid && !isEntryPoint) 140if (methodSymbol.ReturnsVoid)
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\TrackingDiagnosticAnalyzer.cs (1)
41ReturnsVoid = symbol is IMethodSymbol ? ((IMethodSymbol)symbol).ReturnsVoid : false;
Microsoft.CodeAnalysis.VisualBasic (6)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (3)
275If symbol.ReturnsVoid Then 439If Not method.ReturnsVoid Then 477AddKeyword(If(method.ReturnsVoid, SyntaxKind.SubKeyword, SyntaxKind.FunctionKeyword))
SymbolDisplay\SymbolDisplayVisitor.Types.vb (2)
120If invokeMethod.ReturnsVoid Then 187If Not invokeMethod.ReturnsVoid Then
Symbols\MethodSymbol.vb (1)
1062Private ReadOnly Property IMethodSymbol_ReturnsVoid As Boolean Implements IMethodSymbol.ReturnsVoid, IMethodSymbolInternal.ReturnsVoid
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (5)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (3)
136kind:=If(invokeMethod.ReturnsVoid, SyntaxKind.DelegateSubStatement, SyntaxKind.DelegateFunctionStatement), 139subOrFunctionKeyword:=If(invokeMethod.ReturnsVoid, SyntaxFactory.Token(SyntaxKind.SubKeyword), SyntaxFactory.Token(SyntaxKind.FunctionKeyword)), 143asClause:=If(invokeMethod.ReturnsVoid, Nothing,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\IMethodSymbolExtensions.vb (2)
15If symbol.ReturnsVoid Then 37Not delegateInvokeMethod.ReturnsVoid Then
Microsoft.CodeAnalysis.VisualBasic.Features (9)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (1)
168ElseIf methodSymbol.ReturnsVoid() Then
Completion\CompletionProviders\ImplementsClauseCompletionProvider.vb (1)
123If Not method.ReturnsVoid Then
SignatureHelp\AbstractOrdinaryMethodSignatureHelpProvider.vb (1)
58If Not method.ReturnsVoid Then
SignatureHelp\FunctionAggregationSignatureHelpProvider.vb (2)
127If Not method.ReturnsVoid Then 151Not delegateInvokeMethod.ReturnsVoid Then
SignatureHelp\GenericNameSignatureHelpProvider.Method.vb (1)
56If Not method.ReturnsVoid Then
SignatureHelp\InvocationExpressionSignatureHelpProvider.DelegateInvoke.vb (1)
73If Not invokeMethod.ReturnsVoid Then
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.DelegateType.vb (2)
50If invokeMethod.ReturnsVoid Then 72If Not invokeMethod.ReturnsVoid Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (7)
Rename\VisualBasicRenameRewriterLanguageService.vb (2)
953If Not method.ReturnsVoid AndAlso Not method.Parameters.Any() AndAlso method.ReturnType.SpecialType = SpecialType.System_Boolean Then 959If Not method.ReturnsVoid AndAlso
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (3)
136kind:=If(invokeMethod.ReturnsVoid, SyntaxKind.DelegateSubStatement, SyntaxKind.DelegateFunctionStatement), 139subOrFunctionKeyword:=If(invokeMethod.ReturnsVoid, SyntaxFactory.Token(SyntaxKind.SubKeyword), SyntaxFactory.Token(SyntaxKind.FunctionKeyword)), 143asClause:=If(invokeMethod.ReturnsVoid, Nothing,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\IMethodSymbolExtensions.vb (2)
15If symbol.ReturnsVoid Then 37Not delegateInvokeMethod.ReturnsVoid Then
Microsoft.CodeAnalysis.Workspaces (13)
Editing\SyntaxGenerator.cs (1)
795returnType: invoke.ReturnsVoid ? null : TypeExpression(invoke.ReturnType),
Shared\Extensions\IMethodSymbolExtensions.cs (2)
36if (method.ReturnsVoid != invoke.ReturnsVoid)
Shared\Extensions\SyntaxGeneratorExtensions.cs (1)
271statements: overriddenMethod.ReturnsVoid
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (1)
105(methodSymbol.ReturnsVoid ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (3)
504var delegateType = compilation.GetTypeByMetadataName(method.ReturnsVoid 514if (!method.ReturnsVoid) 697if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters is [{ Type.TypeKind: TypeKind.Delegate }]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (3)
214if (method1.ReturnsVoid != method2.ReturnsVoid || 221if (!method1.ReturnsVoid && !this.SignatureTypeEquivalenceComparer.Equals(method1.ReturnType, method2.ReturnType))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
112return method.ReturnsVoid
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
149.FirstOrDefault(m => m is IMethodSymbol { DeclaredAccessibility: Accessibility.Public, ReturnsVoid: true, Parameters.Length: 0 }) is IMethodSymbol disposeMethodFromPattern)
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
268if (!logMethodSymbol.ReturnsVoid)
Microsoft.Gen.Logging (2)
Parsing\Parser.cs (1)
394if (!methodSymbol.ReturnsVoid)
Parsing\Parser.TagProvider.cs (1)
96&& method.ReturnsVoid
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\ConvertToLibraryImportFixer.cs (2)
239if (!methodSymbol.ReturnsVoid) 316if (methodSymbol.ReturnsVoid)
Microsoft.Interop.SourceGeneration (25)
MarshallerShape.cs (25)
209.FirstOrDefault(m => m is { IsStatic: true, Parameters.Length: 1, ReturnsVoid: true }); 262.FirstOrDefault(m => m is { IsStatic: true, Parameters.Length: 1, ReturnsVoid: false } 274.Where(m => m is { IsStatic: true, Parameters.Length: 2, ReturnsVoid: false } 293.FirstOrDefault(m => m is { IsStatic: true, Parameters.Length: 1, ReturnsVoid: false } 302.FirstOrDefault(m => m is { IsStatic: true, Parameters.Length: 1, ReturnsVoid: false } 314.FirstOrDefault(m => m is { IsStatic: true, Parameters.Length: 2, ReturnsVoid: false } 325.Where(m => m is { IsStatic: true, Parameters.Length: 3, ReturnsVoid: false } 346.FirstOrDefault(m => m is { IsStatic: true, Parameters.Length: 1, ReturnsVoid: false, ReturnType: INamedTypeSymbol returnType } 356.FirstOrDefault(m => m is { IsStatic: true, Parameters.Length: 2, ReturnsVoid: false, ReturnType: INamedTypeSymbol returnType } 366.FirstOrDefault(m => m is { IsStatic: true, Parameters.Length: 2, ReturnsVoid: false } 376.FirstOrDefault(m => m is { IsStatic: true, Parameters.Length: 2, ReturnsVoid: false } 386.FirstOrDefault(m => m is { IsStatic: true, Parameters.Length: 1, ReturnsVoid: false, ReturnType: INamedTypeSymbol returnType } 396.FirstOrDefault(m => m is { IsStatic: true, Parameters.Length: 2, ReturnsVoid: false, ReturnType: INamedTypeSymbol returnType } 565.FirstOrDefault(m => m is { IsStatic: false, Parameters.Length: 1, ReturnsVoid: true } 576.Where(m => m is { IsStatic: false, Parameters.Length: 2, ReturnsVoid: true } 594.FirstOrDefault(m => m is { IsStatic: false, Parameters.Length: 0, ReturnsVoid: false, ReturnsByRef: false, ReturnsByRefReadonly: false } 602.FirstOrDefault(m => m is { IsStatic: false, Parameters.Length: 0, ReturnsVoid: false, ReturnsByRef: false, ReturnsByRefReadonly: false } 610.FirstOrDefault(m => m is { IsStatic: false, Parameters.Length: 0, ReturnsVoid: false, ReturnsByRef: false, ReturnsByRefReadonly: false }); 617.Where(m => m is { IsStatic: false, Parameters.Length: 1, ReturnsVoid: true }) 656.FirstOrDefault(m => m is { IsStatic: false, Parameters.Length: 0, ReturnsVoid: true }); 663.FirstOrDefault(m => m is { IsStatic: false, Parameters.Length: 0, ReturnsVoid: true }); 690.FirstOrDefault(m => m is { IsStatic: false, Parameters.Length: 0, ReturnsVoid: false, ReturnType: INamedTypeSymbol returnType } 699.FirstOrDefault(m => m is { IsStatic: false, Parameters.Length: 0, ReturnsVoid: false, ReturnType: INamedTypeSymbol returnType } 708.FirstOrDefault(m => m is { IsStatic: false, Parameters.Length: 1, ReturnsVoid: false, ReturnType: INamedTypeSymbol returnType } 718.FirstOrDefault(m => m is { IsStatic: false, Parameters.Length: 1, ReturnsVoid: false, ReturnType: INamedTypeSymbol returnType }
Microsoft.VisualStudio.LanguageServices (2)
ProjectSystem\AbstractEntryPointFinder.cs (1)
46if (symbol.ReturnsVoid)
Venus\ContainedLanguageCodeSupport.cs (1)
378if (!method.ReturnsVoid)
Microsoft.VisualStudio.LanguageServices.VisualBasic (8)
CodeModel\VisualBasicCodeModelService.vb (1)
2546Return If(symbol.ReturnsVoid, EnvDTE.vsCMFunction.vsCMFunctionSub, EnvDTE.vsCMFunction.vsCMFunctionFunction)
ObjectBrowser\DescriptionBuilder.vb (7)
39If delegateInvokeMethod.ReturnsVoid Then 61If Not delegateInvokeMethod.ReturnsVoid Then 155If Not methodSymbol.ReturnsVoid Then 179If methodSymbol.ReturnsVoid Then 204If Not methodSymbol.ReturnsVoid Then 215If methodSymbol.ReturnsVoid Then 234If Not methodSymbol.ReturnsVoid Then
Mvc.Api.Analyzers.Test (1)
MvcFactsTest.cs (1)
185var method = typeSymbol.GetMembers(nameof(IDisposable.Dispose)).OfType<IMethodSymbol>().First(f => !f.ReturnsVoid);