IntelliJ - Better IDE Support
Issue description
Placeholder ticket to discuss issues with current IntelliJ integration and how we can help provide better IDE support. Please consider voting for these issues on JetBrain's tracker to help us get better IDE support.
Known IntelliJ Bugs
BLOCKER
- IDE Lockups for Grails-core if Grails plugin enabled IDEA-366647
High Priority
- Attach Sources Issues - 'Attach Roots' dialog after downloading library sources in a Gradle-based project - IDEA-363773
- Tag Libs - cannot
go to declarationunless sources are downloaded - IDEA-364650 - Ambiguous Method Calls IDEA-354989 -
renderis reported as an ambiguous method call in IntelliJ becauserender(obj)andrender(Map map)exist. IntelliJ does not complain about this if these methods types are added in your project, but when referencing the grailsrender()method, it complains. This issue has popped up several times: ~~IDEA-216095~~, ~~IDEA-218748~~ - ✅ Completed - Update IntelliJ Grails plugin for Apache Changes: https://youtrack.jetbrains.com/issue/IDEA-372363/Update-Grails-Plugin-to-support-Apache-Grails-changes & https://youtrack.jetbrains.com/issue/IDEA-373638/Support-recognization-of-Grails-7-when-importing-from-Gradle, resolved in 2025.2 EAP+ with plugin version 252.19874.12+
Lower Priority
- Tag Libs - attribute
go tosupport - IDEA-199021 - Better decompile support for java 17 & groovy - IDEA-365803
Groovy Specific Issues (no specific priority)
- Alignment for Map Constructors IDEA-347599
- static property exceeds access rights IDEA-331870
- AST Browser IDEA-178233
Work Around Available
- Intellij Does not resolve gradle API classes - wrong gradle distribution selected (use
allinstead ofbinif using gradle via wrapper OR use a local gradle distribution with the sources)
Tag Libs - go to declaration
Reached out to intellij's support because tag libs inside of a project seem to support go to declaration, while tag libs outside of the project don't always resolve (for example the asset plugin or the spring security core plugin tags)
Open ticket IDEA-199021
Tested in Grails 6.2.2
Fields plugin tags do not autocomplete and show up red. asset:image,asset:link,asset:stylesheet... asset pipeline tags to not autocomplete and show up in red
Seems like base tags are back to clicking into source again. I was previously ending up in an xml file. g:form clicks into FormTagLib.groovy as expected g:if clicks into GroovyIfTag as expected g:message clicks into ValidationTagLib as expected g:link works.
Do we have an example of any Plugin that has working autocomplete tags? @jdaugherty have you tried Grails 5.x? Perhaps something else was removed that broke everything similar to how shell removal in 6.2.x broke the IntelliJ plugin
Intellij Does not resolve gradle API classes
If the project is setup with a gradle distribution of 'bin' instead of 'all' in the wrapper properties:
Intellij won't find the gradle source files. We should consider either specifying 'all' for our projects, adding a gradle wrapper task, or as part of .sdkmanrc add gradle. The downside of using 'all' is it's a 200mb download. Maybe this is a reason to use .sdkmanrc gradle define?
I've updated the ticket description for more IDEA tickets to document the problems found by go to research on the tag libs.
I added https://youtrack.jetbrains.com/issue/IDEA-342753 to the list of issues since it seems to be persistent under some circumstances. It may actually be fixed in environments that are setup from scratch.
I noticed that IntelliJ is not decompiling certain code that was transformed by an AST. Grails makes heavy use of this so I opened https://youtrack.jetbrains.com/issue/IDEA-365803/Better-Decompile-Support-for-Groovy-Classes-that-had-AST-Transformations
Reorganized the initial ticket description since we're starting to collect quite a few of these. I also organized them into high priority / low priority / work around available.
Seems like debugging Groovy in IntelliJ is now a nightmare. In one method call, there is literally 28 useless submethods in a stack trace.