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 118250

Summary: [60cat] Highlight JSON object names
Product: javascript Reporter: dynamite <dynamite>
Component: EditorAssignee: issues@ide <issues>
Status: NEW ---    
Severity: blocker CC: deeptinker
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: ENHANCEMENT Exception Reporter:

Description dynamite 2007-10-09 15:22:35 UTC
[ BUILD # : 200710071200 ]
[ JDK VERSION : 1.6.0_02 ]

JSON protocol has a very limited syntax and a significant chunk of it
will tend to be strings.  This leads to unhelpful highlighting.  It
could be improved by making name strings a different colour from
other strings and giving a colour to numbers.

So, {"name":"value"} would highlight "name" as light blue say instead
as orange as is the case for "value".
Comment 1 dynamite 2007-10-21 20:34:44 UTC
I propose the following change to the language.nbs for JSON to effect my proposed highlighting change.  In the grammar 
section change

Pair = <js_string> ":" Value;

to

Pair = Key Value;
Key = <js_string> ":";

This enables us to distinguish key from value.  And then in the following colors section add:

COLOR:js_number: {
    foreground_color:"#009900";
}
COLOR:Key: {
    foreground_color:"black";
}

This makes numbers a mid-green, keys black and leave string values as orange and Booleans and null as blue.