apache / apache/grails-intellij-plugin
Grails GSP auto import inserts fully qualified
- Dominant language
- Java
- Stars
- 17
- Forks
- 4
- Avg merge
- 5d 15h
- Merged PRs (30d)
- 4
Description
## **Steps to reproduce**
1. In a GSP, enter a reference to a class (that is not imported yet in that GSP)
2. Right click: "Show Context Actions"
3. Select "import class"
**Expected result** *(correct result)***:**
It should insert an import of the class at the top of the GSP
**Actual result** *(faulty result)***:**
It does insert an import, but it needlessly changes the class reference to the fully qualified path.
e.g. if I have a class aa.bb.cc.MyClassDD
and I type ${MyClassDD} into a gsp, then do Context Actions -\> Import, then it
adds the \<%@ page import="aa.bb.cc.MyClassDD"\> up the top (correct)
but it needlessly changes ${MyClassDD} to be ${aa.bb.cc.MyClassDD}
Just like regular java code or groovy code, once you import a class, there is no reason to use the full class name in the body of the text.
## **Environment**
*OS version: Windows and Linux*
*IDE version (you can check via* *About dialog in the Help or App menu):*
2025.1 EAP
---
*Imported from [IDEA-368164](https://youtrack.jetbrains.com/issue/IDEA-368164) · Type: Bug · Votes: 0*
*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
No source file or test is named. Reproduce the GSP context action flow using the reported ${MyClassDD} example, then trace the "import class" entry point and its reference rewrite; done means the page import is added while the body keeps the short class name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy, java
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100