apache / apache/grails-intellij-plugin
IDEA 2016 doesn't resolve model variables in the Grails 3 views (GSP)
- Dominant language
- Java
- Stars
- 17
- Forks
- 4
- Avg merge
- 5d 15h
- Merged PRs (30d)
- 4
Description
Issue no 1:
Variables passed from controller to GSP view are not resolved in the view, ie no variable/method completion is available, and/or "click to navigate".
Example code in the image attached: "instance" and "all" are underlined.
It seems this is the same issue reported in [https://youtrack.jetbrains.com/issue/IDEA-49731](https://youtrack.jetbrains.com/issue/IDEA-49731) and [https://youtrack.jetbrains.com/issue/IDEA-40926](https://youtrack.jetbrains.com/issue/IDEA-40926), however it seems not solved in IDEA 2016.1.3 running a Grails 3.1.9 project on Linux/Open JDK 1.8.0_91.
Issue no 2:
The navigation method described here: [https://www.jetbrains.com/help/idea/2016.1/getting-started-with-grails-3.html](https://www.jetbrains.com/help/idea/2016.1/getting-started-with-grails-3.html)
doesn't work fully: when in the controller class code, if I hit CTRL+ALT+HOME it goes directly to the auto-generated test class.
If I'm in the Domain class, it shows the popup menu with: Controller and Test class.
If I'm in the GSP view, it doesn't do anything at all.
Issue no 3:
Certain Domain class Grails methods are not recognized. I think I've seen this one reported elsewhere.
In my screenshot, Test.save() and Test.list() are not recognized, although Test.listOrderBy...() is.
Issue no 4:
Changes in the controller are not reloaded, despite the message:
File /home/<hidden-personal-data>/IdeaProjects/First/grails-app/controllers/first/TestController.groovy changed, recompiling...
and the setting: Reload classes after compilation: Always.
Workaround is this (found on Stackoverflow), assuming the project is run from Application.main():
Edit Configurations -> Application -> VM Options -> add this:
```
-noverify
-javaagent:/home//.sdkman/candidates/grails/3.1.9/lib/org.springframework/springloaded/jars/springloaded-1.2.6.RELEASE.jar
```
Issue no 5:
There's no auto-completion for the Grails tags attributes. In the example, <g:each _cursor here_ > hitting CTRL-SPACE pops "No suggestions".
And a suggestion for the end: please compile a list of known issues related to Grails 3, so that your users can read the page and the occasional workaround instead of wasting time. Adding IDE related frustrations to Grails 2 -> 3 upgrade head scratching is not good for health.
---
*Imported from [IDEA-158134](https://youtrack.jetbrains.com/issue/IDEA-158134) · Type: Bug · Votes: 1*
*Comments, attachments, dates and reporter are not part of the export — follow the link above for the full history.*
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the five reported problems in a Grails 3.1.9 project: GSP variable and tag completion, controller/domain/GSP navigation, Domain methods such as Test.save() and Test.list(), and controller reloading from Application.main(). Compare the behavior with the linked IDEA documentation and YouTrack issues; done would require a scoped fix or separate actionable issues for the affected features.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy, java
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100