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 202248 - Editor doesn't correctly highlight GSP tags
Summary: Editor doesn't correctly highlight GSP tags
Status: RESOLVED FIXED
Alias: None
Product: groovy
Classification: Unclassified
Component: GSP (show other bugs)
Version: 7.0.1
Hardware: PC Mac OS X
: P3 normal with 1 vote (vote)
Assignee: Martin Janicek
URL:
Keywords:
: 166632 167891 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-16 17:36 UTC by athompson
Modified: 2013-01-15 07:29 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description athompson 2011-09-16 17:36:13 UTC
If a tag has a namespace, then the ending tag isn't highlighted correctly if the cursor is placed in the start tag.  For example:

<g:if>
   ...
</g:if>

if the curser is placed in the "<g:if>", the "</g:if>" isn't properly highlighted (and in fact shows as an unclosed tag).  Additionally, completion doesn't work (but I guess that's a separate bug).
Comment 1 Martin Janicek 2012-03-19 08:44:26 UTC
Still valid --> Changing TM to 7.2
Comment 2 Martin Janicek 2012-12-11 15:27:09 UTC
AbstractHighlightsContainer from spi.editor.highlighting.support might help with this (there are some implementations registered in groovy.gsp layer.xml but they might not be intended for this purpose - e.g. EmbeddedSectionsHighlighting is used only for highlighting embedded groovy code)

We should check already used implementations and either fix one of the current ones or implement new one so we can finally have this behavior for GSPs.
Comment 3 Martin Janicek 2012-12-13 10:19:10 UTC
Hi Athompson (CCing also Alex, so Hi Alex :)), could one of you guys help me with something? I'm trying to improve (rewrite) our GSP lexer to be able to fix some issues from that area, but unfortunately I don't have strong knowledge of GSP grammar and thus I'm not completely sure if some syntactic rules are possible in GSP or not. So few syntactic questions:)

1] Does GSP allow construct like "@{ ... }" ??
2] Does GSP allow construct like "!{ ... }!" ??
3] Does GSP allow construct like "%{ ... }%" ?? (I'm aware of gsp style comments "%{-- ... --}%" but is it possible to use it somewhere else?)
4] Does GSP allow construct like "<%! ... %>" ??
Comment 4 akochnev 2012-12-13 13:50:26 UTC
I don't think that any of the examples are a 'gsp' syntax that should do something special. The only thing that resembles #4 is JSP style comments, e.g. 
<%-- ... --%>
Comment 5 Martin Janicek 2012-12-13 13:55:25 UTC
Thanks a lot for a quick response Alex! I'm glad to hear that. Our current lexer is processing these constructs, but I wasn't able to find any reference that would show these are valid GSPs. Great that you confirm it.
Thank you one more time!
Comment 6 Martin Janicek 2012-12-17 13:29:08 UTC
Ok, referring my comment 2 this was never properly implemented. BracesMatchers and BracesMatcherFactory has to be implemented for GSPs (JspBracesMatching might be an inspiration).

I already have a new GSP lexer, so it shouldn't be complicated. Anyway targeting to the TM = Next as we are way after the feature freeze and this will be whole new functionality.
Comment 7 Martin Janicek 2013-01-03 10:31:32 UTC
*** Bug 166632 has been marked as a duplicate of this bug. ***
Comment 8 Martin Janicek 2013-01-03 10:41:27 UTC
*** Bug 167891 has been marked as a duplicate of this bug. ***
Comment 9 Martin Janicek 2013-01-14 09:45:15 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 10 Quality Engineering 2013-01-15 07:29:04 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