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 138331 - keywords should be colored according to given context
Summary: keywords should be colored according to given context
Status: NEW
Alias: None
Product: groovy
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All Linux
: P4 blocker (vote)
Assignee: Martin Janicek
Depends on:
Reported: 2008-06-26 10:49 UTC by Lukas Jungmann
Modified: 2012-03-19 15:36 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Jungmann 2008-06-26 10:49:44 UTC
-create new grails app and open Config.groovy in the editor
-get to the lines with:

// The default codec used to encode data with ${}
grails.views.default.codec="none" // none, html, base64

=> default is in blue but should not be since in this context it isn't meant as a keyword, IMHO
Comment 1 schmidtm 2008-09-29 10:26:52 UTC
Hi Lukas,

to my believe it's save to close this isssue, since the conf/Config.groovy file is a special, config file and not a valid Groovy source-code file. It's not 
supposed to be compiled by the groovy compiler. It's main purpose is the logging configuration and it is read-in from something called ConfigSlurper. For 
details see:

I do think the file shouldn't be suffixed *.groovy since it is technically no groovy source-code. But it is not our decision.
Comment 2 martin_adamek 2008-09-29 11:38:45 UTC
That file is compilable groovy source. Where did you find that it is opposite and it shouldn't even have .groovy suffix? In any case, highlighting 'default' word is 
strange and it is valid bug.
Comment 3 schmidtm 2008-09-29 13:13:43 UTC

i have this information from the two URL's given in my former comment. The documentation says:

"ConfigSlurper is a utility class within Groovy for writing properties file like scripts for performing configuration. Unlike regular Java properties files 
ConfigSlurper scripts support native Java types and are structured like a tree."

Config.groovy is a configuration file which has the suffix *.groovy. This is to my believe dangerous - to put it mildly. So I still think this is nothing we
can fix in our module. It would be hard to fix anyway, since we copy the tokens in GroovyLexer.getTokenId() in a 1:1 fashion from the ones we get via antlr.parser.GroovyLexer.

And for the "default" toke we obviously get: GroovyTokenTypes.LITERAL_default and turn it into: GroovyTokenId.LITERAL_default

But the whole affair is not specific to default you can type-in an 'if' literal as well.

But anyway, I'll leave this decision to you.
Comment 4 martin_adamek 2008-09-29 13:17:03 UTC
Hmm, I still don't see where is written that it is not valid groovy script. I still think it is regular groovy file.
Comment 5 Petr Hejl 2009-10-21 15:57:31 UTC
This is imo really rare.
Comment 6 Martin Janicek 2012-03-19 15:36:41 UTC
Still valid issue --> Changing TM to Next, since it's quite rare