dsl-api-generator icon indicating copy to clipboard operation
dsl-api-generator copied to clipboard

Support for adding a new property to an existing class

Open drewhamilton opened this issue 5 years ago • 1 comments

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 😄)

drewhamilton avatar May 28 '20 14:05 drewhamilton

😅 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.

Hariofspades avatar May 28 '20 15:05 Hariofspades