1 override of ConstructorDeclaration
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
365
public override SyntaxNode
ConstructorDeclaration
(
42 references to ConstructorDeclaration
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (20)
CodeGeneration\SyntaxGeneratorTests.cs (20)
1090
Generator.
ConstructorDeclaration
(),
1094
Generator.
ConstructorDeclaration
("c"),
1098
Generator.
ConstructorDeclaration
("c", accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Static),
1648
Generator.ClassDeclaration("c", members: [Generator.
ConstructorDeclaration
()]),
1684
Generator.StructDeclaration("s", members: [Generator.
ConstructorDeclaration
("xxx")]),
2962
Assert.Equal(DeclarationKind.Constructor, Generator.GetDeclarationKind(Generator.
ConstructorDeclaration
()));
2985
Assert.Equal("", Generator.GetName(Generator.
ConstructorDeclaration
()));
3008
Assert.Equal("", Generator.GetName(Generator.WithName(Generator.
ConstructorDeclaration
(), ".ctor")));
3031
Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.
ConstructorDeclaration
(accessibility: Accessibility.Internal)));
3055
Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.
ConstructorDeclaration
(accessibility: Accessibility.Internal), Accessibility.Private)));
3079
Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.
ConstructorDeclaration
(modifiers: DeclarationModifiers.Static)));
3102
Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.WithModifiers(Generator.
ConstructorDeclaration
(), DeclarationModifiers.Static)));
3148
Generator.GetModifiers(Generator.WithModifiers(Generator.
ConstructorDeclaration
("c"), allModifiers)));
3182
var ctor = Generator.
ConstructorDeclaration
("C", modifiers: DeclarationModifiers.Static);
3196
var ctor = Generator.
ConstructorDeclaration
("C", accessibility: Accessibility.Public);
3322
Assert.Equal(0, Generator.GetParameters(Generator.
ConstructorDeclaration
()).Count);
3346
Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.
ConstructorDeclaration
(), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3626
Assert.Equal(0, Generator.GetStatements(Generator.
ConstructorDeclaration
()).Count);
3627
Assert.Equal(2, Generator.GetStatements(Generator.
ConstructorDeclaration
(statements: stmts)).Count);
3651
Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.
ConstructorDeclaration
(), stmts)).Count);
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (19)
CodeGeneration\SyntaxGeneratorTests.vb (19)
1372
Generator.
ConstructorDeclaration
("c"),
1377
Generator.
ConstructorDeclaration
("c", accessibility:=Accessibility.Public, modifiers:=DeclarationModifiers.Static),
1382
Generator.
ConstructorDeclaration
("c", parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))}),
1387
Generator.
ConstructorDeclaration
("c",
1501
members:={Generator.
ConstructorDeclaration
(accessibility:=Accessibility.NotApplicable, modifiers:=DeclarationModifiers.None)}),
2573
Assert.Equal(DeclarationKind.Constructor, Generator.GetDeclarationKind(Generator.
ConstructorDeclaration
()))
2598
Assert.Equal("", Generator.GetName(Generator.
ConstructorDeclaration
()))
2623
Assert.Equal("", Generator.GetName(Generator.WithName(Generator.
ConstructorDeclaration
(), ".ctor")))
2647
Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.
ConstructorDeclaration
(accessibility:=Accessibility.Internal)))
2675
Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.
ConstructorDeclaration
(accessibility:=Accessibility.Internal), Accessibility.Private)))
2702
Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.
ConstructorDeclaration
(modifiers:=DeclarationModifiers.Static)))
2724
Assert.Equal(DeclarationModifiers.Static, Generator.GetModifiers(Generator.WithModifiers(Generator.
ConstructorDeclaration
(), DeclarationModifiers.Static)))
2840
Assert.Equal(0, Generator.GetParameters(Generator.
ConstructorDeclaration
()).Count)
2841
Assert.Equal(1, Generator.GetParameters(Generator.
ConstructorDeclaration
(parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count)
2842
Assert.Equal(2, Generator.GetParameters(Generator.
ConstructorDeclaration
(parameters:={Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))})).Count)
2865
Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.
ConstructorDeclaration
(), {Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count)
2968
Assert.Equal(0, Generator.GetStatements(Generator.
ConstructorDeclaration
()).Count)
2969
Assert.Equal(2, Generator.GetStatements(Generator.
ConstructorDeclaration
(statements:=stmts)).Count)
2987
Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.
ConstructorDeclaration
(), stmts)).Count)
Microsoft.CodeAnalysis.Workspaces (1)
Editing\SyntaxGenerator.cs (1)
559
return
ConstructorDeclaration
(
Roslyn.Diagnostics.Analyzers (2)
AbstractCreateTestAccessor`1.cs (1)
85
var testAccessorConstructor = syntaxGenerator.
ConstructorDeclaration
(
ExportedPartsShouldHaveImportingConstructorCodeFixProvider.cs (1)
110
var importingConstructor = generator.
ConstructorDeclaration
(