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 134427 - JSON support
Summary: JSON support
Status: NEW
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-02 19:30 UTC by Samaresh Panda
Modified: 2008-07-08 15:08 UTC (History)
0 users

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 Samaresh Panda 2008-05-02 19:30:25 UTC
Currently in NB6.1 we have the minimal JSON support. In fact, JSON documents are treated as Javascript. For 6.5 we want
to take this to the next level. Some features could be:

- Syntax checking
- Formatting
- Navigation
- Create javascript expressions from json data format
- Bundle json to java libs for java support
- Diff for json
- Get meta data from XMLHttpRequest call and create expressions that could be used in javascript
Comment 1 dynamite 2008-05-10 22:40:16 UTC
Currently names are highlighted as strings which isn't that useful.  I filed issue 118250 with a patch that would
highlight the names within JSON files differently to the string values.

It is worth noting that whilst JSON is defined as having names being quoted, many implementations are tolerant of the
case when the quotes aren't used.  It would be good if the missing quotes could be optionally tolerated.
Comment 2 Samaresh Panda 2008-07-08 14:25:20 UTC
With some recent changes fromm Tor, Fold and Navigator is now available for 6.5. I'm not sure if we'll have enough time
for syntax checking. After some discussions with Tor, we were thinking of making it as a hints/quickfix. In the mean
while, I'll take a look at the syntax coloring, that may be easy to fix.
Comment 3 Samaresh Panda 2008-07-08 15:08:20 UTC
For syntax coloring here is my proposal (very similar to XML):

1. For name/value pair(e.g. "title": "example glossary"), name in green and value in orange. Similar to attribute
name/value in XML.
2. Have the enclosing object literal (such as the "glossary" and "GlossDiv") in blue similar to an XML element.

Here is the sample to help us discuss:
{
    "glossary": {
        "title": "example glossary",
	"GlossDiv": {
            "title": "S",
            "GlossList": {
                "GlossEntry": {
                    "ID": "SGML",
                    "SortAs": "SGML",
                    "GlossTerm": "Standard Generalized Markup Language",
                    "Acronym": "SGML",
                    "Abbrev": "ISO 8879:1986",
                    "GlossDef": {
                        "para": "A meta-markup language, used to create markup languages such as DocBook.",
                        "GlossSeeAlso": ["GML", "XML"]
                    },
                    "GlossSee": "markup"
                }
            }
        }
    }
}