dsl-api-generator
dsl-api-generator copied to clipboard
Support for adding a new property to an existing class
Once we've created one of these DSL classes, we may later want to add a new property. If possible, it would be great to support generating the property, the builder property, the builder setter, and the addition of the property to the builder build function.
(On Slack you mentioned some challenges so feel free to enumerate those here 😄)
😅 Challenges on this:
- I wouldn't know the exact position to insert the property. All I have is the cursor position.
But a super simple solution I could think right now for this use case would be to generate the following at the cursor position
- Immutable property
- Mutable property
- Set method
- Comment
So, the developer just needs to copy and paste this at the respective place. Right now Class Name is mandatory. If there is no class name, we could generate just properties.