I am using Eclipse Helios* with PDT, and when I am editing JavaScript files with the default JavaScript Editor (JSDT), code highlighting (Mark Occurrences) is not working for JSON-style (or Object Literal if you will) declarations.
*) Question also valid for Eclipse Indigo with webtools and JSDT 3.7.2
Example:
Foo = {};
Foo.Bar = Foo.Bar || {};
Foo.Bar = {
bar: function(str) {
alert(str)
},
baz: function(str) {
this.bar(str); // This bar *is* highlighted though
}
};
Foo.Bar.baz('text');
No Bar, bar or baz is highlighted. For now, I humbly edit the JavaScript part of projects in Notepad++ because it just highlights every occurrence of whatever is currently selected.
Is there a common practice for Eclipse JavaScript developers to get code highlighting work correctly, using the popular Object Literal notation? An option or update I missed?
-update-
I have found that code highlighting depends on the code being properly outlined. Altough commonly used, Object Literal outlining still seems rare in javascript editors.
The Spket Javascript Editor does partial Object Literal outlining, and the Aptana Javascript Editor does full Object Literal outlining. But both loses other important functionality. A quest for the editor with the least loss of functionality is currently in progress in this question.