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 - [60cat] Highlight JSON object names
Summary: [60cat] Highlight JSON object names
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@ide
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-09 15:22 UTC by dynamite
Modified: 2009-02-27 14:26 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.