jdaugherty opened a new pull request, #446: URL: https://github.com/apache/grails-intellij-plugin/pull/446
`@Scaffold` generates no methods. Grails' ScaffoldingControllerInjector and ScaffoldingServiceInjector replace the class's superclass at compile time (Object becomes RestfulController<Domain> or GormService<Domain>, or the base named in the annotation) and add a no-arg constructor. The IDE knew nothing of this, so a scaffolded controller showed no actions, a hand written `def show()` carried no "overrides" marker, and nothing told the user what the annotation had done. ScaffoldTransformationSupport sets the same superclass on the PSI through the Groovy astTransformationSupport extension point, reading the annotation the way the injectors do: @Scaffold(Domain), @Scaffold(Base<Domain>), @Scaffold(value = Base, domain = Domain), the `domain` attribute alone, and the deprecated `static scaffold = Domain`. A class with its own superclass is left alone, as the compiler rejects it. Completion, navigation, the override gutter marker and the structure view's inherited members then come from the platform. ScaffoldInlayHintsProvider shows what was added: `extends RestfulController<Quest>` after the class name, and the inherited methods as greyed lines above the class's closing brace, indented like its own members, with the base's type parameter replaced by the domain. Above each method a comment names the annotation responsible, as written in the file (`// @Scaffold(Quest) - inherited from RestfulController<Quest>`), and links back to it; a blank line separates the groups. A method the class declares drops out, leaving the platform's override marker. Compiled Groovy bases carry trait methods and property accessors as public methods, so the listing skips @Generated members, accessors and `$` names. ScaffoldStructureViewExtension lists the same methods under the class node in the Structure view, greyed and located in the base, without "Show Inherited"; with that toggle on the platform lists them itself, so the extension adds nothing then. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
