2 implementations of IsOptional
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\ParameterSymbol.cs (1)
71bool IParameterSymbol.IsOptional => _underlying.IsOptional;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\ParameterSymbol.vb (1)
336Private ReadOnly Property IParameterSymbol_IsOptional As Boolean Implements IParameterSymbol.IsOptional
50 references to IsOptional
Microsoft.AspNetCore.App.Analyzers (1)
RouteHandlers\DetectMismatchedParameterOptionality.cs (1)
32var argumentIsOptional = parameter.IsOptional || parameter.NullableAnnotation != NullableAnnotation.NotAnnotated;
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
308isOptional ?? parameter.IsOptional,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (2)
32parameter.IsOptional, 47parameter.IsOptional,
Microsoft.CodeAnalysis.CSharp (2)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (2)
806if (includeBrackets && symbol.IsOptional) 873if (includeBrackets && symbol.IsOptional)
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
360GetAccessibleInstanceConstructor(constructors, c => c.Parameters.All(p => p.IsOptional || p.IsParams));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
484argumentOpt == null && info.Symbol is IMethodSymbol method && method.Parameters.All(p => p.IsOptional || p.IsParams)) 753var minParameterCount = parameterList.Count(p => !p.IsParams && !p.IsOptional);
Microsoft.CodeAnalysis.CSharp.Features (4)
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (1)
190if (fieldOrProperty is IPropertySymbol property && property.Parameters.Any(static p => !p.IsOptional))
SignatureHelp\AbstractCSharpSignatureHelpProvider.cs (1)
52parameter.IsOptional,
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_DelegateAndFunctionPointerInvoke.cs (1)
89parameter.IsOptional,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
360GetAccessibleInstanceConstructor(constructors, c => c.Parameters.All(p => p.IsOptional || p.IsParams));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (5)
Semantics\LambdaTests.cs (5)
8019Assert.False(lambdas[0].Symbol.Parameters[0].IsOptional); 8022Assert.True(lambdas[0].Symbol.Parameters[1].IsOptional); 8029Assert.True(lambdas[1].Symbol.Parameters[0].IsOptional); 8036Assert.False(lambdas[2].Symbol.Parameters[0].IsOptional); 8043Assert.True(lambdas[3].Symbol.Parameters[0].IsOptional);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
484argumentOpt == null && info.Symbol is IMethodSymbol method && method.Parameters.All(p => p.IsOptional || p.IsParams)) 753var minParameterCount = parameterList.Count(p => !p.IsParams && !p.IsOptional);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Completion\AbstractArgumentProviderTests`1.cs (1)
113=> parameters.Count(parameter => !parameter.IsOptional && !parameter.IsParams);
Microsoft.CodeAnalysis.Features (5)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (2)
100return _missingParameters[0].IsOptional 113internal string ActionName => _missingParameters[0].IsOptional
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.cs (1)
143=> parameters.Length == 0 || !parameters.Last().IsOptional;
GoToBase\AbstractGoToBaseService.cs (1)
28baseConstructor.Parameters.All(p => p.IsOptional || p.IsParams));
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
649if (symbol.IsOptional)
Microsoft.CodeAnalysis.VisualBasic (3)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (2)
521If symbol.IsOptional Then 565If symbol.IsOptional Then
Symbols\ParameterSymbol.vb (1)
336Private ReadOnly Property IParameterSymbol_IsOptional As Boolean Implements IParameterSymbol.IsOptional
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EventGenerator.vb (1)
191If Not parameter.IsOptional AndAlso Not parameter.IsParams Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (2)
84If parameter.IsOptional OrElse seenOptional Then 92If parameter.HasExplicitDefaultValue OrElse parameter.IsOptional OrElse seenOptional Then
Microsoft.CodeAnalysis.VisualBasic.Features (2)
SignatureHelp\AbstractVisualBasicSignatureHelpProvider.vb (1)
46parameter.IsOptional,
SignatureHelp\FunctionAggregationSignatureHelpProvider.vb (1)
162parameter.IsOptional,
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EventGenerator.vb (1)
191If Not parameter.IsOptional AndAlso Not parameter.IsParams Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (2)
84If parameter.IsOptional OrElse seenOptional Then 92If parameter.HasExplicitDefaultValue OrElse parameter.IsOptional OrElse seenOptional Then
Microsoft.CodeAnalysis.Workspaces (9)
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (2)
222var minimumArgumentCount = symbol.Parameters.Count(static p => !p.IsOptional && !p.IsParams); 227var exactArgumentCount = symbol.Parameters.Any(static p => p.IsOptional || p.IsParams)
Rename\ConflictEngine\DeclarationConflictHelpers.cs (1)
106if (trimOptionalParameters && parameter.IsOptional)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
308isOptional ?? parameter.IsOptional,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (2)
73CodeGenerationSymbolFactory.CreateParameterSymbol(p.GetAttributes(), p.RefKind, p.IsParams, p.Type.SubstituteTypes(mapping, typeGenerator), p.Name, p.IsOptional, 170p.RefKind, p.IsParams, p.Type, p.Name, p.IsOptional,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (2)
32parameter.IsOptional, 47parameter.IsOptional,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (1)
63p.RefKind, p.IsParams, p.Type, p.Name, p.IsOptional,
Microsoft.Gen.Logging (1)
Parsing\Parser.TagProvider.cs (1)
142if (!method.Parameters[i].IsOptional)
Microsoft.VisualStudio.LanguageServices.CSharp (2)
ObjectBrowser\DescriptionBuilder.cs (2)
422if (current.IsOptional) 458if (current.IsOptional)
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
ObjectBrowser\DescriptionBuilder.vb (1)
411If current.IsOptional Then