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.
I came across this blog entry: http://squirrelsewer.blogspot.com/2006/11/resource-bundle-syntax-gotchas.html There are some interesting things there. It's easy to end up with single quotes in your strings, and if your strings are being formatted by MessageFormat (which I suspect is the case for most people), it can have unintended consequences. I looked up MessageFormat, and lo and behold, it's a whole "language"! (Look at the grammar listed right in its javadoc: http://java.sun.com/j2se/1.5.0/docs/api/java/text/MessageFormat.html ) I see that there is a Schliemann .nbs file for properties files, but it's only doing key=value recognition at this point. (And needs to handle : as a separator as well.) Would it make sense to actually tokenize .properties files as if they are MessageFormat language files?? I think that would help 95% of .properties file users. -- Tor Craig: FWIW, I think this would be a great idea ... but with a potential caveat. What happens if the developer is specifying resources that are *not* MessageFormat strings, and the coloring confuses things, or creates "false positive" error reports for invalid syntax? Ideally, we could implement this so you could turn it on or off on a per-properties-file basis, perhaps defaulting with convention over configuration (Bundle.properties==yes, Messages.properties=yes, Foo.properties=no) or some per-file setting that persists with the project. Jesse: That is why I have used the attached in Emacs for about ten years. I wrote it from scratch in an afternoon, I guess, but it still provides better coloring than NB ever did, mainly because duplicating it in old NB would have taken me days. With the advent of Schliemann it should be easy to correct that. Note that there is some special treatment in there for ATG Dynamo (an old app server) and Ant, and the MessageFormat handling is minimal. The basic format features are handling of 1. Continued lines such as prop=\ val1:\ val2 ~ prop=val1:val2 2. Extra spaces at the ends of lines, which are otherwise invisible parts of the value. 3. \uXXXX, \n, and other escapes. To Craig's question - I have never been bothered by the possibility of the attached major mode coloring something that wasn't actually special. It's rare and mostly harmless. We can assume that most .properties files edited by NB developers are 1. Resource bundle strings, sometimes using MessageFormat. 2. Ant property definitions, sometimes using ${property} substs. 3. Relatively short and straightforward config files for other systems - Maven, Tomcat, whatever.
Created attachment 36619 [details] Emacs el file
Obsolete milestone, please reevaluate
reevaluted