matrei opened a new pull request, #431:
URL: https://github.com/apache/grails-intellij-plugin/pull/431

   Adds editor support for the Grails 8 compile-time beans DSL 
(`grails.compiler.beans.GrailsBeans`), and registers the beans it declares in 
the Spring model.
   
   ## What the DSL is
   
   A `beans` closure property compiled into real `@Bean` factory methods. It is 
recognised on:
   
   - classes annotated with `@GrailsBeans`
   - plugin descriptors (`grails.plugins.Plugin`)
   - the application class (`grails.boot.config.GrailsAutoConfiguration`)
   - unit tests (`org.grails.testing.GrailsUnitTest`)
   
   Its top-level statements are `bean(...)`, `field(...)`, `method(...)` and 
`group(...)` declarations, each optionally followed by a qualifier chain 
(`.primary()`, `.lazy()`, `.scope(...)`, `.conditionalOn*(...)`, 
`.aliases(...)`, `.typeArguments(...)`, `.annotate(...)`, `.value(...)`, ...).
   
   Nothing is recognised unless the `GrailsBeans` annotation is on the class 
path, so pre-8 projects are unaffected.
   
   ## Changes
   
   - **`GrailsBeansDsl`** (main plugin, Community Edition): models the DSL. It 
finds the hosts and their `beans` closure, parses declarations and qualifier 
chains, and derives names (folding String constants and `static final` 
references, otherwise decapitalising the type name) and types (including 
`.typeArguments(...)`). It also extracts bean descriptors.
   - **`GrailsBeansDslMemberContributor`** (main plugin, Community Edition): 
handles resolution, completion and documentation.
     - Declarations are available directly in a `beans` closure or in a `group` 
body.
     - Each declaration kind gets its own qualifiers: `field(...)` offers 
`value`, but not `primary` or `conditionalOn*`.
     - Inside `bean`/`method` bodies, the `field(...)`/`method(...)` members 
declared beside them are available, with their types, parameters and navigation 
to the declaration.
     - Group members are scoped to their group, and declarations do not leak 
into bean bodies.
   - **`GrailsSpringBeanDiscoverer`** (`spring` module, Ultimate): adds the 
DSL-declared beans of every host in the module to the Spring model, so they can 
be injected by name like `resources.groovy` beans.
   - `CE-SUPPORT.md` lists the DSL among the features that work in Community 
Edition.
   
   ## Tests
   
   - `GrailsBeansDslTest` (new): covers the following.
     - Resolution in each host kind.
     - Unresolved qualifiers and misplaced declarations.
     - Scoping of the DSL and of shared members.
     - Shared member types and navigation.
     - Highlighting with the assignability inspection.
     - Completion of declarations, qualifiers and shared members.
     - Bean descriptor extraction.
   - `GrailsSpringIntegrationTest.testBeansDslBeanInjection`: DSL-declared 
beans, including one inside a conditional group, are injected into a controller 
by name.
   
   Fixes #430
   


-- 
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]

Reply via email to