1 override of ConstructorDeclaration
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
356public override SyntaxNode ConstructorDeclaration(
40 references to ConstructorDeclaration
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (20)
CodeGeneration\SyntaxGeneratorTests.cs (20)
1008Generator.ConstructorDeclaration(), 1012Generator.ConstructorDeclaration("c"), 1016Generator.ConstructorDeclaration("c", accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Static), 1566Generator.ClassDeclaration("c", members: [Generator.ConstructorDeclaration()]), 1602Generator.StructDeclaration("s", members: [Generator.ConstructorDeclaration("xxx")]), 2880Assert.Equal(DeclarationKind.Constructor, Generator.GetDeclarationKind(Generator.ConstructorDeclaration())); 2903Assert.Equal("", Generator.GetName(Generator.ConstructorDeclaration())); 2926Assert.Equal("", Generator.GetName(Generator.WithName(Generator.ConstructorDeclaration(), ".ctor"))); 2949Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.ConstructorDeclaration(accessibility: Accessibility.Internal))); 2973Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.ConstructorDeclaration(accessibility: Accessibility.Internal), Accessibility.Private))); 2997Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.ConstructorDeclaration(modifiers: DeclarationModifiers.Static))); 3020Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.WithModifiers(Generator.ConstructorDeclaration(), DeclarationModifiers.Static))); 3066Generator.GetModifiers(Generator.WithModifiers(Generator.ConstructorDeclaration("c"), allModifiers))); 3100var ctor = Generator.ConstructorDeclaration("C", modifiers: DeclarationModifiers.Static); 3114var ctor = Generator.ConstructorDeclaration("C", accessibility: Accessibility.Public); 3240Assert.Equal(0, Generator.GetParameters(Generator.ConstructorDeclaration()).Count); 3264Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.ConstructorDeclaration(), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3544Assert.Equal(0, Generator.GetStatements(Generator.ConstructorDeclaration()).Count); 3545Assert.Equal(2, Generator.GetStatements(Generator.ConstructorDeclaration(statements: stmts)).Count); 3569Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.ConstructorDeclaration(), stmts)).Count);
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (19)
CodeGeneration\SyntaxGeneratorTests.vb (19)
1372Generator.ConstructorDeclaration("c"), 1377Generator.ConstructorDeclaration("c", accessibility:=Accessibility.Public, modifiers:=DeclarationModifiers.Static), 1382Generator.ConstructorDeclaration("c", parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))}), 1387Generator.ConstructorDeclaration("c", 1501members:={Generator.ConstructorDeclaration(accessibility:=Accessibility.NotApplicable, modifiers:=DeclarationModifiers.None)}), 2573Assert.Equal(DeclarationKind.Constructor, Generator.GetDeclarationKind(Generator.ConstructorDeclaration())) 2598Assert.Equal("", Generator.GetName(Generator.ConstructorDeclaration())) 2623Assert.Equal("", Generator.GetName(Generator.WithName(Generator.ConstructorDeclaration(), ".ctor"))) 2647Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.ConstructorDeclaration(accessibility:=Accessibility.Internal))) 2675Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.ConstructorDeclaration(accessibility:=Accessibility.Internal), Accessibility.Private))) 2702Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.ConstructorDeclaration(modifiers:=DeclarationModifiers.Static))) 2724Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.WithModifiers(Generator.ConstructorDeclaration(), DeclarationModifiers.Static))) 2840Assert.Equal(0, Generator.GetParameters(Generator.ConstructorDeclaration()).Count) 2841Assert.Equal(1, Generator.GetParameters(Generator.ConstructorDeclaration(parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count) 2842Assert.Equal(2, Generator.GetParameters(Generator.ConstructorDeclaration(parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))})).Count) 2865Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.ConstructorDeclaration(), {Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count) 2968Assert.Equal(0, Generator.GetStatements(Generator.ConstructorDeclaration()).Count) 2969Assert.Equal(2, Generator.GetStatements(Generator.ConstructorDeclaration(statements:=stmts)).Count) 2987Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.ConstructorDeclaration(), stmts)).Count)
Microsoft.CodeAnalysis.Workspaces (1)
Editing\SyntaxGenerator.cs (1)
560return ConstructorDeclaration(