From 270e32327f4d9776afb2047108da8550afbf3f83 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sat, 31 Jan 2015 22:14:10 +0100 Subject: [PATCH] json: Enable tag parser and adapt test case for Geany --- data/filetypes.JSON.conf | 1 + tagmanager/ctags/json.c | 12 +++++------ tests/ctags/Makefile.am | 1 + tests/ctags/simple.json.tags | 39 ++++++++++++++++++------------------ 4 files changed, 28 insertions(+), 25 deletions(-) diff --git a/data/filetypes.JSON.conf b/data/filetypes.JSON.conf index ea388869..4212bd6a 100644 --- a/data/filetypes.JSON.conf +++ b/data/filetypes.JSON.conf @@ -5,6 +5,7 @@ primary=true false null [settings] lexer_filetype=Javascript +tag_parser=JSON extension=json mime_type=application/json diff --git a/tagmanager/ctags/json.c b/tagmanager/ctags/json.c index 553c0a4d..8c87476d 100644 --- a/tagmanager/ctags/json.c +++ b/tagmanager/ctags/json.c @@ -69,12 +69,12 @@ typedef enum { static langType Lang_json; static kindOption JsonKinds [] = { - { TRUE, 'o', "object", "objects" }, - { TRUE, 'a', "array", "arrays" }, - { TRUE, 'n', "number", "numbers" }, - { TRUE, 's', "string", "strings" }, - { TRUE, 'b', "boolean", "booleans" }, - { TRUE, 'z', "null", "nulls" } + { TRUE, 'o', "member", "objects" }, + { TRUE, 'a', "member", "arrays" }, + { TRUE, 'n', "member", "numbers" }, + { TRUE, 's', "member", "strings" }, + { TRUE, 'b', "member", "booleans" }, + { TRUE, 'z', "member", "nulls" } }; static tokenInfo *newToken (void) diff --git a/tests/ctags/Makefile.am b/tests/ctags/Makefile.am index 7ea18ff5..4d43a465 100644 --- a/tests/ctags/Makefile.am +++ b/tests/ctags/Makefile.am @@ -246,6 +246,7 @@ test_sources = \ simple.d \ simple.html \ simple.js \ + simple.json \ simple.ksh \ simple.lua \ simple.mak \ diff --git a/tests/ctags/simple.json.tags b/tests/ctags/simple.json.tags index 4004c612..4594179e 100644 --- a/tests/ctags/simple.json.tags +++ b/tests/ctags/simple.json.tags @@ -1,19 +1,20 @@ -0 input.json /^ {$/;" o array:phoneNumbers -1 input.json /^ {$/;" o array:phoneNumbers -address input.json /^ "address": {$/;" o -age input.json /^ "age": 25,$/;" n -children input.json /^ "children": [],$/;" a -city input.json /^ "city": "New York",$/;" s object:address -firstName input.json /^ "firstName": "John",$/;" s -height_cm input.json /^ "height_cm": 167.6,$/;" n -isAlive input.json /^ "isAlive": true,$/;" b -lastName input.json /^ "lastName": "Smith",$/;" s -number input.json /^ "number": "212 555-1234"$/;" s object:phoneNumbers.0 -number input.json /^ "number": "646 555-4567"$/;" s object:phoneNumbers.1 -phoneNumbers input.json /^ "phoneNumbers": [$/;" a -postalCode input.json /^ "postalCode": "10021-3100"$/;" s object:address -spouse input.json /^ "spouse": null$/;" z -state input.json /^ "state": "NY",$/;" s object:address -streetAddress input.json /^ "streetAddress": "21 2nd Street",$/;" s object:address -type input.json /^ "type": "home",$/;" s object:phoneNumbers.0 -type input.json /^ "type": "office",$/;" s object:phoneNumbers.1 +# format=tagmanager +0Ì64ÎphoneNumbersÖ0 +1Ì64ÎphoneNumbersÖ0 +addressÌ64Ö0 +ageÌ64Ö0 +childrenÌ64Ö0 +cityÌ64ÎaddressÖ0 +firstNameÌ64Ö0 +height_cmÌ64Ö0 +isAliveÌ64Ö0 +lastNameÌ64Ö0 +numberÌ64ÎphoneNumbers.0Ö0 +numberÌ64ÎphoneNumbers.1Ö0 +phoneNumbersÌ64Ö0 +postalCodeÌ64ÎaddressÖ0 +spouseÌ64Ö0 +stateÌ64ÎaddressÖ0 +streetAddressÌ64ÎaddressÖ0 +typeÌ64ÎphoneNumbers.0Ö0 +typeÌ64ÎphoneNumbers.1Ö0