apache / apache/grails-intellij-plugin

Grails plugins: IDEA cannot locate views/templates in g:render when plugin attr is self-referential

Open
#127 0 comments 0 reactions 0 assignees View on GitHub
bug imported-from-youtrack
Dominant language
Java
Stars
17
Forks
4
Avg merge
5d 15h
Merged PRs (30d)
4

Description

Given a view or layout in a Grails plugin, IDEA can find the views/templates if the plugin is **not** specified, but fails to find them if the `plugin` attr is specified *and* it is self-referential (the `plugin` specified in the attr is the same plugin as the one you're developing.

Assuming we are working in `example` (i.e., plugin descriptor = `ExampleGrailsPlugin.groovy`)

**main.gsp**
```
<%-- works: --%>

<%-- does not work: --%>

```
In the first (working) example, we can Cmd+click on "partial" to be taken to that view.

In the second (non-working) example:

- We cannot Cmd+click on "partial" to be taken to that view);
- IDEA marks the attr values in red and reports that it cannot resolve:
- directory 'common';
- template '_partial.gsp'; or
- symbol 'example'

The inspection ought to be able to detect that the `plugin` referenced in the attr is self-referential and then resolve those directories and templates.

---

*Imported from [IDEA-107228](https://youtrack.jetbrains.com/issue/IDEA-107228) · 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

Reproduce the resolution problem using main.gsp and the self-referential plugin declared by ExampleGrailsPlugin.groovy. Start at the g:render handling for the plugin attribute and compare it with the working render without that attribute. Done means Cmd+click resolves common/partial, _partial.gsp, and the example plugin without inspection errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.