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

   **Problem**
   
    When a Gradle-based Grails project is opened, the Grails toolbar actions 
(navigation shortcuts between domain classes, controllers, services, views and 
tests) stay disabled. They only  become active after manually triggering a 
Gradle re-sync (e.g. by touching build.gradle and reimporting), which has to be 
done every time the project is opened.
   
   **Root cause**
   
   GrailsStartupActivity queues the Grails application detection 
(GrailsApplicationManager.queueUpdate()) as soon as the project opens. For 
Gradle projects, however, detection relies on   external system project data 
(GrailsModuleData attached during Gradle sync), which is loaded asynchronously 
after project open. At the moment the startup activity runs, that data is not   
available yet, so no Grails application is detected — and since nothing 
re-triggers detection afterwards, the plugin stays inactive until the next 
manual Gradle sync repopulates the data.
   
   **Solution**
   
   In GrailsStartupActivity, re-queue the detection once the external system 
data becomes available, using ExternalProjectsManager.runWhenInitialized():
   
   ```
     ExternalProjectsManager.getInstance(project).runWhenInitialized(() -> {
       GrailsApplicationManager.getInstance(project).queueUpdate();
       TraitInjectorService.queueUpdate(project);
     });
   ```
   
   If the external system is already initialized, the callback runs 
immediately, so the behavior for non-Gradle projects and warm starts is 
unchanged. With this change, Grails applications  are detected right after 
project open and the toolbar actions are enabled without any manual re-sync.
   
   **Testing**
   
   Verified with ./gradlew runIde on IntelliJ IDEA Ultimate 2026.2: opening a 
Gradle-based Grails project now enables the toolbar actions immediately after 
startup, without forcing a Gradle  re-sync.
   


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