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

aws-cdk-go-v2: default values not present in documentation #3885

Closed
a-h opened this issue Dec 14, 2022 · 2 comments · Fixed by #4115
Closed

aws-cdk-go-v2: default values not present in documentation #3885

a-h opened this issue Dec 14, 2022 · 2 comments · Fixed by #4115
Labels
effort/medium Medium work item – a couple days of effort feature-request A feature should be added or improved. p2

Comments

@a-h
Copy link
Contributor

a-h commented Dec 14, 2022

Describe the bug

In the TypeScript CDK, default values are displayed during LSP autocomplete:

Here, you can see the @default field is printed, showing that the default value is 128MB.

Screenshot 2022-12-14 at 13 24 18

In the Go CDK, these default values are not printed, so it's not clear what the value would be if you didn't populate the field.

Screenshot 2022-12-14 at 13 27 39

Expected Behavior

Expected the default values to be displayed in a similar format to the TypeScript variant.

Current Behavior

There are no default values displayed by the LSP.

Reproduction Steps

Create any CDK construct in Go, and trigger autocomplete on an optional field in the construct params struct. You will see that no @default value is displayed.

Possible Solution

The Go language server (gopls) uses the code comments to choose what to display to the user, but there are no default values printed in the Go code. Updating the code generation to include the @default section from the TypeScript code would include the default values in the Go LSP output.

	// The amount of memory, in MB, that is allocated to your Lambda function.
	//
	// Lambda uses this value to proportionally allocate the amount of CPU
	// power. For more information, see Resource Model in the AWS Lambda
	// Developer Guide.
	// Experimental.
	MemorySize *float64 `field:"optional" json:"memorySize" yaml:"memorySize"`

Additional Information/Context

No response

CDK CLI Version

2.54.0 (build 9f41881)

Framework Version

No response

Node.js Version

v16.14.2

OS

MacOS

Language

Go

Language Version

1.19 - but it's not relevant

Other information

No response

@a-h a-h added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 14, 2022
@peterwoodworth
Copy link
Contributor

Thanks for reporting this! I'm going to translate it to the JSII repo where we handle the code conversion. Let's see what they say 🙂

@peterwoodworth peterwoodworth added p2 effort/medium Medium work item – a couple days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Dec 14, 2022
@peterwoodworth peterwoodworth added feature-request A feature should be added or improved. and removed bug This issue is a bug. labels Dec 14, 2022
@peterwoodworth peterwoodworth transferred this issue from aws/aws-cdk Dec 14, 2022
@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/medium Medium work item – a couple days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants