diff --git a/tagmanager/ctags/json.c b/tagmanager/ctags/json.c index 8c87476d..52350275 100644 --- a/tagmanager/ctags/json.c +++ b/tagmanager/ctags/json.c @@ -227,15 +227,7 @@ static void pushScope (tokenInfo *const token, static void popScope (tokenInfo *const token, const tokenInfo *const parent) { - char *dot = strrchr (token->scope->buffer, '.'); - - if (! dot) - vStringClear (token->scope); - else - { - *dot = 0; - token->scope->length = dot - token->scope->buffer; - } + vStringTruncate (token->scope, vStringLength (parent->scope)); token->scopeKind = parent->scopeKind; } diff --git a/tests/ctags/Makefile.am b/tests/ctags/Makefile.am index 16e4af76..86590ed6 100644 --- a/tests/ctags/Makefile.am +++ b/tests/ctags/Makefile.am @@ -134,6 +134,7 @@ test_sources = \ debian_432872.f90 \ directives.c \ dopbl2.f \ + dotted-names.json \ enum.c \ enum.f90 \ enum.java \ diff --git a/tests/ctags/dotted-names.json b/tests/ctags/dotted-names.json new file mode 100644 index 00000000..f4e8cffb --- /dev/null +++ b/tests/ctags/dotted-names.json @@ -0,0 +1,25 @@ +{ + "first.name": "John", + "last.name": "Smith", + "is.alive": true, + "age": 25, + "height_cm": 167.6, + "address": { + "street.address": "21 2nd Street", + "city": "New York", + "state": "NY", + "postal.code": "10021-3100" + }, + "phone.numbers": [ + { + "type": "home", + "number": "212 555-1234" + }, + { + "type": "office", + "number": "646 555-4567" + } + ], + "children": [], + "spouse": null +} diff --git a/tests/ctags/dotted-names.json.tags b/tests/ctags/dotted-names.json.tags new file mode 100644 index 00000000..e6d79b9e --- /dev/null +++ b/tests/ctags/dotted-names.json.tags @@ -0,0 +1,20 @@ +# format=tagmanager +0Ì64Îphone.numbersÖ0 +1Ì64Îphone.numbersÖ0 +addressÌ64Ö0 +ageÌ64Ö0 +childrenÌ64Ö0 +cityÌ64ÎaddressÖ0 +first.nameÌ64Ö0 +height_cmÌ64Ö0 +is.aliveÌ64Ö0 +last.nameÌ64Ö0 +numberÌ64Îphone.numbers.0Ö0 +numberÌ64Îphone.numbers.1Ö0 +phone.numbersÌ64Ö0 +postal.codeÌ64ÎaddressÖ0 +spouseÌ64Ö0 +stateÌ64ÎaddressÖ0 +street.addressÌ64ÎaddressÖ0 +typeÌ64Îphone.numbers.0Ö0 +typeÌ64Îphone.numbers.1Ö0