apache / apache/grails-intellij-plugin

Fix GSP formatting

Open
#66 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

As reported by customer ([forum thread](http://www.jetbrains.net/devnet/message/5263276)):

current GSP formatting algorithm behaves at the following manner:

**Before**
```

@import url("${resource(dir: 'styles', file: 'base.css')}");
@import url("${resource(dir: 'styles', file: 'tabs.css')}");
@import url("${resource(dir: 'styles', file: 'navigation.css')}");
@import url("${resource(dir: 'styles', file: 'splitter.css')}");
<g:if test="${pageProperty(name: 'body.class') == 'administration'}">
@import url("${resource(dir: 'styles', file: 'administration.css')}");
</g:if>

```
**After**
```

@import url("${resource(dir: 'styles', file: 'base.css')}");
@import url("${resource(dir: 'styles', file: 'tabs.css')}");
@import url("${resource(dir: 'styles', file: 'navigation.css')}");
@import url("${resource(dir: 'styles', file: 'splitter.css')}");
<
g:if

test
=
"
${
pageProperty(name: 'body.class') == 'administration'
}
"
>
@import url("${resource(dir: 'styles', file: 'administration.css')}");

</
g:if
>

```
The task is to fix GSP formatting algorithm

---

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

Start by locating the GSP formatting algorithm in the plugin and compare its output with the issue's Before and After examples. Reproduce the formatting of the embedded g:if tag, then verify that tag attributes and the surrounding HTML and CSS remain intact.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.