This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 168004 - Taglib tag breaks formatting GSP
Summary: Taglib tag breaks formatting GSP
Status: RESOLVED FIXED
Alias: None
Product: groovy
Classification: Unclassified
Component: GSP (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P3 blocker with 5 votes (vote)
Assignee: Martin Janicek
URL:
Keywords:
: 187490 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-07-02 06:14 UTC by dmitry_skorikov
Modified: 2013-01-15 07:29 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshots of GSP formatting with JetBrains Idea and Netbeans (146.94 KB, application/octet-stream)
2010-02-17 12:04 UTC, trnl
Details
Screenshots submitted by the user offline. (247.22 KB, application/octet-stream)
2011-01-05 14:17 UTC, Petr Jiricka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dmitry_skorikov 2009-07-02 06:14:19 UTC
If GSP page contains a taglib tag then formatting breaks, for example:

<html>
  <body>
  <g:if test="${some expression}">
    <h1>Sample line</h1>
  </g:if>
</body>
</html>

expected:

<html>
  <body>
    <g:if test="${some expression}">
      <h1>Sample line</h1>
    </g:if>
  </body>
</html>
Comment 1 trnl 2010-02-17 12:04:57 UTC
Created attachment 94249 [details]
Screenshots of GSP formatting with JetBrains Idea and Netbeans

Format and indent working but provides invalid structure.

Moreover Netbeans highlinging page directive as error.

And code completion is not working too.

Is it a bug or smth need to be fixed in my settings or Netbeans does not provide such features.

In this archive you can find screenshots of the code. First it was indented with IntelliJIdea and then reformated with Netbeans. You can notice invalid indentation near <g: .../> tags.
Comment 2 samcarr 2010-06-30 23:11:14 UTC
This is indeed quite a frustrating bug. As you type return, it re-indents <g: tags (or the lines immediately after them) incorrectly. Also if you ask NetBeans to auto format the file, it does the same and messes up your file. Given that the vast majority of individuals doing Grails development with NetBeans are going to run into this bug, I was rather surprised to find it in the 6.9 release.
Comment 3 Petr Jiricka 2011-01-03 13:29:34 UTC
Reassigning to Groovy where it belongs. BTW, both of the attached screenshots are from NetBeans, can you attach the IDEA screenshot again? Thanks.
Comment 4 Petr Jiricka 2011-01-05 14:17:50 UTC
Created attachment 104735 [details]
Screenshots submitted by the user offline.
Comment 5 Petr Jiricka 2011-01-07 10:20:41 UTC
I agree this is annoying, but IMO not P1 priority, as there is a workaround; see also the bug priority guidelines: http://wiki.netbeans.org/BugPriorityGuidelines
Comment 6 Petr Hejl 2011-02-19 10:13:53 UTC
I don't think formatting issue is of a P2 priority.
Comment 7 Martin Janicek 2012-03-19 15:14:01 UTC
Still valid issue --> Changing TM to 7.2
Comment 8 Martin Janicek 2012-12-11 14:06:51 UTC
*** Bug 187490 has been marked as a duplicate of this bug. ***
Comment 9 Martin Janicek 2012-12-11 15:20:42 UTC
GspIndentTask class from groovy.gsp module might be the reason.
Comment 10 Martin Janicek 2012-12-18 09:34:51 UTC
Setting TM = Next, this will be fixed together with a new GSP lexer.
Comment 11 Martin Janicek 2013-01-14 09:44:37 UTC
Fixed in: http://hg.netbeans.org/web-main/rev/d7a619844f78
It's only a part of the development sources, so please anyone
interested in the change, use daily builds instead of newly incoming NB73.
Comment 12 Quality Engineering 2013-01-15 07:29:28 UTC
Integrated into 'main-golden', will be available in build *201301150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d7a619844f78
User: Martin Janicek <mjanicek@netbeans.org>
Log: Rewriting GSP lexer, indenter and the braces matcher as a fix for issues #153424, #168004, #202248, #202249 and #209989