5 implementations of Constructors
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
88public abstract ImmutableArray<IMethodSymbol> Constructors { get; }
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\NamedTypeSymbol.cs (1)
48ImmutableArray<IMethodSymbol> INamedTypeSymbol.Constructors
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
83public ImmutableArray<IMethodSymbol> Constructors => _symbol.Constructors;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\NamedTypeSymbol.vb (1)
1429Private ReadOnly Property INamedTypeSymbol_Constructors As ImmutableArray(Of IMethodSymbol) Implements INamedTypeSymbol.Constructors
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
88public abstract ImmutableArray<IMethodSymbol> Constructors { get; }
36 references to Constructors
Microsoft.Analyzers.Extra (1)
CallAnalysis\CallAnalyzer.Registrar.cs (1)
116foreach (var ctor in type.Constructors)
Microsoft.Analyzers.Local (1)
CallAnalysis\CallAnalyzer.Registrar.cs (1)
116foreach (var ctor in type.Constructors)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
StaticRouteHandlerModel\EndpointParameter.cs (1)
469var constructors = type.Constructors.Where(constructor => constructor.DeclaredAccessibility == Accessibility.Public && !constructor.IsStatic);
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.State.cs (2)
95if (classType.Constructors.Any(static c => c.Parameters.Length == 0 && c.IsImplicitlyDeclared)) 97var baseNoArgConstructor = baseType.Constructors.FirstOrDefault(c => c.Parameters.Length == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructedNamedTypeSymbol.cs (1)
83return this.OriginalDefinition.Constructors;
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
325var constructors = namedType.Constructors;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (5)
OverloadResolutionPriorityTests.cs (1)
801var constructors = derived.Constructors;
Semantics\PrimaryConstructorTests.cs (4)
3250Assert.True(c.Constructors.All(ctor => ctor.GetAttributes().IsEmpty)); 3251Assert.True(c.Constructors.All(ctor => ctor.GetReturnTypeAttributes().IsEmpty)); 3380Assert.True(c.Constructors.All(ctor => ctor.GetAttributes().IsEmpty)); 3401Assert.True(c.Constructors.All(ctor => ctor.GetAttributes().IsEmpty));
Microsoft.CodeAnalysis.CSharp.Features (3)
Debugging\BreakpointResolver.cs (1)
30return (type.Name == name) ? members.Concat(type.Constructors) : members;
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
203=> containingType.Constructors.SelectMany(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
325var constructors = namedType.Constructors;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Symbols\Source\RecordTests.cs (2)
1126Assert.Equal(new[] { "C..ctor(System.Int32 X, System.Int32 Y)", "C..ctor(C original)" }, comp.GetTypeByMetadataName("C")!.Constructors.Select(m => m.ToTestDisplayString())); 1155Assert.Equal(new[] { "C..ctor(System.Int32 X, System.Int32 Y)", "C..ctor(C original)" }, comp.GetTypeByMetadataName("C")!.Constructors.Select(m => m.ToTestDisplayString()));
Microsoft.CodeAnalysis.Features (3)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
83public ImmutableArray<IMethodSymbol> Constructors => _symbol.Constructors;
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.State.cs (2)
95if (classType.Constructors.Any(static c => c.Parameters.Length == 0 && c.IsImplicitlyDeclared)) 97var baseNoArgConstructor = baseType.Constructors.FirstOrDefault(c => c.Parameters.Length == 0);
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\NamedTypeSymbol.vb (1)
1429Private ReadOnly Property INamedTypeSymbol_Constructors As ImmutableArray(Of IMethodSymbol) Implements INamedTypeSymbol.Constructors
Microsoft.CodeAnalysis.VisualBasic.Features (4)
Completion\CompletionProviders\CrefCompletionProvider.vb (1)
188For Each constructor In namedTypeContainer.Constructors
Debugging\BreakpointResolver.vb (1)
25members.Concat(type.Constructors),
EncapsulateField\VisualBasicEncapsulateFieldService.vb (1)
132Return containingType.Constructors.
NavigationBar\VisualBasicNavigationBarItemService.vb (1)
211Dim constructors = type.Constructors
Microsoft.CodeAnalysis.Workspaces (7)
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (1)
39Add(result, symbol.Constructors);
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (1)
85foreach (var constructor in containingType.Constructors)
FindSymbols\SymbolFinder.cs (1)
294linkedSymbol = linkedNamedType.Constructors.FirstOrDefault(
Shared\Extensions\ISymbolExtensions.cs (1)
479return baseType.Constructors.Where(c => IsSameSignature(methodSymbol, c)).FirstOrDefault();
Shared\Utilities\EditorBrowsableHelpers.cs (2)
42var candidateConstructors = editorBrowsableAttributeType.Constructors 107var candidateConstructors = typeLibAttributeType.Constructors
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructedNamedTypeSymbol.cs (1)
83return this.OriginalDefinition.Constructors;
Microsoft.Extensions.Options.SourceGeneration (2)
Parser.cs (2)
373if (transValidatorType.Constructors.Where(c => !c.Parameters.Any()).Any()) 436if (enumerationValidatorType.Constructors.Where(c => c.Parameters.Length == 0).Any())
System.Text.Json.SourceGeneration (2)
Helpers\RoslynExtensions.cs (1)
117=> type.Constructors.Where(ctor => !ctor.IsStatic && !(ctor.IsImplicitlyDeclared && type.IsValueType && ctor.Parameters.Length == 0));
JsonSourceGenerator.Parser.cs (1)
1581!namedConverterType.Constructors.Any(c => c.Parameters.Length == 0 && IsSymbolAccessibleWithin(c, within: contextType)))