Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(inits): .NET semantic fixes for init templates #5154

Merged
merged 5 commits into from
Nov 22, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .ionide/symbolCache.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace %name.PascalCased%
{
public class %name.PascalCased%Stack : Stack
{
public %name.PascalCased%Stack(Construct scope, string id, IStackProps props = null) : base(scope, id, props)
public %name.PascalCased%Stack(Construct scope, string id) : base(scope, id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RomainMuller pointed out that this would not be a good practice earlier so please hang on until he gets a chance to take a look

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - the best practice is for Stack subclasses fo accept a StackProps parameter and forward it to the base. I wouldn't encourage users to omit this by encoding it in the template.

{
// The code that defines your stack goes here
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace %name.PascalCased%
{
public class %name.PascalCased%Stack : Stack
{
public %name.PascalCased%Stack(Construct parent, string id, IStackProps props = null) : base(parent, id, props)
public %name.PascalCased%Stack(Construct scope, string id) : base(scope, id)
{
// The CDK includes built-in constructs for most resource types, such as Queues and Topics.
var queue = new Queue(this, "%name.PascalCased%Queue", new QueueProps
Expand Down