From 17c3a8bf57da7dc2e7d9bc587af3b5f3b79aa580 Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Wed, 5 Apr 2017 01:29:15 -0700 Subject: [PATCH] Update test with current index state --- src/position.cc | 7 +-- src/serializer.cc | 15 ++--- src/test.cc | 7 ++- tests/class_forward_declaration.cc | 5 +- tests/constructors/constructor.cc | 29 ++++++---- tests/constructors/destructor.cc | 29 ++++++---- tests/constructors/invalid_reference.cc | 10 ++-- tests/declaration_vs_definition/class.cc | 5 +- .../declaration_vs_definition/class_member.cc | 10 ++-- .../class_member_static.cc | 12 ++-- tests/declaration_vs_definition/func.cc | 8 +-- tests/declaration_vs_definition/method.cc | 20 ++++--- tests/enums/enum_class_decl.cc | 15 +++-- tests/enums/enum_decl.cc | 15 +++-- tests/enums/enum_inherit.cc | 15 +++-- tests/enums/enum_usage.cc | 20 ++++--- tests/foobar.cc | 31 ++++++----- tests/function_declaration.cc | 4 +- tests/function_declaration_definition.cc | 7 ++- tests/function_definition.cc | 5 +- tests/inheritance/class_inherit.cc | 10 ++-- .../class_inherit_templated_parent.cc | 27 +++++---- tests/inheritance/class_multiple_inherit.cc | 20 ++++--- tests/inheritance/function_override.cc | 19 ++++--- tests/inheritance/interface_pure_virtual.cc | 10 ++-- tests/method_declaration.cc | 9 +-- tests/method_definition.cc | 12 ++-- tests/method_inline_declaration.cc | 10 ++-- tests/multi_file/header.h | 55 +++++++++++-------- tests/namespaces/anonymous_function.cc | 4 +- tests/namespaces/function_declaration.cc | 4 +- tests/namespaces/function_definition.cc | 5 +- tests/namespaces/method_declaration.cc | 9 +-- tests/namespaces/method_definition.cc | 12 ++-- tests/namespaces/method_inline_declaration.cc | 10 ++-- tests/namespaces/namespace_reference.cc | 24 ++++---- tests/outline/outline.cc | 22 +++++--- tests/outline/outline2.cc | 28 ++++++---- .../func_specialized_template_param.cc | 17 +++--- .../implicit_variable_instantiation.cc | 27 +++++---- ...ass_template_func_usage_folded_into_one.cc | 20 ++++--- ...ace_template_type_usage_folded_into_one.cc | 15 +++-- .../templates/specialized_func_definition.cc | 12 ++-- ...mplate_class_func_usage_folded_into_one.cc | 20 ++++--- ...ass_template_func_usage_folded_into_one.cc | 20 ++++--- ...mplate_class_type_usage_folded_into_one.cc | 30 ++++++---- ...emplate_class_var_usage_folded_into_one.cc | 19 ++++--- .../template_func_usage_folded_into_one.cc | 15 +++-- .../template_type_usage_folded_into_one.cc | 15 +++-- .../template_var_usage_folded_into_one.cc | 27 +++++---- tests/types/anonymous_struct.cc | 30 ++++++---- tests/unions/union_decl.cc | 15 +++-- tests/unions/union_usage.cc | 25 +++++---- tests/usage/func_usage_addr_func.cc | 26 +++++---- tests/usage/func_usage_addr_method.cc | 23 ++++---- tests/usage/func_usage_call_func.cc | 14 +++-- tests/usage/func_usage_call_method.cc | 23 ++++---- .../usage/func_usage_class_inline_var_def.cc | 15 +++-- tests/usage/func_usage_forward_decl_func.cc | 13 +++-- tests/usage/func_usage_forward_decl_method.cc | 23 ++++---- tests/usage/func_usage_template_func.cc | 13 +++-- .../usage/type_usage_as_template_parameter.cc | 28 ++++++---- ...ype_usage_as_template_parameter_complex.cc | 42 ++++++++------ ...type_usage_as_template_parameter_simple.cc | 12 ++-- tests/usage/type_usage_declare_extern.cc | 9 +-- tests/usage/type_usage_declare_field.cc | 22 +++++--- tests/usage/type_usage_declare_local.cc | 22 +++++--- tests/usage/type_usage_declare_param.cc | 22 +++++--- .../type_usage_declare_param_prototype.cc | 14 +++-- .../usage/type_usage_declare_param_unnamed.cc | 7 ++- tests/usage/type_usage_declare_qualifiers.cc | 41 ++++++++------ tests/usage/type_usage_declare_static.cc | 7 ++- tests/usage/type_usage_on_return_type.cc | 39 +++++++------ tests/usage/type_usage_typedef_and_using.cc | 43 +++++++++------ .../type_usage_typedef_and_using_template.cc | 12 ++-- tests/usage/type_usage_various.cc | 21 ++++--- tests/usage/usage_inside_of_call.cc | 41 ++++++++------ tests/usage/usage_inside_of_call_simple.cc | 20 ++++--- tests/usage/var_usage_call_function.cc | 19 ++++--- tests/usage/var_usage_class_member.cc | 39 +++++++------ tests/usage/var_usage_class_member_static.cc | 22 ++++---- tests/usage/var_usage_cstyle_cast.cc | 17 +++--- tests/usage/var_usage_extern.cc | 9 +-- tests/usage/var_usage_func_parameter.cc | 10 ++-- tests/usage/var_usage_local.cc | 10 ++-- tests/usage/var_usage_shadowed_local.cc | 15 +++-- tests/usage/var_usage_shadowed_parameter.cc | 15 +++-- tests/usage/var_usage_static.cc | 10 ++-- tests/vars/class_member.cc | 10 ++-- tests/vars/class_static_member.cc | 12 ++-- tests/vars/class_static_member_decl_only.cc | 9 +-- tests/vars/function_local.cc | 12 ++-- tests/vars/function_param.cc | 17 +++--- tests/vars/function_param_unnamed.cc | 5 +- tests/vars/function_shadow_local.cc | 15 +++-- tests/vars/function_shadow_param.cc | 15 +++-- tests/vars/global_variable.cc | 5 +- tests/vars/global_variable_decl_only.cc | 4 +- 98 files changed, 982 insertions(+), 706 deletions(-) diff --git a/src/position.cc b/src/position.cc index 937cbcc1..88f90b32 100644 --- a/src/position.cc +++ b/src/position.cc @@ -82,7 +82,7 @@ Range::Range(Position start, Position end) : start(start), end(end) {} Range::Range(const char* encoded) : start(encoded) { end = start; - /* + assert(encoded); while (*encoded && *encoded != '-') ++encoded; @@ -96,18 +96,17 @@ Range::Range(const char* encoded) : start(encoded) { if (*encoded == ':') ++encoded; end.column = atoi(encoded); - */ } std::string Range::ToString() { std::string output; output += start.ToString(); - /* + output += "-"; output += std::to_string(end.line); output += ":"; output += std::to_string(end.column); - */ + return output; } diff --git a/src/serializer.cc b/src/serializer.cc index cc752528..82d84f13 100644 --- a/src/serializer.cc +++ b/src/serializer.cc @@ -111,9 +111,8 @@ void Reflect(TVisitor& visitor, IndexedTypeDef& value) { REFLECT_MEMBER2("usr", value.def.usr); REFLECT_MEMBER2("short_name", value.def.short_name); REFLECT_MEMBER2("qualified_name", value.def.qualified_name); - REFLECT_MEMBER2("definition", value.def.definition_spelling); - //REFLECT_MEMBER2("definition_spelling", value.def.definition_spelling); - //REFLECT_MEMBER2("definition_extent", value.def.definition_extent); + REFLECT_MEMBER2("definition_spelling", value.def.definition_spelling); + REFLECT_MEMBER2("definition_extent", value.def.definition_extent); REFLECT_MEMBER2("alias_of", value.def.alias_of); REFLECT_MEMBER2("parents", value.def.parents); REFLECT_MEMBER2("derived", value.derived); @@ -149,9 +148,8 @@ void Reflect(TVisitor& visitor, IndexedFuncDef& value) { REFLECT_MEMBER2("short_name", value.def.short_name); REFLECT_MEMBER2("qualified_name", value.def.qualified_name); REFLECT_MEMBER2("declarations", value.declarations); - REFLECT_MEMBER2("definition", value.def.definition_spelling); - //REFLECT_MEMBER2("definition_spelling", value.def.definition_spelling); - //REFLECT_MEMBER2("definition_extent", value.def.definition_extent); + REFLECT_MEMBER2("definition_spelling", value.def.definition_spelling); + REFLECT_MEMBER2("definition_extent", value.def.definition_extent); REFLECT_MEMBER2("declaring_type", value.def.declaring_type); REFLECT_MEMBER2("base", value.def.base); REFLECT_MEMBER2("derived", value.derived); @@ -186,9 +184,8 @@ void Reflect(TVisitor& visitor, IndexedVarDef& value) { REFLECT_MEMBER2("short_name", value.def.short_name); REFLECT_MEMBER2("qualified_name", value.def.qualified_name); REFLECT_MEMBER2("declaration", value.def.declaration); - REFLECT_MEMBER2("definition", value.def.definition_spelling); - //REFLECT_MEMBER2("definition_spelling", value.def.definition_spelling); - //REFLECT_MEMBER2("definition_extent", value.def.definition_extent); + REFLECT_MEMBER2("definition_spelling", value.def.definition_spelling); + REFLECT_MEMBER2("definition_extent", value.def.definition_extent); REFLECT_MEMBER2("variable_type", value.def.variable_type); REFLECT_MEMBER2("declaring_type", value.def.declaring_type); REFLECT_MEMBER2("uses", value.uses); diff --git a/src/test.cc b/src/test.cc index 8797dbb3..da3dc712 100644 --- a/src/test.cc +++ b/src/test.cc @@ -143,7 +143,12 @@ void RunTests() { } else { DiffDocuments(path, expected, actual); - break; + std::cout << std::endl; + std::cout << std::endl; + std::cout << "[Enter to continue next test]"; + std::cin.get(); + std::cin.get(); + //break; } } diff --git a/tests/class_forward_declaration.cc b/tests/class_forward_declaration.cc index 46585ec3..7749a093 100644 --- a/tests/class_forward_declaration.cc +++ b/tests/class_forward_declaration.cc @@ -11,8 +11,9 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "3:7", - "uses": ["1:7", "2:7", "*3:7", "4:7"] + "definition_spelling": "3:7-3:10", + "definition_extent": "3:1-3:13", + "uses": ["1:7-1:10", "2:7-2:10", "*3:7-3:10", "4:7-4:10"] }] } */ diff --git a/tests/constructors/constructor.cc b/tests/constructors/constructor.cc index 81b2765a..7e4dda3a 100644 --- a/tests/constructors/constructor.cc +++ b/tests/constructors/constructor.cc @@ -16,45 +16,50 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:7", + "definition_spelling": "1:7-1:10", + "definition_extent": "1:1-4:2", "funcs": [0], "instantiations": [0, 1], - "uses": ["*1:7", "3:3", "*7:3", "*8:3", "*8:17"] + "uses": ["*1:7-1:10", "3:3-3:6", "*7:3-7:6", "*8:3-8:6", "*8:17-8:20"] }], "funcs": [{ "id": 0, "usr": "c:@S@Foo@F@Foo#", "short_name": "Foo", "qualified_name": "Foo::Foo", - "definition": "3:3", + "definition_spelling": "3:3-3:6", + "definition_extent": "3:3-3:11", "declaring_type": 0, - "callers": ["1@7:7", "1@8:17"], - "uses": ["3:3", "7:7", "8:17"] + "callers": ["1@7:7-7:8", "1@8:17-8:20"], + "uses": ["3:3-3:6", "7:7-7:8", "8:17-8:20"] }, { "id": 1, "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "definition": "6:6", - "callees": ["0@7:7", "0@8:17"], - "uses": ["6:6"] + "definition_spelling": "6:6-6:9", + "definition_extent": "6:1-9:2", + "callees": ["0@7:7-7:8", "0@8:17-8:20"], + "uses": ["6:6-6:9"] }], "vars": [{ "id": 0, "usr": "c:constructor.cc@56@F@foo#@f", "short_name": "f", "qualified_name": "f", - "definition": "7:7", + "definition_spelling": "7:7-7:8", + "definition_extent": "7:3-7:8", "variable_type": 0, - "uses": ["7:7"] + "uses": ["7:7-7:8"] }, { "id": 1, "usr": "c:constructor.cc@66@F@foo#@f2", "short_name": "f2", "qualified_name": "f2", - "definition": "8:8", + "definition_spelling": "8:8-8:10", + "definition_extent": "8:3-8:22", "variable_type": 0, - "uses": ["8:8"] + "uses": ["8:8-8:10"] }] } */ diff --git a/tests/constructors/destructor.cc b/tests/constructors/destructor.cc index 9a272da3..cc20fb4c 100644 --- a/tests/constructors/destructor.cc +++ b/tests/constructors/destructor.cc @@ -21,45 +21,50 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:7", + "definition_spelling": "1:7-1:10", + "definition_extent": "1:1-5:2", "funcs": [0, 1], "instantiations": [0], - "uses": ["*1:7", "3:3", "4:3", "*8:3"] + "uses": ["*1:7-1:10", "3:3-3:6", "4:3-4:7", "*8:3-8:6"] }], "funcs": [{ "id": 0, "usr": "c:@S@Foo@F@Foo#", "short_name": "Foo", "qualified_name": "Foo::Foo", - "definition": "3:3", + "definition_spelling": "3:3-3:6", + "definition_extent": "3:3-3:11", "declaring_type": 0, - "callers": ["2@8:7"], - "uses": ["3:3", "8:7"] + "callers": ["2@8:7-8:8"], + "uses": ["3:3-3:6", "8:7-8:8"] }, { "id": 1, "usr": "c:@S@Foo@F@~Foo#", "short_name": "~Foo", "qualified_name": "Foo::~Foo", - "definition": "4:3", + "definition_spelling": "4:3-4:7", + "definition_extent": "4:3-4:12", "declaring_type": 0, - "uses": ["4:3"] + "uses": ["4:3-4:7"] }, { "id": 2, "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "definition": "7:6", - "callees": ["0@8:7"], - "uses": ["7:6"] + "definition_spelling": "7:6-7:9", + "definition_extent": "7:1-9:2", + "callees": ["0@8:7-8:8"], + "uses": ["7:6-7:9"] }], "vars": [{ "id": 0, "usr": "c:destructor.cc@70@F@foo#@f", "short_name": "f", "qualified_name": "f", - "definition": "8:7", + "definition_spelling": "8:7-8:8", + "definition_extent": "8:3-8:8", "variable_type": 0, - "uses": ["8:7"] + "uses": ["8:7-8:8"] }] } */ diff --git a/tests/constructors/invalid_reference.cc b/tests/constructors/invalid_reference.cc index 1c910512..7388b058 100644 --- a/tests/constructors/invalid_reference.cc +++ b/tests/constructors/invalid_reference.cc @@ -11,18 +11,20 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:8", + "definition_spelling": "1:8-1:11", + "definition_extent": "1:1-1:14", "funcs": [0], - "uses": ["*1:8", "4:6", "4:1"] + "uses": ["*1:8-1:11", "4:6-4:9", "4:1-4:4"] }], "funcs": [{ "id": 0, "usr": "c:@S@Foo@FT@>1#TFoo#v#", "short_name": "Foo", "qualified_name": "Foo::Foo", - "definition": "4:6", + "definition_spelling": "4:6-4:9", + "definition_extent": "4:1-4:11", "declaring_type": 0, - "uses": ["4:6"] + "uses": ["4:6-4:9"] }] } */ diff --git a/tests/declaration_vs_definition/class.cc b/tests/declaration_vs_definition/class.cc index e16f1fdb..d5bcae12 100644 --- a/tests/declaration_vs_definition/class.cc +++ b/tests/declaration_vs_definition/class.cc @@ -13,8 +13,9 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "3:7", - "uses": ["1:7", "2:7", "*3:7", "4:7"] + "definition_spelling": "3:7-3:10", + "definition_extent": "3:1-3:13", + "uses": ["1:7-1:10", "2:7-2:10", "*3:7-3:10", "4:7-4:10"] }] } */ diff --git a/tests/declaration_vs_definition/class_member.cc b/tests/declaration_vs_definition/class_member.cc index b51d5b79..bfcb0ae5 100644 --- a/tests/declaration_vs_definition/class_member.cc +++ b/tests/declaration_vs_definition/class_member.cc @@ -10,18 +10,20 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:7", + "definition_spelling": "1:7-1:10", + "definition_extent": "1:1-3:2", "vars": [0], - "uses": ["*1:7"] + "uses": ["*1:7-1:10"] }], "vars": [{ "id": 0, "usr": "c:@S@Foo@FI@foo", "short_name": "foo", "qualified_name": "Foo::foo", - "definition": "2:7", + "definition_spelling": "2:7-2:10", + "definition_extent": "2:3-2:10", "declaring_type": 0, - "uses": ["2:7"] + "uses": ["2:7-2:10"] }] } */ diff --git a/tests/declaration_vs_definition/class_member_static.cc b/tests/declaration_vs_definition/class_member_static.cc index 6c0b1260..e5b3dddb 100644 --- a/tests/declaration_vs_definition/class_member_static.cc +++ b/tests/declaration_vs_definition/class_member_static.cc @@ -12,19 +12,21 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:7", + "definition_spelling": "1:7-1:10", + "definition_extent": "1:1-3:2", "vars": [0], - "uses": ["*1:7", "5:5"] + "uses": ["*1:7-1:10", "5:5-5:8"] }], "vars": [{ "id": 0, "usr": "c:@S@Foo@foo", "short_name": "foo", "qualified_name": "Foo::foo", - "declaration": "2:14", - "definition": "5:10", + "declaration": "2:14-2:17", + "definition_spelling": "5:10-5:13", + "definition_extent": "5:1-5:13", "declaring_type": 0, - "uses": ["2:14", "5:10"] + "uses": ["2:14-2:17", "5:10-5:13"] }] } */ diff --git a/tests/declaration_vs_definition/func.cc b/tests/declaration_vs_definition/func.cc index 9fca4db8..5c0f25cf 100644 --- a/tests/declaration_vs_definition/func.cc +++ b/tests/declaration_vs_definition/func.cc @@ -12,10 +12,10 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "declarations": ["1:6", "2:6", "4:6"], - "definition": "3:6", - "uses": ["1:6", "2:6", "3:6", "4:6"] + "declarations": ["1:6-1:9", "2:6-2:9", "4:6-4:9"], + "definition_spelling": "3:6-3:9", + "definition_extent": "3:1-3:14", + "uses": ["1:6-1:9", "2:6-2:9", "3:6-3:9", "4:6-4:9"] }] } - */ diff --git a/tests/declaration_vs_definition/method.cc b/tests/declaration_vs_definition/method.cc index c29b9d69..ce78fa47 100644 --- a/tests/declaration_vs_definition/method.cc +++ b/tests/declaration_vs_definition/method.cc @@ -14,35 +14,37 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:7", + "definition_spelling": "1:7-1:10", + "definition_extent": "1:1-5:2", "funcs": [0, 1, 2], - "uses": ["*1:7", "7:6"] + "uses": ["*1:7-1:10", "7:6-7:9"] }], "funcs": [{ "id": 0, "usr": "c:@S@Foo@F@declonly#", "short_name": "declonly", "qualified_name": "Foo::declonly", - "declarations": ["2:8"], + "declarations": ["2:8-2:16"], "declaring_type": 0, - "uses": ["2:8"] + "uses": ["2:8-2:16"] }, { "id": 1, "usr": "c:@S@Foo@F@purevirtual#", "short_name": "purevirtual", "qualified_name": "Foo::purevirtual", - "declarations": ["3:16"], + "declarations": ["3:16-3:27"], "declaring_type": 0, - "uses": ["3:16"] + "uses": ["3:16-3:27"] }, { "id": 2, "usr": "c:@S@Foo@F@def#", "short_name": "def", "qualified_name": "Foo::def", - "declarations": ["4:8"], - "definition": "7:11", + "declarations": ["4:8-4:11"], + "definition_spelling": "7:11-7:14", + "definition_extent": "7:1-7:19", "declaring_type": 0, - "uses": ["4:8", "7:11"] + "uses": ["4:8-4:11", "7:11-7:14"] }] } */ diff --git a/tests/enums/enum_class_decl.cc b/tests/enums/enum_class_decl.cc index 0799e5f5..08bd7331 100644 --- a/tests/enums/enum_class_decl.cc +++ b/tests/enums/enum_class_decl.cc @@ -11,28 +11,31 @@ OUTPUT: "usr": "c:@E@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:12", + "definition_spelling": "1:12-1:15", + "definition_extent": "1:1-4:2", "vars": [0, 1], - "uses": ["*1:12"] + "uses": ["*1:12-1:15"] }], "vars": [{ "id": 0, "usr": "c:@E@Foo@A", "short_name": "A", "qualified_name": "Foo::A", - "definition": "2:3", + "definition_spelling": "2:3-2:4", + "definition_extent": "2:3-2:4", "variable_type": 0, "declaring_type": 0, - "uses": ["2:3"] + "uses": ["2:3-2:4"] }, { "id": 1, "usr": "c:@E@Foo@B", "short_name": "B", "qualified_name": "Foo::B", - "definition": "3:3", + "definition_spelling": "3:3-3:4", + "definition_extent": "3:3-3:9", "variable_type": 0, "declaring_type": 0, - "uses": ["3:3"] + "uses": ["3:3-3:4"] }] } */ diff --git a/tests/enums/enum_decl.cc b/tests/enums/enum_decl.cc index 717d1171..2a4bb9db 100644 --- a/tests/enums/enum_decl.cc +++ b/tests/enums/enum_decl.cc @@ -11,28 +11,31 @@ OUTPUT: "usr": "c:@E@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:6", + "definition_spelling": "1:6-1:9", + "definition_extent": "1:1-4:2", "vars": [0, 1], - "uses": ["*1:6"] + "uses": ["*1:6-1:9"] }], "vars": [{ "id": 0, "usr": "c:@E@Foo@A", "short_name": "A", "qualified_name": "Foo::A", - "definition": "2:3", + "definition_spelling": "2:3-2:4", + "definition_extent": "2:3-2:4", "variable_type": 0, "declaring_type": 0, - "uses": ["2:3"] + "uses": ["2:3-2:4"] }, { "id": 1, "usr": "c:@E@Foo@B", "short_name": "B", "qualified_name": "Foo::B", - "definition": "3:3", + "definition_spelling": "3:3-3:4", + "definition_extent": "3:3-3:9", "variable_type": 0, "declaring_type": 0, - "uses": ["3:3"] + "uses": ["3:3-3:4"] }] } */ diff --git a/tests/enums/enum_inherit.cc b/tests/enums/enum_inherit.cc index fabc004c..b1cc53dd 100644 --- a/tests/enums/enum_inherit.cc +++ b/tests/enums/enum_inherit.cc @@ -11,28 +11,31 @@ OUTPUT: "usr": "c:@E@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:6", + "definition_spelling": "1:6-1:9", + "definition_extent": "1:1-4:2", "vars": [0, 1], - "uses": ["*1:6"] + "uses": ["*1:6-1:9"] }], "vars": [{ "id": 0, "usr": "c:@E@Foo@A", "short_name": "A", "qualified_name": "Foo::A", - "definition": "2:3", + "definition_spelling": "2:3-2:4", + "definition_extent": "2:3-2:4", "variable_type": 0, "declaring_type": 0, - "uses": ["2:3"] + "uses": ["2:3-2:4"] }, { "id": 1, "usr": "c:@E@Foo@B", "short_name": "B", "qualified_name": "Foo::B", - "definition": "3:3", + "definition_spelling": "3:3-3:4", + "definition_extent": "3:3-3:9", "variable_type": 0, "declaring_type": 0, - "uses": ["3:3"] + "uses": ["3:3-3:4"] }] } */ diff --git a/tests/enums/enum_usage.cc b/tests/enums/enum_usage.cc index ca4d4bf7..2d5d52cb 100644 --- a/tests/enums/enum_usage.cc +++ b/tests/enums/enum_usage.cc @@ -13,37 +13,41 @@ OUTPUT: "usr": "c:@E@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:12", + "definition_spelling": "1:12-1:15", + "definition_extent": "1:1-4:2", "vars": [0, 1], "instantiations": [2], - "uses": ["*1:12", "*6:1", "6:9"] + "uses": ["*1:12-1:15", "*6:1-6:4", "6:9-6:12"] }], "vars": [{ "id": 0, "usr": "c:@E@Foo@A", "short_name": "A", "qualified_name": "Foo::A", - "definition": "2:3", + "definition_spelling": "2:3-2:4", + "definition_extent": "2:3-2:4", "variable_type": 0, "declaring_type": 0, - "uses": ["2:3", "6:14"] + "uses": ["2:3-2:4", "6:14-6:15"] }, { "id": 1, "usr": "c:@E@Foo@B", "short_name": "B", "qualified_name": "Foo::B", - "definition": "3:3", + "definition_spelling": "3:3-3:4", + "definition_extent": "3:3-3:9", "variable_type": 0, "declaring_type": 0, - "uses": ["3:3"] + "uses": ["3:3-3:4"] }, { "id": 2, "usr": "c:@x", "short_name": "x", "qualified_name": "x", - "definition": "6:5", + "definition_spelling": "6:5-6:6", + "definition_extent": "6:1-6:15", "variable_type": 0, - "uses": ["6:5"] + "uses": ["6:5-6:6"] }] } */ diff --git a/tests/foobar.cc b/tests/foobar.cc index 9ff2badf..668a4c4b 100644 --- a/tests/foobar.cc +++ b/tests/foobar.cc @@ -16,49 +16,54 @@ OUTPUT: "usr": "c:@E@A", "short_name": "A", "qualified_name": "A", - "definition": "1:6", - "uses": ["*1:6", "*9:5"] + "definition_spelling": "1:6-1:7", + "definition_extent": "1:1-1:10", + "uses": ["*1:6-1:7", "*9:5-9:6"] }, { "id": 1, "usr": "c:@E@B", "short_name": "B", "qualified_name": "B", - "definition": "2:6", - "uses": ["*2:6", "*10:5"] + "definition_spelling": "2:6-2:7", + "definition_extent": "2:1-2:10", + "uses": ["*2:6-2:7", "*10:5-10:6"] }, { "id": 2, "usr": "c:@ST>1#T@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "5:8", + "definition_spelling": "5:8-5:11", + "definition_extent": "5:1-7:2", "instantiations": [1], - "uses": ["*5:8", "*9:1", "*10:1"] + "uses": ["*5:8-5:11", "*9:1-9:4", "*10:1-10:4"] }, { "id": 3, "usr": "c:@ST>1#T@Foo@S@Inner", "short_name": "Inner", "qualified_name": "Foo::Inner", - "definition": "6:10", + "definition_spelling": "6:10-6:15", + "definition_extent": "6:3-6:18", "instantiations": [0], - "uses": ["*6:10", "*9:9"] + "uses": ["*6:10-6:15", "*9:9-9:14"] }], "vars": [{ "id": 0, "usr": "c:@a", "short_name": "a", "qualified_name": "a", - "definition": "9:15", + "definition_spelling": "9:15-9:16", + "definition_extent": "9:1-9:16", "variable_type": 3, - "uses": ["9:15"] + "uses": ["9:15-9:16"] }, { "id": 1, "usr": "c:@b", "short_name": "b", "qualified_name": "b", - "definition": "10:8", + "definition_spelling": "10:8-10:9", + "definition_extent": "10:1-10:9", "variable_type": 2, - "uses": ["10:8"] + "uses": ["10:8-10:9"] }] } - */ diff --git a/tests/function_declaration.cc b/tests/function_declaration.cc index c04c46dc..2ab4eb56 100644 --- a/tests/function_declaration.cc +++ b/tests/function_declaration.cc @@ -8,8 +8,8 @@ OUTPUT: "usr": "c:@F@foo#I#I#", "short_name": "foo", "qualified_name": "foo", - "declarations": ["1:6"], - "uses": ["1:6"] + "declarations": ["1:6-1:9"], + "uses": ["1:6-1:9"] }] } */ diff --git a/tests/function_declaration_definition.cc b/tests/function_declaration_definition.cc index 45459ff4..74720ca8 100644 --- a/tests/function_declaration_definition.cc +++ b/tests/function_declaration_definition.cc @@ -10,9 +10,10 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "declarations": ["1:6"], - "definition": "3:6", - "uses": ["1:6", "3:6"] + "declarations": ["1:6-1:9"], + "definition_spelling": "3:6-3:9", + "definition_extent": "3:1-3:14", + "uses": ["1:6-1:9", "3:6-3:9"] }] } */ diff --git a/tests/function_definition.cc b/tests/function_definition.cc index 52b7eae2..6b17f808 100644 --- a/tests/function_definition.cc +++ b/tests/function_definition.cc @@ -8,8 +8,9 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "definition": "1:6", - "uses": ["1:6"] + "definition_spelling": "1:6-1:9", + "definition_extent": "1:1-1:14", + "uses": ["1:6-1:9"] }] } */ diff --git a/tests/inheritance/class_inherit.cc b/tests/inheritance/class_inherit.cc index 280d28c4..06ba7897 100644 --- a/tests/inheritance/class_inherit.cc +++ b/tests/inheritance/class_inherit.cc @@ -9,17 +9,19 @@ OUTPUT: "usr": "c:@S@Parent", "short_name": "Parent", "qualified_name": "Parent", - "definition": "1:7", + "definition_spelling": "1:7-1:13", + "definition_extent": "1:1-1:16", "derived": [1], - "uses": ["*1:7", "*2:24"] + "uses": ["*1:7-1:13", "*2:24-2:30"] }, { "id": 1, "usr": "c:@S@Derived", "short_name": "Derived", "qualified_name": "Derived", - "definition": "2:7", + "definition_spelling": "2:7-2:14", + "definition_extent": "2:1-2:33", "parents": [0], - "uses": ["*2:7"] + "uses": ["*2:7-2:14"] }] } */ diff --git a/tests/inheritance/class_inherit_templated_parent.cc b/tests/inheritance/class_inherit_templated_parent.cc index 6006c0c4..32eefc26 100644 --- a/tests/inheritance/class_inherit_templated_parent.cc +++ b/tests/inheritance/class_inherit_templated_parent.cc @@ -20,47 +20,52 @@ OUTPUT: "usr": "c:@ST>1#Ni@Base1", "short_name": "Base1", "qualified_name": "Base1", - "definition": "2:7", + "definition_spelling": "2:7-2:12", + "definition_extent": "2:1-2:15", "derived": [2, 5], - "uses": ["*2:7", "*8:18", "*13:17"] + "uses": ["*2:7-2:12", "*8:18-8:23", "*13:17-13:22"] }, { "id": 1, "usr": "c:@ST>1#T@Base2", "short_name": "Base2", "qualified_name": "Base2", - "definition": "5:7", + "definition_spelling": "5:7-5:12", + "definition_extent": "5:1-5:15", "derived": [3, 5], - "uses": ["*5:7", "*11:18", "*13:27"] + "uses": ["*5:7-5:12", "*11:18-11:23", "*13:27-13:32"] }, { "id": 2, "usr": "c:@ST>1#Ni@Derived1", "short_name": "Derived1", "qualified_name": "Derived1", - "definition": "8:7", + "definition_spelling": "8:7-8:15", + "definition_extent": "8:1-8:29", "parents": [0], "derived": [5], - "uses": ["*8:7", "*13:43"] + "uses": ["*8:7-8:15", "*13:43-13:51"] }, { "id": 3, "usr": "c:@ST>1#T@Derived2", "short_name": "Derived2", "qualified_name": "Derived2", - "definition": "11:7", + "definition_spelling": "11:7-11:15", + "definition_extent": "11:1-11:29", "parents": [1], "derived": [5], - "uses": ["*11:7", "*13:56"] + "uses": ["*11:7-11:15", "*13:56-13:64"] }, { "id": 4, "usr": "c:class_inherit_templated_parent.cc@154", - "uses": ["*11:24"] + "uses": ["*11:24-11:25"] }, { "id": 5, "usr": "c:@S@Derived", "short_name": "Derived", "qualified_name": "Derived", - "definition": "13:7", + "definition_spelling": "13:7-13:14", + "definition_extent": "13:1-13:76", "parents": [0, 1, 2, 3], - "uses": ["*13:7", "*13:33", "*13:65"] + "uses": ["*13:7-13:14", "*13:33-13:40", "*13:65-13:72"] }] } */ diff --git a/tests/inheritance/class_multiple_inherit.cc b/tests/inheritance/class_multiple_inherit.cc index 9f4f17cc..102096d2 100644 --- a/tests/inheritance/class_multiple_inherit.cc +++ b/tests/inheritance/class_multiple_inherit.cc @@ -11,35 +11,39 @@ OUTPUT: "usr": "c:@S@Root", "short_name": "Root", "qualified_name": "Root", - "definition": "1:7", + "definition_spelling": "1:7-1:11", + "definition_extent": "1:1-1:14", "derived": [1, 2], - "uses": ["*1:7", "*2:24", "*3:24"] + "uses": ["*1:7-1:11", "*2:24-2:28", "*3:24-3:28"] }, { "id": 1, "usr": "c:@S@MiddleA", "short_name": "MiddleA", "qualified_name": "MiddleA", - "definition": "2:7", + "definition_spelling": "2:7-2:14", + "definition_extent": "2:1-2:31", "parents": [0], "derived": [3], - "uses": ["*2:7", "*4:24"] + "uses": ["*2:7-2:14", "*4:24-4:31"] }, { "id": 2, "usr": "c:@S@MiddleB", "short_name": "MiddleB", "qualified_name": "MiddleB", - "definition": "3:7", + "definition_spelling": "3:7-3:14", + "definition_extent": "3:1-3:31", "parents": [0], "derived": [3], - "uses": ["*3:7", "*4:40"] + "uses": ["*3:7-3:14", "*4:40-4:47"] }, { "id": 3, "usr": "c:@S@Derived", "short_name": "Derived", "qualified_name": "Derived", - "definition": "4:7", + "definition_spelling": "4:7-4:14", + "definition_extent": "4:1-4:50", "parents": [1, 2], - "uses": ["*4:7"] + "uses": ["*4:7-4:14"] }] } */ diff --git a/tests/inheritance/function_override.cc b/tests/inheritance/function_override.cc index 057de4ec..c24b304f 100644 --- a/tests/inheritance/function_override.cc +++ b/tests/inheritance/function_override.cc @@ -13,38 +13,41 @@ OUTPUT: "usr": "c:@S@Root", "short_name": "Root", "qualified_name": "Root", - "definition": "1:7", + "definition_spelling": "1:7-1:11", + "definition_extent": "1:1-3:2", "derived": [1], "funcs": [0], - "uses": ["*1:7", "*4:24"] + "uses": ["*1:7-1:11", "*4:24-4:28"] }, { "id": 1, "usr": "c:@S@Derived", "short_name": "Derived", "qualified_name": "Derived", - "definition": "4:7", + "definition_spelling": "4:7-4:14", + "definition_extent": "4:1-6:2", "parents": [0], "funcs": [1], - "uses": ["*4:7"] + "uses": ["*4:7-4:14"] }], "funcs": [{ "id": 0, "usr": "c:@S@Root@F@foo#", "short_name": "foo", "qualified_name": "Root::foo", - "declarations": ["2:16"], + "declarations": ["2:16-2:19"], "declaring_type": 0, "derived": [1], - "uses": ["2:16"] + "uses": ["2:16-2:19"] }, { "id": 1, "usr": "c:@S@Derived@F@foo#", "short_name": "foo", "qualified_name": "Derived::foo", - "definition": "5:8", + "definition_spelling": "5:8-5:11", + "definition_extent": "5:3-5:25", "declaring_type": 1, "base": 0, - "uses": ["5:8"] + "uses": ["5:8-5:11"] }] } */ diff --git a/tests/inheritance/interface_pure_virtual.cc b/tests/inheritance/interface_pure_virtual.cc index 7ba6c331..3f96e07a 100644 --- a/tests/inheritance/interface_pure_virtual.cc +++ b/tests/inheritance/interface_pure_virtual.cc @@ -10,18 +10,20 @@ OUTPUT: "usr": "c:@S@IFoo", "short_name": "IFoo", "qualified_name": "IFoo", - "definition": "1:7", + "definition_spelling": "1:7-1:11", + "definition_extent": "1:1-3:2", "funcs": [0], - "uses": ["*1:7"] + "uses": ["*1:7-1:11"] }], "funcs": [{ "id": 0, "usr": "c:@S@IFoo@F@foo#", "short_name": "foo", "qualified_name": "IFoo::foo", - "definition": "2:16", + "definition_spelling": "2:16-2:19", + "definition_extent": "2:3-2:28", "declaring_type": 0, - "uses": ["2:16"] + "uses": ["2:16-2:19"] }] } */ diff --git a/tests/method_declaration.cc b/tests/method_declaration.cc index 82b47cdc..05330238 100644 --- a/tests/method_declaration.cc +++ b/tests/method_declaration.cc @@ -14,18 +14,19 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:7", + "definition_spelling": "1:7-1:10", + "definition_extent": "1:1-3:2", "funcs": [0], - "uses": ["*1:7"] + "uses": ["*1:7-1:10"] }], "funcs": [{ "id": 0, "usr": "c:@S@Foo@F@foo#", "short_name": "foo", "qualified_name": "Foo::foo", - "declarations": ["2:8"], + "declarations": ["2:8-2:11"], "declaring_type": 0, - "uses": ["2:8"] + "uses": ["2:8-2:11"] }] } */ diff --git a/tests/method_definition.cc b/tests/method_definition.cc index 936d98e9..af364e0c 100644 --- a/tests/method_definition.cc +++ b/tests/method_definition.cc @@ -12,19 +12,21 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:7", + "definition_spelling": "1:7-1:10", + "definition_extent": "1:1-3:2", "funcs": [0], - "uses": ["*1:7", "5:6"] + "uses": ["*1:7-1:10", "5:6-5:9"] }], "funcs": [{ "id": 0, "usr": "c:@S@Foo@F@foo#", "short_name": "foo", "qualified_name": "Foo::foo", - "declarations": ["2:8"], - "definition": "5:11", + "declarations": ["2:8-2:11"], + "definition_spelling": "5:11-5:14", + "definition_extent": "5:1-5:19", "declaring_type": 0, - "uses": ["2:8", "5:11"] + "uses": ["2:8-2:11", "5:11-5:14"] }] } */ diff --git a/tests/method_inline_declaration.cc b/tests/method_inline_declaration.cc index 2af64567..9ab8ebb1 100644 --- a/tests/method_inline_declaration.cc +++ b/tests/method_inline_declaration.cc @@ -10,18 +10,20 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:7", + "definition_spelling": "1:7-1:10", + "definition_extent": "1:1-3:2", "funcs": [0], - "uses": ["*1:7"] + "uses": ["*1:7-1:10"] }], "funcs": [{ "id": 0, "usr": "c:@S@Foo@F@foo#", "short_name": "foo", "qualified_name": "Foo::foo", - "definition": "2:8", + "definition_spelling": "2:8-2:11", + "definition_extent": "2:3-2:16", "declaring_type": 0, - "uses": ["2:8"] + "uses": ["2:8-2:11"] }] } */ diff --git a/tests/multi_file/header.h b/tests/multi_file/header.h index 30e1c1bd..0392794b 100644 --- a/tests/multi_file/header.h +++ b/tests/multi_file/header.h @@ -32,90 +32,101 @@ OUTPUT: "usr": "c:@S@Base", "short_name": "Base", "qualified_name": "Base", - "definition": "10:8", + "definition_spelling": "10:8-10:12", + "definition_extent": "10:1-10:15", "derived": [1], - "uses": ["*10:8", "*12:26"] + "uses": ["*10:8-10:12", "*12:26-12:30"] }, { "id": 1, "usr": "c:@S@SameFileDerived", "short_name": "SameFileDerived", "qualified_name": "SameFileDerived", - "definition": "12:8", + "definition_spelling": "12:8-12:23", + "definition_extent": "12:1-12:33", "parents": [0], - "uses": ["*12:8", "*14:14"] + "uses": ["*12:8-12:23", "*14:14-14:29"] }, { "id": 2, "usr": "c:@Foo0", "short_name": "Foo0", "qualified_name": "Foo0", - "definition": "14:7", + "definition_spelling": "14:7-14:11", + "definition_extent": "14:1-14:29", "alias_of": 1, - "uses": ["*14:7"] + "uses": ["*14:7-14:11"] }, { "id": 3, "usr": "c:@ST>1#T@Foo2", "short_name": "Foo2", "qualified_name": "Foo2", - "definition": "20:8", - "uses": ["*20:8"] + "definition_spelling": "20:8-20:12", + "definition_extent": "20:1-20:15", + "uses": ["*20:8-20:12"] }, { "id": 4, "usr": "c:@E@Foo3", "short_name": "Foo3", "qualified_name": "Foo3", - "definition": "22:6", + "definition_spelling": "22:6-22:10", + "definition_extent": "22:1-22:22", "vars": [0, 1, 2], - "uses": ["*22:6"] + "uses": ["*22:6-22:10"] }], "funcs": [{ "id": 0, "usr": "c:@FT@>1#TFoo1#v#", "short_name": "Foo1", "qualified_name": "Foo1", - "definition": "17:6", - "uses": ["17:6"] + "definition_spelling": "17:6-17:10", + "definition_extent": "17:1-17:12", + "uses": ["17:6-17:10"] }], "vars": [{ "id": 0, "usr": "c:@E@Foo3@A", "short_name": "A", "qualified_name": "Foo3::A", - "definition": "22:13", + "definition_spelling": "22:13-22:14", + "definition_extent": "22:13-22:14", "variable_type": 4, "declaring_type": 4, - "uses": ["22:13"] + "uses": ["22:13-22:14"] }, { "id": 1, "usr": "c:@E@Foo3@B", "short_name": "B", "qualified_name": "Foo3::B", - "definition": "22:16", + "definition_spelling": "22:16-22:17", + "definition_extent": "22:16-22:17", "variable_type": 4, "declaring_type": 4, - "uses": ["22:16"] + "uses": ["22:16-22:17"] }, { "id": 2, "usr": "c:@E@Foo3@C", "short_name": "C", "qualified_name": "Foo3::C", - "definition": "22:19", + "definition_spelling": "22:19-22:20", + "definition_extent": "22:19-22:20", "variable_type": 4, "declaring_type": 4, - "uses": ["22:19"] + "uses": ["22:19-22:20"] }, { "id": 3, "usr": "c:@Foo4", "short_name": "Foo4", "qualified_name": "Foo4", - "definition": "24:5", - "uses": ["24:5"] + "definition_spelling": "24:5-24:9", + "definition_extent": "24:1-24:9", + "uses": ["24:5-24:9"] }, { "id": 4, "usr": "c:header.h@Foo5", "short_name": "Foo5", "qualified_name": "Foo5", - "definition": "25:12", - "uses": ["25:12"] + "definition_spelling": "25:12-25:16", + "definition_extent": "25:1-25:16", + "uses": ["25:12-25:16"] }] } */ diff --git a/tests/namespaces/anonymous_function.cc b/tests/namespaces/anonymous_function.cc index 32cccd91..a777da12 100644 --- a/tests/namespaces/anonymous_function.cc +++ b/tests/namespaces/anonymous_function.cc @@ -10,8 +10,8 @@ OUTPUT: "usr": "c:anonymous_function.cc@aN@F@foo#", "short_name": "foo", "qualified_name": "::foo", - "declarations": ["2:6"], - "uses": ["2:6"] + "declarations": ["2:6-2:9"], + "uses": ["2:6-2:9"] }] } */ diff --git a/tests/namespaces/function_declaration.cc b/tests/namespaces/function_declaration.cc index e9d7932e..4dbb03bf 100644 --- a/tests/namespaces/function_declaration.cc +++ b/tests/namespaces/function_declaration.cc @@ -10,8 +10,8 @@ OUTPUT: "usr": "c:@N@hello@F@foo#I#I#", "short_name": "foo", "qualified_name": "hello::foo", - "declarations": ["2:6"], - "uses": ["2:6"] + "declarations": ["2:6-2:9"], + "uses": ["2:6-2:9"] }] } */ diff --git a/tests/namespaces/function_definition.cc b/tests/namespaces/function_definition.cc index c9a491cd..715562c2 100644 --- a/tests/namespaces/function_definition.cc +++ b/tests/namespaces/function_definition.cc @@ -10,8 +10,9 @@ OUTPUT: "usr": "c:@N@hello@F@foo#", "short_name": "foo", "qualified_name": "hello::foo", - "definition": "2:6", - "uses": ["2:6"] + "definition_spelling": "2:6-2:9", + "definition_extent": "2:1-2:14", + "uses": ["2:6-2:9"] }] } */ diff --git a/tests/namespaces/method_declaration.cc b/tests/namespaces/method_declaration.cc index 10848d3b..5d0cce06 100644 --- a/tests/namespaces/method_declaration.cc +++ b/tests/namespaces/method_declaration.cc @@ -12,18 +12,19 @@ OUTPUT: "usr": "c:@N@hello@S@Foo", "short_name": "Foo", "qualified_name": "hello::Foo", - "definition": "2:7", + "definition_spelling": "2:7-2:10", + "definition_extent": "2:1-4:2", "funcs": [0], - "uses": ["*2:7"] + "uses": ["*2:7-2:10"] }], "funcs": [{ "id": 0, "usr": "c:@N@hello@S@Foo@F@foo#", "short_name": "foo", "qualified_name": "hello::Foo::foo", - "declarations": ["3:8"], + "declarations": ["3:8-3:11"], "declaring_type": 0, - "uses": ["3:8"] + "uses": ["3:8-3:11"] }] } */ diff --git a/tests/namespaces/method_definition.cc b/tests/namespaces/method_definition.cc index 4ef22e67..2f11b2ed 100644 --- a/tests/namespaces/method_definition.cc +++ b/tests/namespaces/method_definition.cc @@ -14,19 +14,21 @@ OUTPUT: "usr": "c:@N@hello@S@Foo", "short_name": "Foo", "qualified_name": "hello::Foo", - "definition": "2:7", + "definition_spelling": "2:7-2:10", + "definition_extent": "2:1-4:2", "funcs": [0], - "uses": ["*2:7", "6:6"] + "uses": ["*2:7-2:10", "6:6-6:9"] }], "funcs": [{ "id": 0, "usr": "c:@N@hello@S@Foo@F@foo#", "short_name": "foo", "qualified_name": "hello::Foo::foo", - "declarations": ["3:8"], - "definition": "6:11", + "declarations": ["3:8-3:11"], + "definition_spelling": "6:11-6:14", + "definition_extent": "6:1-6:19", "declaring_type": 0, - "uses": ["3:8", "6:11"] + "uses": ["3:8-3:11", "6:11-6:14"] }] } */ diff --git a/tests/namespaces/method_inline_declaration.cc b/tests/namespaces/method_inline_declaration.cc index c00839bd..9354402f 100644 --- a/tests/namespaces/method_inline_declaration.cc +++ b/tests/namespaces/method_inline_declaration.cc @@ -12,18 +12,20 @@ OUTPUT: "usr": "c:@N@hello@S@Foo", "short_name": "Foo", "qualified_name": "hello::Foo", - "definition": "2:7", + "definition_spelling": "2:7-2:10", + "definition_extent": "2:1-4:2", "funcs": [0], - "uses": ["*2:7"] + "uses": ["*2:7-2:10"] }], "funcs": [{ "id": 0, "usr": "c:@N@hello@S@Foo@F@foo#", "short_name": "foo", "qualified_name": "hello::Foo::foo", - "definition": "3:8", + "definition_spelling": "3:8-3:11", + "definition_extent": "3:3-3:16", "declaring_type": 0, - "uses": ["3:8"] + "uses": ["3:8-3:11"] }] } */ diff --git a/tests/namespaces/namespace_reference.cc b/tests/namespaces/namespace_reference.cc index bcc3a63b..572d4dcc 100644 --- a/tests/namespaces/namespace_reference.cc +++ b/tests/namespaces/namespace_reference.cc @@ -17,32 +17,36 @@ OUTPUT: "usr": "c:@N@ns@F@Accept#I#", "short_name": "Accept", "qualified_name": "ns::Accept", - "definition": "3:8", - "callers": ["1@7:7", "1@9:3"], - "uses": ["3:8", "7:7", "9:3"] + "definition_spelling": "3:8-3:14", + "definition_extent": "3:3-3:24", + "callers": ["1@7:7-7:13", "1@9:3-9:9"], + "uses": ["3:8-3:14", "7:7-7:13", "9:3-9:9"] }, { "id": 1, "usr": "c:@F@Runner#", "short_name": "Runner", "qualified_name": "Runner", - "definition": "6:6", - "callees": ["0@7:7", "0@9:3"], - "uses": ["6:6"] + "definition_spelling": "6:6-6:12", + "definition_extent": "6:1-10:2", + "callees": ["0@7:7-7:13", "0@9:3-9:9"], + "uses": ["6:6-6:12"] }], "vars": [{ "id": 0, "usr": "c:@N@ns@Foo", "short_name": "Foo", "qualified_name": "ns::Foo", - "definition": "2:7", - "uses": ["2:7", "7:18", "9:10"] + "definition_spelling": "2:7-2:10", + "definition_extent": "2:3-2:10", + "uses": ["2:7-2:10", "7:18-7:21", "9:10-9:13"] }, { "id": 1, "usr": "c:namespace_reference.cc@42@N@ns@F@Accept#I#@a", "short_name": "a", "qualified_name": "a", - "definition": "3:19", - "uses": ["3:19"] + "definition_spelling": "3:19-3:20", + "definition_extent": "3:15-3:20", + "uses": ["3:19-3:20"] }] } */ diff --git a/tests/outline/outline.cc b/tests/outline/outline.cc index c5f7cfc7..e20b9d00 100644 --- a/tests/outline/outline.cc +++ b/tests/outline/outline.cc @@ -14,40 +14,44 @@ OUTPUT: "usr": "c:@S@MergeableUpdate", "short_name": "MergeableUpdate", "qualified_name": "MergeableUpdate", - "definition": "3:8", + "definition_spelling": "3:8-3:23", + "definition_extent": "3:1-7:2", "vars": [0, 1, 2], - "uses": ["*3:8"] + "uses": ["*3:8-3:23"] }, { "id": 1, "usr": "c:@N@std@ST>2#T#T@vector", "instantiations": [2], - "uses": ["*6:8"] + "uses": ["*6:8-6:14"] }], "vars": [{ "id": 0, "usr": "c:@S@MergeableUpdate@FI@a", "short_name": "a", "qualified_name": "MergeableUpdate::a", - "definition": "4:7", + "definition_spelling": "4:7-4:8", + "definition_extent": "4:3-4:8", "declaring_type": 0, - "uses": ["4:7"] + "uses": ["4:7-4:8"] }, { "id": 1, "usr": "c:@S@MergeableUpdate@FI@b", "short_name": "b", "qualified_name": "MergeableUpdate::b", - "definition": "5:7", + "definition_spelling": "5:7-5:8", + "definition_extent": "5:3-5:8", "declaring_type": 0, - "uses": ["5:7"] + "uses": ["5:7-5:8"] }, { "id": 2, "usr": "c:@S@MergeableUpdate@FI@to_add", "short_name": "to_add", "qualified_name": "MergeableUpdate::to_add", - "definition": "6:20", + "definition_spelling": "6:20-6:26", + "definition_extent": "6:3-6:26", "variable_type": 1, "declaring_type": 0, - "uses": ["6:20"] + "uses": ["6:20-6:26"] }] } */ diff --git a/tests/outline/outline2.cc b/tests/outline/outline2.cc index a8c1b0ef..e5452d94 100644 --- a/tests/outline/outline2.cc +++ b/tests/outline/outline2.cc @@ -19,55 +19,59 @@ OUTPUT: "usr": "c:@S@CompilationEntry", "short_name": "CompilationEntry", "qualified_name": "CompilationEntry", - "definition": "6:8", + "definition_spelling": "6:8-6:24", + "definition_extent": "6:1-10:2", "vars": [0, 1, 2], - "uses": ["*6:8", "*12:13"] + "uses": ["*6:8-6:24", "*12:13-12:29"] }, { "id": 1, "usr": "c:@N@std@T@string", "instantiations": [0, 1], - "uses": ["*7:8", "*8:8", "*9:20"] + "uses": ["*7:8-7:14", "*8:8-8:14", "*9:20-9:26"] }, { "id": 2, "usr": "c:@N@std@ST>2#T#T@vector", "instantiations": [2], - "uses": ["*9:8", "*12:6"] + "uses": ["*9:8-9:14", "*12:6-12:12"] }], "funcs": [{ "id": 0, "usr": "c:@F@LoadCompilationEntriesFromDirectory#&1$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#", "short_name": "LoadCompilationEntriesFromDirectory", "qualified_name": "LoadCompilationEntriesFromDirectory", - "declarations": ["12:31"], - "uses": ["12:31"] + "declarations": ["12:31-12:66"], + "uses": ["12:31-12:66"] }], "vars": [{ "id": 0, "usr": "c:@S@CompilationEntry@FI@directory", "short_name": "directory", "qualified_name": "CompilationEntry::directory", - "definition": "7:15", + "definition_spelling": "7:15-7:24", + "definition_extent": "7:3-7:24", "variable_type": 1, "declaring_type": 0, - "uses": ["7:15"] + "uses": ["7:15-7:24"] }, { "id": 1, "usr": "c:@S@CompilationEntry@FI@filename", "short_name": "filename", "qualified_name": "CompilationEntry::filename", - "definition": "8:15", + "definition_spelling": "8:15-8:23", + "definition_extent": "8:3-8:23", "variable_type": 1, "declaring_type": 0, - "uses": ["8:15"] + "uses": ["8:15-8:23"] }, { "id": 2, "usr": "c:@S@CompilationEntry@FI@args", "short_name": "args", "qualified_name": "CompilationEntry::args", - "definition": "9:28", + "definition_spelling": "9:28-9:32", + "definition_extent": "9:3-9:32", "variable_type": 2, "declaring_type": 0, - "uses": ["9:28"] + "uses": ["9:28-9:32"] }] } */ \ No newline at end of file diff --git a/tests/templates/func_specialized_template_param.cc b/tests/templates/func_specialized_template_param.cc index bce181e9..0bee7bdb 100644 --- a/tests/templates/func_specialized_template_param.cc +++ b/tests/templates/func_specialized_template_param.cc @@ -15,26 +15,29 @@ OUTPUT: "usr": "c:@ST>1#T@Template", "short_name": "Template", "qualified_name": "Template", - "definition": "2:7", - "uses": ["*2:7", "5:12", "*8:15"] + "definition_spelling": "2:7-2:15", + "definition_extent": "2:1-2:18", + "uses": ["*2:7-2:15", "5:12-5:20", "*8:15-8:23"] }, { "id": 1, "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "4:8", + "definition_spelling": "4:8-4:11", + "definition_extent": "4:1-6:2", "funcs": [0], - "uses": ["*4:8", "8:6"] + "uses": ["*4:8-4:11", "8:6-8:9"] }], "funcs": [{ "id": 0, "usr": "c:@S@Foo@F@Bar#&$@S@Template>#d#", "short_name": "Bar", "qualified_name": "Foo::Bar", - "declarations": ["5:8"], - "definition": "8:11", + "declarations": ["5:8-5:11"], + "definition_spelling": "8:11-8:14", + "definition_extent": "8:1-8:36", "declaring_type": 1, - "uses": ["5:8", "8:11"] + "uses": ["5:8-5:11", "8:11-8:14"] }] } */ diff --git a/tests/templates/implicit_variable_instantiation.cc b/tests/templates/implicit_variable_instantiation.cc index 3b988ebf..ab575341 100644 --- a/tests/templates/implicit_variable_instantiation.cc +++ b/tests/templates/implicit_variable_instantiation.cc @@ -22,42 +22,47 @@ OUTPUT: "usr": "c:@N@ns@E@VarType", "short_name": "VarType", "qualified_name": "ns::VarType", - "definition": "2:8", + "definition_spelling": "2:8-2:15", + "definition_extent": "2:3-2:18", "instantiations": [0], - "uses": ["*2:8", "*6:22", "*6:44", "*10:18"] + "uses": ["*2:8-2:15", "*6:22-6:29", "*6:44-6:51", "*10:18-10:25"] }, { "id": 1, "usr": "c:@N@ns@ST>1#T@Holder", "short_name": "Holder", "qualified_name": "ns::Holder", - "definition": "5:10", + "definition_spelling": "5:10-5:16", + "definition_extent": "5:3-7:4", "vars": [0], - "uses": ["*5:10", "*10:26", "13:13", "14:14"] + "uses": ["*5:10-5:16", "*10:26-10:32", "13:13-13:19", "14:14-14:20"] }], "vars": [{ "id": 0, "usr": "c:@N@ns@ST>1#T@Holder@static_var", "short_name": "static_var", "qualified_name": "ns::Holder::static_var", - "declaration": "6:30", - "definition": "10:37", + "declaration": "6:30-6:40", + "definition_spelling": "10:37-10:47", + "definition_extent": "9:3-10:47", "variable_type": 0, "declaring_type": 1, - "uses": ["6:30", "10:37", "13:26", "14:27"] + "uses": ["6:30-6:40", "10:37-10:47", "13:26-13:36", "14:27-14:37"] }, { "id": 1, "usr": "c:@N@ns@Foo", "short_name": "Foo", "qualified_name": "ns::Foo", - "definition": "13:7", - "uses": ["13:7"] + "definition_spelling": "13:7-13:10", + "definition_extent": "13:3-13:36", + "uses": ["13:7-13:10"] }, { "id": 2, "usr": "c:@N@ns@Foo2", "short_name": "Foo2", "qualified_name": "ns::Foo2", - "definition": "14:7", - "uses": ["14:7"] + "definition_spelling": "14:7-14:11", + "definition_extent": "14:3-14:37", + "uses": ["14:7-14:11"] }] } */ diff --git a/tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc b/tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc index 3b2cc010..f3a95441 100644 --- a/tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc +++ b/tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc @@ -19,33 +19,37 @@ OUTPUT: "usr": "c:@N@ns@ST>1#T@Foo", "short_name": "Foo", "qualified_name": "ns::Foo", - "definition": "3:10", + "definition_spelling": "3:10-3:13", + "definition_extent": "3:3-8:4", "funcs": [0], - "uses": ["*3:10", "10:11", "11:11"] + "uses": ["*3:10-3:13", "10:11-10:14", "11:11-11:14"] }], "funcs": [{ "id": 0, "usr": "c:@N@ns@ST>1#T@Foo@FT@>1#Tfoo#I#S", "short_name": "foo", "qualified_name": "ns::Foo::foo", - "definition": "5:16", + "definition_spelling": "5:16-5:19", + "definition_extent": "5:5-7:6", "declaring_type": 0, - "uses": ["5:16", "10:21", "11:22"] + "uses": ["5:16-5:19", "10:21-10:24", "11:22-11:25"] }], "vars": [{ "id": 0, "usr": "c:@N@ns@a", "short_name": "a", "qualified_name": "ns::a", - "definition": "10:7", - "uses": ["10:7"] + "definition_spelling": "10:7-10:8", + "definition_extent": "10:3-10:33", + "uses": ["10:7-10:8"] }, { "id": 1, "usr": "c:@N@ns@b", "short_name": "b", "qualified_name": "ns::b", - "definition": "11:7", - "uses": ["11:7"] + "definition_spelling": "11:7-11:8", + "definition_extent": "11:3-11:35", + "uses": ["11:7-11:8"] }] } */ diff --git a/tests/templates/namespace_template_type_usage_folded_into_one.cc b/tests/templates/namespace_template_type_usage_folded_into_one.cc index 24ad286d..ad1141fb 100644 --- a/tests/templates/namespace_template_type_usage_folded_into_one.cc +++ b/tests/templates/namespace_template_type_usage_folded_into_one.cc @@ -14,26 +14,29 @@ OUTPUT: "usr": "c:@N@ns@ST>1#T@Foo", "short_name": "Foo", "qualified_name": "ns::Foo", - "definition": "3:9", + "definition_spelling": "3:9-3:12", + "definition_extent": "3:3-3:15", "instantiations": [0, 1], - "uses": ["*3:9", "*5:3", "*6:3"] + "uses": ["*3:9-3:12", "*5:3-5:6", "*6:3-6:6"] }], "vars": [{ "id": 0, "usr": "c:@N@ns@a", "short_name": "a", "qualified_name": "ns::a", - "definition": "5:12", + "definition_spelling": "5:12-5:13", + "definition_extent": "5:3-5:13", "variable_type": 0, - "uses": ["5:12"] + "uses": ["5:12-5:13"] }, { "id": 1, "usr": "c:@N@ns@b", "short_name": "b", "qualified_name": "ns::b", - "definition": "6:13", + "definition_spelling": "6:13-6:14", + "definition_extent": "6:3-6:14", "variable_type": 0, - "uses": ["6:13"] + "uses": ["6:13-6:14"] }] } */ diff --git a/tests/templates/specialized_func_definition.cc b/tests/templates/specialized_func_definition.cc index 65bb6bed..d6fa8d64 100644 --- a/tests/templates/specialized_func_definition.cc +++ b/tests/templates/specialized_func_definition.cc @@ -20,19 +20,21 @@ OUTPUT: "usr": "c:@ST>1#T@Template", "short_name": "Template", "qualified_name": "Template", - "definition": "2:7", + "definition_spelling": "2:7-2:15", + "definition_extent": "2:1-4:2", "funcs": [0], - "uses": ["*2:7", "*7:6", "9:6"] + "uses": ["*2:7-2:15", "*7:6-7:14", "9:6-9:14"] }], "funcs": [{ "id": 0, "usr": "c:@ST>1#T@Template@F@Foo#", "short_name": "Foo", "qualified_name": "Template::Foo", - "declarations": ["3:8", "9:22"], - "definition": "7:19", + "declarations": ["3:8-3:11", "9:22-9:25"], + "definition_spelling": "7:19-7:22", + "definition_extent": "6:1-7:24", "declaring_type": 0, - "uses": ["3:8", "7:19", "9:22"] + "uses": ["3:8-3:11", "7:19-7:22", "9:22-9:25"] }] } */ diff --git a/tests/templates/template_class_func_usage_folded_into_one.cc b/tests/templates/template_class_func_usage_folded_into_one.cc index 743c4a91..0bff28dc 100644 --- a/tests/templates/template_class_func_usage_folded_into_one.cc +++ b/tests/templates/template_class_func_usage_folded_into_one.cc @@ -16,33 +16,37 @@ OUTPUT: "usr": "c:@ST>1#T@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "2:8", + "definition_spelling": "2:8-2:11", + "definition_extent": "2:1-6:2", "funcs": [0], - "uses": ["*2:8", "8:9", "9:9"] + "uses": ["*2:8-2:11", "8:9-8:12", "9:9-9:12"] }], "funcs": [{ "id": 0, "usr": "c:@ST>1#T@Foo@F@foo#S", "short_name": "foo", "qualified_name": "Foo::foo", - "definition": "3:14", + "definition_spelling": "3:14-3:17", + "definition_extent": "3:3-5:4", "declaring_type": 0, - "uses": ["3:14", "8:19", "9:20"] + "uses": ["3:14-3:17", "8:19-8:22", "9:20-9:23"] }], "vars": [{ "id": 0, "usr": "c:@a", "short_name": "a", "qualified_name": "a", - "definition": "8:5", - "uses": ["8:5"] + "definition_spelling": "8:5-8:6", + "definition_extent": "8:1-8:24", + "uses": ["8:5-8:6"] }, { "id": 1, "usr": "c:@b", "short_name": "b", "qualified_name": "b", - "definition": "9:5", - "uses": ["9:5"] + "definition_spelling": "9:5-9:6", + "definition_extent": "9:1-9:25", + "uses": ["9:5-9:6"] }] } */ diff --git a/tests/templates/template_class_template_func_usage_folded_into_one.cc b/tests/templates/template_class_template_func_usage_folded_into_one.cc index 413502dd..10d81449 100644 --- a/tests/templates/template_class_template_func_usage_folded_into_one.cc +++ b/tests/templates/template_class_template_func_usage_folded_into_one.cc @@ -17,33 +17,37 @@ OUTPUT: "usr": "c:@ST>1#T@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "2:8", + "definition_spelling": "2:8-2:11", + "definition_extent": "2:1-7:2", "funcs": [0], - "uses": ["*2:8", "9:9", "10:9"] + "uses": ["*2:8-2:11", "9:9-9:12", "10:9-10:12"] }], "funcs": [{ "id": 0, "usr": "c:@ST>1#T@Foo@FT@>1#Tfoo#I#S", "short_name": "foo", "qualified_name": "Foo::foo", - "definition": "4:14", + "definition_spelling": "4:14-4:17", + "definition_extent": "4:3-6:4", "declaring_type": 0, - "uses": ["4:14", "9:19", "10:20"] + "uses": ["4:14-4:17", "9:19-9:22", "10:20-10:23"] }], "vars": [{ "id": 0, "usr": "c:@a", "short_name": "a", "qualified_name": "a", - "definition": "9:5", - "uses": ["9:5"] + "definition_spelling": "9:5-9:6", + "definition_extent": "9:1-9:31", + "uses": ["9:5-9:6"] }, { "id": 1, "usr": "c:@b", "short_name": "b", "qualified_name": "b", - "definition": "10:5", - "uses": ["10:5"] + "definition_spelling": "10:5-10:6", + "definition_extent": "10:1-10:33", + "uses": ["10:5-10:6"] }] } */ diff --git a/tests/templates/template_class_type_usage_folded_into_one.cc b/tests/templates/template_class_type_usage_folded_into_one.cc index 95548913..3b5a3b61 100644 --- a/tests/templates/template_class_type_usage_folded_into_one.cc +++ b/tests/templates/template_class_type_usage_folded_into_one.cc @@ -35,47 +35,53 @@ OUTPUT: "usr": "c:@E@A", "short_name": "A", "qualified_name": "A", - "definition": "1:6", - "uses": ["*1:6", "*9:5"] + "definition_spelling": "1:6-1:7", + "definition_extent": "1:1-1:10", + "uses": ["*1:6-1:7", "*9:5-9:6"] }, { "id": 1, "usr": "c:@E@B", "short_name": "B", "qualified_name": "B", - "definition": "2:6", - "uses": ["*2:6", "*10:5"] + "definition_spelling": "2:6-2:7", + "definition_extent": "2:1-2:10", + "uses": ["*2:6-2:7", "*10:5-10:6"] }, { "id": 2, "usr": "c:@ST>1#T@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "5:8", - "uses": ["*5:8", "*9:1", "*10:1"] + "definition_spelling": "5:8-5:11", + "definition_extent": "5:1-7:2", + "uses": ["*5:8-5:11", "*9:1-9:4", "*10:1-10:4"] }, { "id": 3, "usr": "c:@ST>1#T@Foo@S@Inner", "short_name": "Inner", "qualified_name": "Foo::Inner", - "definition": "6:10", + "definition_spelling": "6:10-6:15", + "definition_extent": "6:3-6:18", "instantiations": [0, 1], - "uses": ["*6:10", "*9:9", "*10:9"] + "uses": ["*6:10-6:15", "*9:9-9:14", "*10:9-10:14"] }], "vars": [{ "id": 0, "usr": "c:@a", "short_name": "a", "qualified_name": "a", - "definition": "9:15", + "definition_spelling": "9:15-9:16", + "definition_extent": "9:1-9:16", "variable_type": 3, - "uses": ["9:15"] + "uses": ["9:15-9:16"] }, { "id": 1, "usr": "c:@b", "short_name": "b", "qualified_name": "b", - "definition": "10:15", + "definition_spelling": "10:15-10:16", + "definition_extent": "10:1-10:16", "variable_type": 3, - "uses": ["10:15"] + "uses": ["10:15-10:16"] }] } */ diff --git a/tests/templates/template_class_var_usage_folded_into_one.cc b/tests/templates/template_class_var_usage_folded_into_one.cc index 8d7459d9..4df08b39 100644 --- a/tests/templates/template_class_var_usage_folded_into_one.cc +++ b/tests/templates/template_class_var_usage_folded_into_one.cc @@ -14,30 +14,33 @@ OUTPUT: "usr": "c:@ST>1#T@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "2:8", - "uses": ["*2:8", "6:9", "7:9"] + "definition_spelling": "2:8-2:11", + "definition_extent": "2:1-4:2", + "uses": ["*2:8-2:11", "6:9-6:12", "7:9-7:12"] }], "vars": [{ "id": 0, "usr": "c:@ST>1#T@Foo@var", "short_name": "var", "qualified_name": "Foo::var", - "declaration": "3:24", - "uses": ["3:24", "6:19", "7:20"] + "declaration": "3:24-3:27", + "uses": ["3:24-3:27", "6:19-6:22", "7:20-7:23"] }, { "id": 1, "usr": "c:@a", "short_name": "a", "qualified_name": "a", - "definition": "6:5", - "uses": ["6:5"] + "definition_spelling": "6:5-6:6", + "definition_extent": "6:1-6:22", + "uses": ["6:5-6:6"] }, { "id": 2, "usr": "c:@b", "short_name": "b", "qualified_name": "b", - "definition": "7:5", - "uses": ["7:5"] + "definition_spelling": "7:5-7:6", + "definition_extent": "7:1-7:23", + "uses": ["7:5-7:6"] }] } */ diff --git a/tests/templates/template_func_usage_folded_into_one.cc b/tests/templates/template_func_usage_folded_into_one.cc index f2a28b43..89fa26f6 100644 --- a/tests/templates/template_func_usage_folded_into_one.cc +++ b/tests/templates/template_func_usage_folded_into_one.cc @@ -17,23 +17,26 @@ OUTPUT: "usr": "c:template_func_usage_folded_into_one.cc@FT@>1#Tfoo#I#", "short_name": "foo", "qualified_name": "foo", - "definition": "2:12", - "uses": ["2:12", "6:9", "7:9"] + "definition_spelling": "2:12-2:15", + "definition_extent": "2:1-4:2", + "uses": ["2:12-2:15", "6:9-6:12", "7:9-7:12"] }], "vars": [{ "id": 0, "usr": "c:@a", "short_name": "a", "qualified_name": "a", - "definition": "6:5", - "uses": ["6:5"] + "definition_spelling": "6:5-6:6", + "definition_extent": "6:1-6:19", + "uses": ["6:5-6:6"] }, { "id": 1, "usr": "c:@b", "short_name": "b", "qualified_name": "b", - "definition": "7:5", - "uses": ["7:5"] + "definition_spelling": "7:5-7:6", + "definition_extent": "7:1-7:20", + "uses": ["7:5-7:6"] }] } */ diff --git a/tests/templates/template_type_usage_folded_into_one.cc b/tests/templates/template_type_usage_folded_into_one.cc index 394c9b1f..46c65c40 100644 --- a/tests/templates/template_type_usage_folded_into_one.cc +++ b/tests/templates/template_type_usage_folded_into_one.cc @@ -12,26 +12,29 @@ OUTPUT: "usr": "c:@ST>1#T@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "2:7", + "definition_spelling": "2:7-2:10", + "definition_extent": "2:1-2:13", "instantiations": [0, 1], - "uses": ["*2:7", "*4:1", "*5:1"] + "uses": ["*2:7-2:10", "*4:1-4:4", "*5:1-5:4"] }], "vars": [{ "id": 0, "usr": "c:@a", "short_name": "a", "qualified_name": "a", - "definition": "4:10", + "definition_spelling": "4:10-4:11", + "definition_extent": "4:1-4:11", "variable_type": 0, - "uses": ["4:10"] + "uses": ["4:10-4:11"] }, { "id": 1, "usr": "c:@b", "short_name": "b", "qualified_name": "b", - "definition": "5:11", + "definition_spelling": "5:11-5:12", + "definition_extent": "5:1-5:12", "variable_type": 0, - "uses": ["5:11"] + "uses": ["5:11-5:12"] }] } */ diff --git a/tests/templates/template_var_usage_folded_into_one.cc b/tests/templates/template_var_usage_folded_into_one.cc index c0df8b9f..16627f5a 100644 --- a/tests/templates/template_var_usage_folded_into_one.cc +++ b/tests/templates/template_var_usage_folded_into_one.cc @@ -35,41 +35,46 @@ OUTPUT: "usr": "c:@E@A", "short_name": "A", "qualified_name": "A", - "definition": "1:6", - "uses": ["*1:6", "7:13"] + "definition_spelling": "1:6-1:7", + "definition_extent": "1:1-1:10", + "uses": ["*1:6-1:7", "7:13-7:14"] }, { "id": 1, "usr": "c:@E@B", "short_name": "B", "qualified_name": "B", - "definition": "2:6", - "uses": ["*2:6", "8:13"] + "definition_spelling": "2:6-2:7", + "definition_extent": "2:1-2:10", + "uses": ["*2:6-2:7", "8:13-8:14"] }, { "id": 2, "usr": "c:template_var_usage_folded_into_one.cc@35", - "uses": ["*5:1"] + "uses": ["*5:1-5:2"] }], "vars": [{ "id": 0, "usr": "c:@VT>1#T@var", "short_name": "var", "qualified_name": "var", - "definition": "5:3", - "uses": ["5:3", "7:9", "8:9"] + "definition_spelling": "5:3-5:6", + "definition_extent": "5:1-5:10", + "uses": ["5:3-5:6", "7:9-7:12", "8:9-8:12"] }, { "id": 1, "usr": "c:@a", "short_name": "a", "qualified_name": "a", - "definition": "7:5", - "uses": ["7:5"] + "definition_spelling": "7:5-7:6", + "definition_extent": "7:1-7:15", + "uses": ["7:5-7:6"] }, { "id": 2, "usr": "c:@b", "short_name": "b", "qualified_name": "b", - "definition": "8:5", - "uses": ["8:5"] + "definition_spelling": "8:5-8:6", + "definition_extent": "8:1-8:15", + "uses": ["8:5-8:6"] }] } */ diff --git a/tests/types/anonymous_struct.cc b/tests/types/anonymous_struct.cc index 5f47e9f6..12b66328 100644 --- a/tests/types/anonymous_struct.cc +++ b/tests/types/anonymous_struct.cc @@ -11,50 +11,56 @@ OUTPUT: "usr": "c:@U@vector3", "short_name": "vector3", "qualified_name": "vector3", - "definition": "1:7", + "definition_spelling": "1:7-1:14", + "definition_extent": "1:1-4:2", "vars": [3], - "uses": ["*1:7"] + "uses": ["*1:7-1:14"] }, { "id": 1, "usr": "c:@U@vector3@Sa", "short_name": "", "qualified_name": "vector3::", - "definition": "2:3", + "definition_spelling": "2:3-2:9", + "definition_extent": "2:3-2:28", "vars": [0, 1, 2], - "uses": ["*2:3"] + "uses": ["*2:3-2:9"] }], "vars": [{ "id": 0, "usr": "c:@U@vector3@Sa@FI@x", "short_name": "x", "qualified_name": "x", - "definition": "2:18", + "definition_spelling": "2:18-2:19", + "definition_extent": "2:12-2:19", "declaring_type": 1, - "uses": ["2:18"] + "uses": ["2:18-2:19"] }, { "id": 1, "usr": "c:@U@vector3@Sa@FI@y", "short_name": "y", "qualified_name": "y", - "definition": "2:21", + "definition_spelling": "2:21-2:22", + "definition_extent": "2:12-2:22", "declaring_type": 1, - "uses": ["2:21"] + "uses": ["2:21-2:22"] }, { "id": 2, "usr": "c:@U@vector3@Sa@FI@z", "short_name": "z", "qualified_name": "z", - "definition": "2:24", + "definition_spelling": "2:24-2:25", + "definition_extent": "2:12-2:25", "declaring_type": 1, - "uses": ["2:24"] + "uses": ["2:24-2:25"] }, { "id": 3, "usr": "c:@U@vector3@FI@v", "short_name": "v", "qualified_name": "vector3::v", - "definition": "3:9", + "definition_spelling": "3:9-3:10", + "definition_extent": "3:3-3:13", "declaring_type": 0, - "uses": ["3:9"] + "uses": ["3:9-3:10"] }] } */ diff --git a/tests/unions/union_decl.cc b/tests/unions/union_decl.cc index 7059def7..c7c83149 100644 --- a/tests/unions/union_decl.cc +++ b/tests/unions/union_decl.cc @@ -11,26 +11,29 @@ OUTPUT: "usr": "c:@U@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:7", + "definition_spelling": "1:7-1:10", + "definition_extent": "1:1-4:2", "vars": [0, 1], - "uses": ["*1:7"] + "uses": ["*1:7-1:10"] }], "vars": [{ "id": 0, "usr": "c:@U@Foo@FI@a", "short_name": "a", "qualified_name": "Foo::a", - "definition": "2:7", + "definition_spelling": "2:7-2:8", + "definition_extent": "2:3-2:8", "declaring_type": 0, - "uses": ["2:7"] + "uses": ["2:7-2:8"] }, { "id": 1, "usr": "c:@U@Foo@FI@b", "short_name": "b", "qualified_name": "Foo::b", - "definition": "3:8", + "definition_spelling": "3:8-3:9", + "definition_extent": "3:3-3:9", "declaring_type": 0, - "uses": ["3:8"] + "uses": ["3:8-3:9"] }] } */ diff --git a/tests/unions/union_usage.cc b/tests/unions/union_usage.cc index 79b97a5a..e4fb2697 100644 --- a/tests/unions/union_usage.cc +++ b/tests/unions/union_usage.cc @@ -19,43 +19,48 @@ OUTPUT: "usr": "c:@U@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:7", + "definition_spelling": "1:7-1:10", + "definition_extent": "1:1-4:2", "vars": [0, 1], "instantiations": [2], - "uses": ["*1:7", "*6:1", "*8:10"] + "uses": ["*1:7-1:10", "*6:1-6:4", "*8:10-8:13"] }], "funcs": [{ "id": 0, "usr": "c:@F@act#*$@U@Foo#", "short_name": "act", "qualified_name": "act", - "definition": "8:6", - "uses": ["8:6"] + "definition_spelling": "8:6-8:9", + "definition_extent": "8:1-10:2", + "uses": ["8:6-8:9"] }], "vars": [{ "id": 0, "usr": "c:@U@Foo@FI@a", "short_name": "a", "qualified_name": "Foo::a", - "definition": "2:7", + "definition_spelling": "2:7-2:8", + "definition_extent": "2:3-2:12", "declaring_type": 0, - "uses": ["2:7", "9:5"] + "uses": ["2:7-2:8", "9:5-9:6"] }, { "id": 1, "usr": "c:@U@Foo@FI@b", "short_name": "b", "qualified_name": "Foo::b", - "definition": "3:8", + "definition_spelling": "3:8-3:9", + "definition_extent": "3:3-3:13", "declaring_type": 0, - "uses": ["3:8"] + "uses": ["3:8-3:9"] }, { "id": 2, "usr": "c:@f", "short_name": "f", "qualified_name": "f", - "definition": "6:5", + "definition_spelling": "6:5-6:6", + "definition_extent": "6:1-6:6", "variable_type": 0, - "uses": ["6:5", "9:3"] + "uses": ["6:5-6:6", "9:3-9:4"] }] } */ diff --git a/tests/usage/func_usage_addr_func.cc b/tests/usage/func_usage_addr_func.cc index 84be0b60..1c010105 100644 --- a/tests/usage/func_usage_addr_func.cc +++ b/tests/usage/func_usage_addr_func.cc @@ -15,33 +15,37 @@ OUTPUT: "usr": "c:@F@consume#*v#", "short_name": "consume", "qualified_name": "consume", - "definition": "1:6", - "callers": ["2@7:3"], - "uses": ["1:6", "7:3"] + "definition_spelling": "1:6-1:13", + "definition_extent": "1:1-1:23", + "callers": ["2@7:3-7:10"], + "uses": ["1:6-1:13", "7:3-7:10"] }, { "id": 1, "usr": "c:@F@used#", "short_name": "used", "qualified_name": "used", - "definition": "3:6", - "callers": ["2@6:13", "2@7:12"], - "uses": ["3:6", "6:13", "7:12"] + "definition_spelling": "3:6-3:10", + "definition_extent": "3:1-3:15", + "callers": ["2@6:13-6:17", "2@7:12-7:16"], + "uses": ["3:6-3:10", "6:13-6:17", "7:12-7:16"] }, { "id": 2, "usr": "c:@F@user#", "short_name": "user", "qualified_name": "user", - "definition": "5:6", - "callees": ["1@6:13", "0@7:3", "1@7:12"], - "uses": ["5:6"] + "definition_spelling": "5:6-5:10", + "definition_extent": "5:1-8:2", + "callees": ["1@6:13-6:17", "0@7:3-7:10", "1@7:12-7:16"], + "uses": ["5:6-5:10"] }], "vars": [{ "id": 0, "usr": "c:func_usage_addr_func.cc@61@F@user#@x", "short_name": "x", "qualified_name": "x", - "definition": "6:8", - "uses": ["6:8"] + "definition_spelling": "6:8-6:9", + "definition_extent": "6:3-6:17", + "uses": ["6:8-6:9"] }] } */ diff --git a/tests/usage/func_usage_addr_method.cc b/tests/usage/func_usage_addr_method.cc index ad5d882d..c5d508c9 100644 --- a/tests/usage/func_usage_addr_method.cc +++ b/tests/usage/func_usage_addr_method.cc @@ -15,35 +15,38 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:8", + "definition_spelling": "1:8-1:11", + "definition_extent": "1:1-3:2", "funcs": [0], - "uses": ["*1:8", "6:13"] + "uses": ["*1:8-1:11", "6:13-6:16"] }], "funcs": [{ "id": 0, "usr": "c:@S@Foo@F@Used#", "short_name": "Used", "qualified_name": "Foo::Used", - "declarations": ["2:8"], + "declarations": ["2:8-2:12"], "declaring_type": 0, - "callers": ["1@6:18"], - "uses": ["2:8", "6:18"] + "callers": ["1@6:18-6:22"], + "uses": ["2:8-2:12", "6:18-6:22"] }, { "id": 1, "usr": "c:@F@user#", "short_name": "user", "qualified_name": "user", - "definition": "5:6", - "callees": ["0@6:18"], - "uses": ["5:6"] + "definition_spelling": "5:6-5:10", + "definition_extent": "5:1-7:2", + "callees": ["0@6:18-6:22"], + "uses": ["5:6-5:10"] }], "vars": [{ "id": 0, "usr": "c:func_usage_addr_method.cc@53@F@user#@x", "short_name": "x", "qualified_name": "x", - "definition": "6:8", - "uses": ["6:8"] + "definition_spelling": "6:8-6:9", + "definition_extent": "6:3-6:22", + "uses": ["6:8-6:9"] }] } */ diff --git a/tests/usage/func_usage_call_func.cc b/tests/usage/func_usage_call_func.cc index 22c3c71c..c7a405c4 100644 --- a/tests/usage/func_usage_call_func.cc +++ b/tests/usage/func_usage_call_func.cc @@ -11,17 +11,19 @@ OUTPUT: "usr": "c:@F@called#", "short_name": "called", "qualified_name": "called", - "definition": "1:6", - "callers": ["1@3:3"], - "uses": ["1:6", "3:3"] + "definition_spelling": "1:6-1:12", + "definition_extent": "1:1-1:17", + "callers": ["1@3:3-3:9"], + "uses": ["1:6-1:12", "3:3-3:9"] }, { "id": 1, "usr": "c:@F@caller#", "short_name": "caller", "qualified_name": "caller", - "definition": "2:6", - "callees": ["0@3:3"], - "uses": ["2:6"] + "definition_spelling": "2:6-2:12", + "definition_extent": "2:1-4:2", + "callees": ["0@3:3-3:9"], + "uses": ["2:6-2:12"] }] } */ diff --git a/tests/usage/func_usage_call_method.cc b/tests/usage/func_usage_call_method.cc index c87db140..d12d5495 100644 --- a/tests/usage/func_usage_call_method.cc +++ b/tests/usage/func_usage_call_method.cc @@ -15,37 +15,40 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:8", + "definition_spelling": "1:8-1:11", + "definition_extent": "1:1-3:2", "funcs": [0], "instantiations": [0], - "uses": ["*1:8", "*6:3"] + "uses": ["*1:8-1:11", "*6:3-6:6"] }], "funcs": [{ "id": 0, "usr": "c:@S@Foo@F@Used#", "short_name": "Used", "qualified_name": "Foo::Used", - "declarations": ["2:8"], + "declarations": ["2:8-2:12"], "declaring_type": 0, - "callers": ["1@7:6"], - "uses": ["2:8", "7:6"] + "callers": ["1@7:6-7:10"], + "uses": ["2:8-2:12", "7:6-7:10"] }, { "id": 1, "usr": "c:@F@user#", "short_name": "user", "qualified_name": "user", - "definition": "5:6", - "callees": ["0@7:6"], - "uses": ["5:6"] + "definition_spelling": "5:6-5:10", + "definition_extent": "5:1-8:2", + "callees": ["0@7:6-7:10"], + "uses": ["5:6-5:10"] }], "vars": [{ "id": 0, "usr": "c:func_usage_call_method.cc@53@F@user#@f", "short_name": "f", "qualified_name": "f", - "definition": "6:8", + "definition_spelling": "6:8-6:9", + "definition_extent": "6:3-6:19", "variable_type": 0, - "uses": ["6:8", "7:3"] + "uses": ["6:8-6:9", "7:3-7:4"] }] } */ diff --git a/tests/usage/func_usage_class_inline_var_def.cc b/tests/usage/func_usage_class_inline_var_def.cc index 205f3bc6..98c581e6 100644 --- a/tests/usage/func_usage_class_inline_var_def.cc +++ b/tests/usage/func_usage_class_inline_var_def.cc @@ -14,26 +14,29 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "5:7", + "definition_spelling": "5:7-5:10", + "definition_extent": "5:1-7:2", "vars": [0], - "uses": ["*5:7"] + "uses": ["*5:7-5:10"] }], "funcs": [{ "id": 0, "usr": "c:func_usage_class_inline_var_def.cc@F@helper#", "short_name": "helper", "qualified_name": "helper", - "definition": "1:12", - "uses": ["1:12", "6:11"] + "definition_spelling": "1:12-1:18", + "definition_extent": "1:1-3:2", + "uses": ["1:12-1:18", "6:11-6:17"] }], "vars": [{ "id": 0, "usr": "c:@S@Foo@FI@x", "short_name": "x", "qualified_name": "Foo::x", - "definition": "6:7", + "definition_spelling": "6:7-6:8", + "definition_extent": "6:3-6:19", "declaring_type": 0, - "uses": ["6:7"] + "uses": ["6:7-6:8"] }] } */ diff --git a/tests/usage/func_usage_forward_decl_func.cc b/tests/usage/func_usage_forward_decl_func.cc index df9b7be3..6adf0755 100644 --- a/tests/usage/func_usage_forward_decl_func.cc +++ b/tests/usage/func_usage_forward_decl_func.cc @@ -11,17 +11,18 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "declarations": ["1:6"], - "callers": ["1@4:3"], - "uses": ["1:6", "4:3"] + "declarations": ["1:6-1:9"], + "callers": ["1@4:3-4:6"], + "uses": ["1:6-1:9", "4:3-4:6"] }, { "id": 1, "usr": "c:@F@usage#", "short_name": "usage", "qualified_name": "usage", - "definition": "3:6", - "callees": ["0@4:3"], - "uses": ["3:6"] + "definition_spelling": "3:6-3:11", + "definition_extent": "3:1-5:2", + "callees": ["0@4:3-4:6"], + "uses": ["3:6-3:11"] }] } */ diff --git a/tests/usage/func_usage_forward_decl_method.cc b/tests/usage/func_usage_forward_decl_method.cc index b582409e..72dd22a6 100644 --- a/tests/usage/func_usage_forward_decl_method.cc +++ b/tests/usage/func_usage_forward_decl_method.cc @@ -14,37 +14,40 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:8", + "definition_spelling": "1:8-1:11", + "definition_extent": "1:1-3:2", "funcs": [0], "instantiations": [0], - "uses": ["*1:8", "*6:3"] + "uses": ["*1:8-1:11", "*6:3-6:6"] }], "funcs": [{ "id": 0, "usr": "c:@S@Foo@F@foo#", "short_name": "foo", "qualified_name": "Foo::foo", - "declarations": ["2:8"], + "declarations": ["2:8-2:11"], "declaring_type": 0, - "callers": ["1@7:6"], - "uses": ["2:8", "7:6"] + "callers": ["1@7:6-7:9"], + "uses": ["2:8-2:11", "7:6-7:9"] }, { "id": 1, "usr": "c:@F@usage#", "short_name": "usage", "qualified_name": "usage", - "definition": "5:6", - "callees": ["0@7:6"], - "uses": ["5:6"] + "definition_spelling": "5:6-5:11", + "definition_extent": "5:1-8:2", + "callees": ["0@7:6-7:9"], + "uses": ["5:6-5:11"] }], "vars": [{ "id": 0, "usr": "c:func_usage_forward_decl_method.cc@53@F@usage#@f", "short_name": "f", "qualified_name": "f", - "definition": "6:8", + "definition_spelling": "6:8-6:9", + "definition_extent": "6:3-6:19", "variable_type": 0, - "uses": ["6:8", "7:3"] + "uses": ["6:8-6:9", "7:3-7:4"] }] } */ diff --git a/tests/usage/func_usage_template_func.cc b/tests/usage/func_usage_template_func.cc index 9e700d3f..6931ceff 100644 --- a/tests/usage/func_usage_template_func.cc +++ b/tests/usage/func_usage_template_func.cc @@ -14,17 +14,18 @@ OUTPUT: "usr": "c:@FT@>1#Taccept#t0.0#v#", "short_name": "accept", "qualified_name": "accept", - "declarations": ["2:6"], - "callers": ["1@5:3", "1@6:3"], - "uses": ["2:6", "5:3", "6:3"] + "declarations": ["2:6-2:12"], + "callers": ["1@5:3-5:9", "1@6:3-6:9"], + "uses": ["2:6-2:12", "5:3-5:9", "6:3-6:9"] }, { "id": 1, "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "definition": "4:6", - "callees": ["0@5:3", "0@6:3"], - "uses": ["4:6"] + "definition_spelling": "4:6-4:9", + "definition_extent": "4:1-7:2", + "callees": ["0@5:3-5:9", "0@6:3-6:9"], + "uses": ["4:6-4:9"] }] } */ diff --git a/tests/usage/type_usage_as_template_parameter.cc b/tests/usage/type_usage_as_template_parameter.cc index e42633f5..029e8ce2 100644 --- a/tests/usage/type_usage_as_template_parameter.cc +++ b/tests/usage/type_usage_as_template_parameter.cc @@ -17,47 +17,53 @@ OUTPUT: "id": 0, "usr": "c:@ST>1#T@unique_ptr", "instantiations": [0, 1, 2], - "uses": ["2:7", "*6:8", "*7:8", "*9:1", "*10:3"] + "uses": ["2:7-2:17", "*6:8-6:18", "*7:8-7:18", "*9:1-9:11", "*10:3-10:13"] }, { "id": 1, "usr": "c:@S@S", "short_name": "S", "qualified_name": "S", - "definition": "4:8", - "uses": ["*4:8", "*7:19", "*9:12", "*10:14"] + "definition_spelling": "4:8-4:9", + "definition_extent": "4:1-4:12", + "uses": ["*4:8-4:9", "*7:19-7:20", "*9:12-9:13", "*10:14-10:15"] }], "funcs": [{ "id": 0, "usr": "c:@F@return_type#", "short_name": "return_type", "qualified_name": "return_type", - "definition": "9:16", - "uses": ["9:16"] + "definition_spelling": "9:16-9:27", + "definition_extent": "9:1-12:2", + "uses": ["9:16-9:27"] }], "vars": [{ "id": 0, "usr": "c:type_usage_as_template_parameter.cc@f0", "short_name": "f0", "qualified_name": "f0", - "definition": "6:25", + "definition_spelling": "6:25-6:27", + "definition_extent": "6:1-6:27", "variable_type": 0, - "uses": ["6:25"] + "uses": ["6:25-6:27"] }, { "id": 1, "usr": "c:type_usage_as_template_parameter.cc@f1", "short_name": "f1", "qualified_name": "f1", - "definition": "7:22", + "definition_spelling": "7:22-7:24", + "definition_extent": "7:1-7:24", "variable_type": 0, - "uses": ["7:22"] + "uses": ["7:22-7:24"] }, { "id": 2, "usr": "c:type_usage_as_template_parameter.cc@150@F@return_type#@local", "short_name": "local", "qualified_name": "local", - "definition": "10:18", + "definition_spelling": "10:18-10:23", + "definition_extent": "10:3-10:23", "variable_type": 0, - "uses": ["10:18"] + "uses": ["10:18-10:23"] }] } + */ diff --git a/tests/usage/type_usage_as_template_parameter_complex.cc b/tests/usage/type_usage_as_template_parameter_complex.cc index a095c8cc..df76520e 100644 --- a/tests/usage/type_usage_as_template_parameter_complex.cc +++ b/tests/usage/type_usage_as_template_parameter_complex.cc @@ -85,71 +85,77 @@ OUTPUT: "id": 0, "usr": "c:@ST>2#T#T@unique_ptr", "instantiations": [0, 1], - "uses": ["2:7", "*15:8", "*15:19", "*33:1", "*33:12", "*33:52", "*54:3", "*54:14", "*65:3", "*79:1"] + "uses": ["2:7-2:17", "*15:8-15:18", "*15:19-15:29", "*33:1-33:11", "*33:12-33:22", "*33:52-33:62", "*54:3-54:13", "*54:14-54:24", "*65:3-65:13", "*79:1-79:11"] }, { "id": 1, "usr": "c:@S@S1", - "uses": ["4:8", "*15:30", "*33:23", "*33:63", "*54:25", "*65:14", "*79:12"] + "uses": ["4:8-4:10", "*15:30-15:32", "*33:23-33:25", "*33:63-33:65", "*54:25-54:27", "*65:14-65:16", "*79:12-79:14"] }, { "id": 2, "usr": "c:@S@S2", - "uses": ["5:8", "*15:34", "*15:39", "*33:27", "*33:32", "*33:67", "*54:29", "*54:34", "*65:18", "*79:16"] + "uses": ["5:8-5:10", "*15:34-15:36", "*15:39-15:41", "*33:27-33:29", "*33:32-33:34", "*33:67-33:69", "*54:29-54:31", "*54:34-54:36", "*65:18-65:20", "*79:16-79:18"] }, { "id": 3, "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "64:7", + "definition_spelling": "64:7-64:10", + "definition_extent": "64:1-66:2", "funcs": [3], - "uses": ["*64:7", "79:21"] + "uses": ["*64:7-64:10", "79:21-79:24"] }], "funcs": [{ "id": 0, "usr": "c:@F@as_return_type#*$@S@unique_ptr>#$@S@S1#$@S@S2#", "short_name": "as_return_type", "qualified_name": "as_return_type", - "definition": "33:37", - "uses": ["33:37"] + "definition_spelling": "33:37-33:51", + "definition_extent": "33:1-33:92", + "uses": ["33:37-33:51"] }, { "id": 1, "usr": "c:@F@no_return_type#I#", "short_name": "no_return_type", "qualified_name": "no_return_type", - "definition": "40:6", - "uses": ["40:6"] + "definition_spelling": "40:6-40:20", + "definition_extent": "40:1-40:28", + "uses": ["40:6-40:20"] }, { "id": 2, "usr": "c:@F@empty#", "short_name": "empty", "qualified_name": "empty", - "definition": "53:6", - "uses": ["53:6"] + "definition_spelling": "53:6-53:11", + "definition_extent": "53:1-55:2", + "uses": ["53:6-53:11"] }, { "id": 3, "usr": "c:@S@Foo@F@foo#", "short_name": "foo", "qualified_name": "Foo::foo", - "declarations": ["65:23"], - "definition": "79:26", + "declarations": ["65:23-65:26"], + "definition_spelling": "79:26-79:29", + "definition_extent": "79:1-79:51", "declaring_type": 3, - "uses": ["65:23", "79:26"] + "uses": ["65:23-65:26", "79:26-79:29"] }], "vars": [{ "id": 0, "usr": "c:@f", "short_name": "f", "qualified_name": "f", - "declaration": "15:43", + "declaration": "15:43-15:44", "variable_type": 0, - "uses": ["15:43"] + "uses": ["15:43-15:44"] }, { "id": 1, "usr": "c:type_usage_as_template_parameter_complex.cc@1062@F@empty#@local", "short_name": "local", "qualified_name": "local", - "definition": "54:39", + "definition_spelling": "54:39-54:44", + "definition_extent": "54:3-54:44", "variable_type": 0, - "uses": ["54:39"] + "uses": ["54:39-54:44"] }] } */ diff --git a/tests/usage/type_usage_as_template_parameter_simple.cc b/tests/usage/type_usage_as_template_parameter_simple.cc index 497a60d0..95501ea0 100644 --- a/tests/usage/type_usage_as_template_parameter_simple.cc +++ b/tests/usage/type_usage_as_template_parameter_simple.cc @@ -13,22 +13,24 @@ OUTPUT: "usr": "c:@ST>1#T@unique_ptr", "short_name": "unique_ptr", "qualified_name": "unique_ptr", - "definition": "2:7", + "definition_spelling": "2:7-2:17", + "definition_extent": "2:1-2:20", "instantiations": [0], - "uses": ["*2:7", "*6:8"] + "uses": ["*2:7-2:17", "*6:8-6:18"] }, { "id": 1, "usr": "c:@S@S", - "uses": ["4:8", "*6:19"] + "uses": ["4:8-4:9", "*6:19-6:20"] }], "vars": [{ "id": 0, "usr": "c:type_usage_as_template_parameter_simple.cc@foo", "short_name": "foo", "qualified_name": "foo", - "definition": "6:22", + "definition_spelling": "6:22-6:25", + "definition_extent": "6:1-6:25", "variable_type": 0, - "uses": ["6:22"] + "uses": ["6:22-6:25"] }] } */ diff --git a/tests/usage/type_usage_declare_extern.cc b/tests/usage/type_usage_declare_extern.cc index 7ff6630c..563c3b1f 100644 --- a/tests/usage/type_usage_declare_extern.cc +++ b/tests/usage/type_usage_declare_extern.cc @@ -9,18 +9,19 @@ OUTPUT: "usr": "c:@S@T", "short_name": "T", "qualified_name": "T", - "definition": "1:8", + "definition_spelling": "1:8-1:9", + "definition_extent": "1:1-1:12", "instantiations": [0], - "uses": ["*1:8", "*3:8"] + "uses": ["*1:8-1:9", "*3:8-3:9"] }], "vars": [{ "id": 0, "usr": "c:@t", "short_name": "t", "qualified_name": "t", - "declaration": "3:10", + "declaration": "3:10-3:11", "variable_type": 0, - "uses": ["3:10"] + "uses": ["3:10-3:11"] }] } */ diff --git a/tests/usage/type_usage_declare_field.cc b/tests/usage/type_usage_declare_field.cc index 4e67444a..51ae239a 100644 --- a/tests/usage/type_usage_declare_field.cc +++ b/tests/usage/type_usage_declare_field.cc @@ -13,42 +13,46 @@ OUTPUT: "id": 0, "usr": "c:@S@ForwardType", "instantiations": [0], - "uses": ["1:8", "*5:3"] + "uses": ["1:8-1:19", "*5:3-5:14"] }, { "id": 1, "usr": "c:@S@ImplementedType", "short_name": "ImplementedType", "qualified_name": "ImplementedType", - "definition": "2:8", + "definition_spelling": "2:8-2:23", + "definition_extent": "2:1-2:26", "instantiations": [1], - "uses": ["*2:8", "*6:3"] + "uses": ["*2:8-2:23", "*6:3-6:18"] }, { "id": 2, "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "4:8", + "definition_spelling": "4:8-4:11", + "definition_extent": "4:1-7:2", "vars": [0, 1], - "uses": ["*4:8"] + "uses": ["*4:8-4:11"] }], "vars": [{ "id": 0, "usr": "c:@S@Foo@FI@a", "short_name": "a", "qualified_name": "Foo::a", - "definition": "5:16", + "definition_spelling": "5:16-5:17", + "definition_extent": "5:3-5:17", "variable_type": 0, "declaring_type": 2, - "uses": ["5:16"] + "uses": ["5:16-5:17"] }, { "id": 1, "usr": "c:@S@Foo@FI@b", "short_name": "b", "qualified_name": "Foo::b", - "definition": "6:19", + "definition_spelling": "6:19-6:20", + "definition_extent": "6:3-6:20", "variable_type": 1, "declaring_type": 2, - "uses": ["6:19"] + "uses": ["6:19-6:20"] }] } */ diff --git a/tests/usage/type_usage_declare_local.cc b/tests/usage/type_usage_declare_local.cc index 64061288..9b5dee8f 100644 --- a/tests/usage/type_usage_declare_local.cc +++ b/tests/usage/type_usage_declare_local.cc @@ -13,40 +13,44 @@ OUTPUT: "id": 0, "usr": "c:@S@ForwardType", "instantiations": [0], - "uses": ["1:8", "*5:3"] + "uses": ["1:8-1:19", "*5:3-5:14"] }, { "id": 1, "usr": "c:@S@ImplementedType", "short_name": "ImplementedType", "qualified_name": "ImplementedType", - "definition": "2:8", + "definition_spelling": "2:8-2:23", + "definition_extent": "2:1-2:26", "instantiations": [1], - "uses": ["*2:8", "*6:3"] + "uses": ["*2:8-2:23", "*6:3-6:18"] }], "funcs": [{ "id": 0, "usr": "c:@F@Foo#", "short_name": "Foo", "qualified_name": "Foo", - "definition": "4:6", - "uses": ["4:6"] + "definition_spelling": "4:6-4:9", + "definition_extent": "4:1-7:2", + "uses": ["4:6-4:9"] }], "vars": [{ "id": 0, "usr": "c:type_usage_declare_local.cc@67@F@Foo#@a", "short_name": "a", "qualified_name": "a", - "definition": "5:16", + "definition_spelling": "5:16-5:17", + "definition_extent": "5:3-5:17", "variable_type": 0, - "uses": ["5:16"] + "uses": ["5:16-5:17"] }, { "id": 1, "usr": "c:type_usage_declare_local.cc@86@F@Foo#@b", "short_name": "b", "qualified_name": "b", - "definition": "6:19", + "definition_spelling": "6:19-6:20", + "definition_extent": "6:3-6:20", "variable_type": 1, - "uses": ["6:19"] + "uses": ["6:19-6:20"] }] } */ diff --git a/tests/usage/type_usage_declare_param.cc b/tests/usage/type_usage_declare_param.cc index 9cb24566..65abe2c9 100644 --- a/tests/usage/type_usage_declare_param.cc +++ b/tests/usage/type_usage_declare_param.cc @@ -10,40 +10,44 @@ OUTPUT: "id": 0, "usr": "c:@S@ForwardType", "instantiations": [0], - "uses": ["1:8", "*4:10"] + "uses": ["1:8-1:19", "*4:10-4:21"] }, { "id": 1, "usr": "c:@S@ImplementedType", "short_name": "ImplementedType", "qualified_name": "ImplementedType", - "definition": "2:8", + "definition_spelling": "2:8-2:23", + "definition_extent": "2:1-2:26", "instantiations": [1], - "uses": ["*2:8", "*4:26"] + "uses": ["*2:8-2:23", "*4:26-4:41"] }], "funcs": [{ "id": 0, "usr": "c:@F@foo#*$@S@ForwardType#$@S@ImplementedType#", "short_name": "foo", "qualified_name": "foo", - "definition": "4:6", - "uses": ["4:6"] + "definition_spelling": "4:6-4:9", + "definition_extent": "4:1-4:47", + "uses": ["4:6-4:9"] }], "vars": [{ "id": 0, "usr": "c:type_usage_declare_param.cc@60@F@foo#*$@S@ForwardType#$@S@ImplementedType#@f", "short_name": "f", "qualified_name": "f", - "definition": "4:23", + "definition_spelling": "4:23-4:24", + "definition_extent": "4:10-4:24", "variable_type": 0, - "uses": ["4:23"] + "uses": ["4:23-4:24"] }, { "id": 1, "usr": "c:type_usage_declare_param.cc@76@F@foo#*$@S@ForwardType#$@S@ImplementedType#@a", "short_name": "a", "qualified_name": "a", - "definition": "4:42", + "definition_spelling": "4:42-4:43", + "definition_extent": "4:26-4:43", "variable_type": 1, - "uses": ["4:42"] + "uses": ["4:42-4:43"] }] } */ diff --git a/tests/usage/type_usage_declare_param_prototype.cc b/tests/usage/type_usage_declare_param_prototype.cc index 1eb86218..c574a838 100644 --- a/tests/usage/type_usage_declare_param_prototype.cc +++ b/tests/usage/type_usage_declare_param_prototype.cc @@ -15,25 +15,27 @@ OUTPUT: "id": 0, "usr": "c:@S@Foo", "instantiations": [0], - "uses": ["1:8", "3:10", "3:18", "*4:10", "*4:18"] + "uses": ["1:8-1:11", "3:10-3:13", "3:18-3:21", "*4:10-4:13", "*4:18-4:21"] }], "funcs": [{ "id": 0, "usr": "c:@F@foo#*$@S@Foo#S0_#", "short_name": "foo", "qualified_name": "foo", - "declarations": ["3:6"], - "definition": "4:6", - "uses": ["3:6", "4:6"] + "declarations": ["3:6-3:9"], + "definition_spelling": "4:6-4:9", + "definition_extent": "4:1-4:26", + "uses": ["3:6-3:9", "4:6-4:9"] }], "vars": [{ "id": 0, "usr": "c:type_usage_declare_param_prototype.cc@49@F@foo#*$@S@Foo#S0_#@f", "short_name": "f", "qualified_name": "f", - "definition": "4:15", + "definition_spelling": "4:15-4:16", + "definition_extent": "4:10-4:16", "variable_type": 0, - "uses": ["4:15"] + "uses": ["4:15-4:16"] }] } */ diff --git a/tests/usage/type_usage_declare_param_unnamed.cc b/tests/usage/type_usage_declare_param_unnamed.cc index 84d80df7..33cd93bd 100644 --- a/tests/usage/type_usage_declare_param_unnamed.cc +++ b/tests/usage/type_usage_declare_param_unnamed.cc @@ -6,15 +6,16 @@ OUTPUT: "types": [{ "id": 0, "usr": "c:@S@ForwardType", - "uses": ["1:8", "*2:10"] + "uses": ["1:8-1:19", "*2:10-2:21"] }], "funcs": [{ "id": 0, "usr": "c:@F@foo#*$@S@ForwardType#", "short_name": "foo", "qualified_name": "foo", - "definition": "2:6", - "uses": ["2:6"] + "definition_spelling": "2:6-2:9", + "definition_extent": "2:1-2:26", + "uses": ["2:6-2:9"] }] } */ diff --git a/tests/usage/type_usage_declare_qualifiers.cc b/tests/usage/type_usage_declare_qualifiers.cc index 40a019a7..dac391ef 100644 --- a/tests/usage/type_usage_declare_qualifiers.cc +++ b/tests/usage/type_usage_declare_qualifiers.cc @@ -14,67 +14,74 @@ OUTPUT: "usr": "c:@S@Type", "short_name": "Type", "qualified_name": "Type", - "definition": "1:8", + "definition_spelling": "1:8-1:12", + "definition_extent": "1:1-1:15", "instantiations": [0, 1, 2, 3, 4, 5], - "uses": ["*1:8", "*3:10", "*3:26", "*4:3", "*5:3", "*6:9", "*7:9"] + "uses": ["*1:8-1:12", "*3:10-3:14", "*3:26-3:30", "*4:3-4:7", "*5:3-5:7", "*6:9-6:13", "*7:9-7:13"] }], "funcs": [{ "id": 0, "usr": "c:@F@foo#&$@S@Type#&1S1_#", "short_name": "foo", "qualified_name": "foo", - "definition": "3:6", - "uses": ["3:6"] + "definition_spelling": "3:6-3:9", + "definition_extent": "3:1-8:2", + "uses": ["3:6-3:9"] }], "vars": [{ "id": 0, "usr": "c:type_usage_declare_qualifiers.cc@28@F@foo#&$@S@Type#&1S1_#@a0", "short_name": "a0", "qualified_name": "a0", - "definition": "3:16", + "definition_spelling": "3:16-3:18", + "definition_extent": "3:10-3:18", "variable_type": 0, - "uses": ["3:16"] + "uses": ["3:16-3:18"] }, { "id": 1, "usr": "c:type_usage_declare_qualifiers.cc@38@F@foo#&$@S@Type#&1S1_#@a1", "short_name": "a1", "qualified_name": "a1", - "definition": "3:32", + "definition_spelling": "3:32-3:34", + "definition_extent": "3:20-3:34", "variable_type": 0, - "uses": ["3:32"] + "uses": ["3:32-3:34"] }, { "id": 2, "usr": "c:type_usage_declare_qualifiers.cc@59@F@foo#&$@S@Type#&1S1_#@a2", "short_name": "a2", "qualified_name": "a2", - "definition": "4:8", + "definition_spelling": "4:8-4:10", + "definition_extent": "4:3-4:10", "variable_type": 0, - "uses": ["4:8"] + "uses": ["4:8-4:10"] }, { "id": 3, "usr": "c:type_usage_declare_qualifiers.cc@71@F@foo#&$@S@Type#&1S1_#@a3", "short_name": "a3", "qualified_name": "a3", - "definition": "5:9", + "definition_spelling": "5:9-5:11", + "definition_extent": "5:3-5:11", "variable_type": 0, - "uses": ["5:9"] + "uses": ["5:9-5:11"] }, { "id": 4, "usr": "c:type_usage_declare_qualifiers.cc@84@F@foo#&$@S@Type#&1S1_#@a4", "short_name": "a4", "qualified_name": "a4", - "definition": "6:15", + "definition_spelling": "6:15-6:17", + "definition_extent": "6:3-6:17", "variable_type": 0, - "uses": ["6:15"] + "uses": ["6:15-6:17"] }, { "id": 5, "usr": "c:type_usage_declare_qualifiers.cc@103@F@foo#&$@S@Type#&1S1_#@a5", "short_name": "a5", "qualified_name": "a5", - "definition": "7:21", + "definition_spelling": "7:21-7:23", + "definition_extent": "7:3-7:23", "variable_type": 0, - "uses": ["7:21"] + "uses": ["7:21-7:23"] }] } - */ diff --git a/tests/usage/type_usage_declare_static.cc b/tests/usage/type_usage_declare_static.cc index 484c824e..7d765f6a 100644 --- a/tests/usage/type_usage_declare_static.cc +++ b/tests/usage/type_usage_declare_static.cc @@ -7,16 +7,17 @@ OUTPUT: "id": 0, "usr": "c:@S@Type", "instantiations": [0], - "uses": ["1:8", "*2:8"] + "uses": ["1:8-1:12", "*2:8-2:12"] }], "vars": [{ "id": 0, "usr": "c:type_usage_declare_static.cc@t", "short_name": "t", "qualified_name": "t", - "definition": "2:13", + "definition_spelling": "2:13-2:14", + "definition_extent": "2:1-2:14", "variable_type": 0, - "uses": ["2:13"] + "uses": ["2:13-2:14"] }] } */ diff --git a/tests/usage/type_usage_on_return_type.cc b/tests/usage/type_usage_on_return_type.cc index f826f9b7..4ae6c14d 100644 --- a/tests/usage/type_usage_on_return_type.cc +++ b/tests/usage/type_usage_on_return_type.cc @@ -23,57 +23,62 @@ OUTPUT: "types": [{ "id": 0, "usr": "c:@S@Type", - "uses": ["1:8", "*3:1", "*4:1", "*5:1", "*8:3", "*12:1", "*15:14", "*17:8", "*18:8"] + "uses": ["1:8-1:12", "*3:1-3:5", "*4:1-4:5", "*5:1-5:5", "*8:3-8:7", "*12:1-12:5", "*15:14-15:18", "*17:8-17:12", "*18:8-18:12"] }, { "id": 1, "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "7:7", + "definition_spelling": "7:7-7:10", + "definition_extent": "7:1-10:2", "funcs": [1, 2], - "uses": ["*7:7", "12:7", "13:6"] + "uses": ["*7:7-7:10", "12:7-12:10", "13:6-13:9"] }], "funcs": [{ "id": 0, "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "declarations": ["3:7", "4:7"], - "definition": "5:7", - "uses": ["3:7", "4:7", "5:7"] + "declarations": ["3:7-3:10", "4:7-4:10"], + "definition_spelling": "5:7-5:10", + "definition_extent": "5:1-5:15", + "uses": ["3:7-3:10", "4:7-4:10", "5:7-5:10"] }, { "id": 1, "usr": "c:@S@Foo@F@Get#I#", "short_name": "Get", "qualified_name": "Foo::Get", - "declarations": ["8:9"], - "definition": "12:12", + "declarations": ["8:9-8:12"], + "definition_spelling": "12:12-12:15", + "definition_extent": "12:1-12:23", "declaring_type": 1, - "uses": ["8:9", "12:12"] + "uses": ["8:9-8:12", "12:12-12:15"] }, { "id": 2, "usr": "c:@S@Foo@F@Empty#", "short_name": "Empty", "qualified_name": "Foo::Empty", - "declarations": ["9:8"], - "definition": "13:11", + "declarations": ["9:8-9:13"], + "definition_spelling": "13:11-13:16", + "definition_extent": "13:1-13:21", "declaring_type": 1, - "uses": ["9:8", "13:11"] + "uses": ["9:8-9:13", "13:11-13:16"] }, { "id": 3, "usr": "c:@F@external#", "short_name": "external", "qualified_name": "external", - "declarations": ["15:20"], - "uses": ["15:20"] + "declarations": ["15:20-15:28"], + "uses": ["15:20-15:28"] }, { "id": 4, "usr": "c:type_usage_on_return_type.cc@F@bar#", "short_name": "bar", "qualified_name": "bar", - "declarations": ["17:14"], - "definition": "18:14", - "uses": ["17:14", "18:14"] + "declarations": ["17:14-17:17"], + "definition_spelling": "18:14-18:17", + "definition_extent": "18:1-18:22", + "uses": ["17:14-17:17", "18:14-18:17"] }] } */ diff --git a/tests/usage/type_usage_typedef_and_using.cc b/tests/usage/type_usage_typedef_and_using.cc index 7195ce00..5258383c 100644 --- a/tests/usage/type_usage_typedef_and_using.cc +++ b/tests/usage/type_usage_typedef_and_using.cc @@ -10,73 +10,80 @@ void accept2(Foo2*) {} void accept3(Foo3*) {} /* - OUTPUT: { "types": [{ "id": 0, "usr": "c:@S@Foo", - "uses": ["1:8", "*2:14", "*3:9", "*7:13"] + "uses": ["1:8-1:11", "*2:14-2:17", "*3:9-3:12", "*7:13-7:16"] }, { "id": 1, "usr": "c:@Foo1", "short_name": "Foo1", "qualified_name": "Foo1", - "definition": "2:7", + "definition_spelling": "2:7-2:11", + "definition_extent": "2:1-2:18", "alias_of": 0, - "uses": ["*2:7", "*4:14", "*8:14"] + "uses": ["*2:7-2:11", "*4:14-4:18", "*8:14-8:18"] }, { "id": 2, "usr": "c:type_usage_typedef_and_using.cc@T@Foo2", "short_name": "Foo2", "qualified_name": "Foo2", - "definition": "3:13", + "definition_spelling": "3:13-3:17", + "definition_extent": "3:1-3:17", "alias_of": 0, - "uses": ["*3:13", "*9:14"] + "uses": ["*3:13-3:17", "*9:14-9:18"] }, { "id": 3, "usr": "c:@Foo3", "short_name": "Foo3", "qualified_name": "Foo3", - "definition": "4:7", + "definition_spelling": "4:7-4:11", + "definition_extent": "4:1-4:18", "alias_of": 1, - "uses": ["*4:7", "*10:14"] + "uses": ["*4:7-4:11", "*10:14-10:18"] }, { "id": 4, "usr": "c:@Foo4", "short_name": "Foo4", "qualified_name": "Foo4", - "definition": "5:7", - "uses": ["*5:7"] + "definition_spelling": "5:7-5:11", + "definition_extent": "5:1-5:17", + "uses": ["*5:7-5:11"] }], "funcs": [{ "id": 0, "usr": "c:@F@accept#*$@S@Foo#", "short_name": "accept", "qualified_name": "accept", - "definition": "7:6", - "uses": ["7:6"] + "definition_spelling": "7:6-7:12", + "definition_extent": "7:1-7:21", + "uses": ["7:6-7:12"] }, { "id": 1, "usr": "c:@F@accept1#**$@S@Foo#", "short_name": "accept1", "qualified_name": "accept1", - "definition": "8:6", - "uses": ["8:6"] + "definition_spelling": "8:6-8:13", + "definition_extent": "8:1-8:23", + "uses": ["8:6-8:13"] }, { "id": 2, "usr": "c:@F@accept2#*$@S@Foo#", "short_name": "accept2", "qualified_name": "accept2", - "definition": "9:6", - "uses": ["9:6"] + "definition_spelling": "9:6-9:13", + "definition_extent": "9:1-9:23", + "uses": ["9:6-9:13"] }, { "id": 3, "usr": "c:@F@accept3#**$@S@Foo#", "short_name": "accept3", "qualified_name": "accept3", - "definition": "10:6", - "uses": ["10:6"] + "definition_spelling": "10:6-10:13", + "definition_extent": "10:1-10:23", + "uses": ["10:6-10:13"] }] } */ diff --git a/tests/usage/type_usage_typedef_and_using_template.cc b/tests/usage/type_usage_typedef_and_using_template.cc index 9d2637a7..4de139e3 100644 --- a/tests/usage/type_usage_typedef_and_using_template.cc +++ b/tests/usage/type_usage_typedef_and_using_template.cc @@ -10,23 +10,25 @@ OUTPUT: "types": [{ "id": 0, "usr": "c:@ST>1#T@Foo", - "uses": ["2:8", "*4:14", "*5:9"] + "uses": ["2:8-2:11", "*4:14-4:17", "*5:9-5:12"] }, { "id": 1, "usr": "c:@Foo1", "short_name": "Foo1", "qualified_name": "Foo1", - "definition": "4:7", + "definition_spelling": "4:7-4:11", + "definition_extent": "4:1-4:22", "alias_of": 0, - "uses": ["*4:7", "*5:13"] + "uses": ["*4:7-4:11", "*5:13-5:17"] }, { "id": 2, "usr": "c:type_usage_typedef_and_using_template.cc@T@Foo2", "short_name": "Foo2", "qualified_name": "Foo2", - "definition": "5:19", + "definition_spelling": "5:19-5:23", + "definition_extent": "5:1-5:23", "alias_of": 0, - "uses": ["*5:19"] + "uses": ["*5:19-5:23"] }] } */ diff --git a/tests/usage/type_usage_various.cc b/tests/usage/type_usage_various.cc index 529f98b8..b471addd 100644 --- a/tests/usage/type_usage_various.cc +++ b/tests/usage/type_usage_various.cc @@ -17,37 +17,40 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:7", + "definition_spelling": "1:7-1:10", + "definition_extent": "1:1-3:2", "funcs": [0], "instantiations": [0, 1], - "uses": ["*1:7", "*2:3", "*5:1", "5:6", "*6:3", "*10:8"] + "uses": ["*1:7-1:10", "*2:3-2:6", "*5:1-5:4", "5:6-5:9", "*6:3-6:6", "*10:8-10:11"] }], "funcs": [{ "id": 0, "usr": "c:@S@Foo@F@make#", "short_name": "make", "qualified_name": "Foo::make", - "declarations": ["2:8"], - "definition": "5:11", + "declarations": ["2:8-2:12"], + "definition_spelling": "5:11-5:15", + "definition_extent": "5:1-8:2", "declaring_type": 0, - "uses": ["2:8", "5:11"] + "uses": ["2:8-2:12", "5:11-5:15"] }], "vars": [{ "id": 0, "usr": "c:type_usage_various.cc@57@S@Foo@F@make#@f", "short_name": "f", "qualified_name": "f", - "definition": "6:7", + "definition_spelling": "6:7-6:8", + "definition_extent": "6:3-6:8", "variable_type": 0, - "uses": ["6:7"] + "uses": ["6:7-6:8"] }, { "id": 1, "usr": "c:@foo", "short_name": "foo", "qualified_name": "foo", - "declaration": "10:12", + "declaration": "10:12-10:15", "variable_type": 0, - "uses": ["10:12"] + "uses": ["10:12-10:15"] }] } */ diff --git a/tests/usage/usage_inside_of_call.cc b/tests/usage/usage_inside_of_call.cc index 503ee2b6..05fbb418 100644 --- a/tests/usage/usage_inside_of_call.cc +++ b/tests/usage/usage_inside_of_call.cc @@ -22,59 +22,64 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "5:8", + "definition_spelling": "5:8-5:11", + "definition_extent": "5:1-8:2", "vars": [1, 0], - "uses": ["*5:8", "10:5", "14:22", "14:40"] + "uses": ["*5:8-5:11", "10:5-10:8", "14:22-14:25", "14:40-14:43"] }], "funcs": [{ "id": 0, "usr": "c:@F@called#I#", "short_name": "called", "qualified_name": "called", - "declarations": ["1:6"], - "callers": ["2@14:3"], - "uses": ["1:6", "14:3"] + "declarations": ["1:6-1:12"], + "callers": ["2@14:3-14:9"], + "uses": ["1:6-1:12", "14:3-14:9"] }, { "id": 1, "usr": "c:@F@gen#", "short_name": "gen", "qualified_name": "gen", - "declarations": ["3:5"], - "callers": ["2@14:14"], - "uses": ["3:5", "14:14"] + "declarations": ["3:5-3:8"], + "callers": ["2@14:14-14:17"], + "uses": ["3:5-3:8", "14:14-14:17"] }, { "id": 2, "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "definition": "12:6", - "callees": ["0@14:3", "1@14:14"], - "uses": ["12:6"] + "definition_spelling": "12:6-12:9", + "definition_extent": "12:1-15:2", + "callees": ["0@14:3-14:9", "1@14:14-14:17"], + "uses": ["12:6-12:9"] }], "vars": [{ "id": 0, "usr": "c:@S@Foo@static_var", "short_name": "static_var", "qualified_name": "Foo::static_var", - "declaration": "6:14", - "definition": "10:10", + "declaration": "6:14-6:24", + "definition_spelling": "10:10-10:20", + "definition_extent": "10:1-10:24", "declaring_type": 0, - "uses": ["6:14", "10:10", "14:45"] + "uses": ["6:14-6:24", "10:10-10:20", "14:45-14:55"] }, { "id": 1, "usr": "c:@S@Foo@FI@field_var", "short_name": "field_var", "qualified_name": "Foo::field_var", - "definition": "7:7", + "definition_spelling": "7:7-7:16", + "definition_extent": "7:3-7:16", "declaring_type": 0, - "uses": ["7:7", "14:28"] + "uses": ["7:7-7:16", "14:28-14:37"] }, { "id": 2, "usr": "c:usage_inside_of_call.cc@145@F@foo#@a", "short_name": "a", "qualified_name": "a", - "definition": "13:7", - "uses": ["13:7", "14:10"] + "definition_spelling": "13:7-13:8", + "definition_extent": "13:3-13:12", + "uses": ["13:7-13:8", "14:10-14:11"] }] } */ diff --git a/tests/usage/usage_inside_of_call_simple.cc b/tests/usage/usage_inside_of_call_simple.cc index ddceaef3..ec07e272 100644 --- a/tests/usage/usage_inside_of_call_simple.cc +++ b/tests/usage/usage_inside_of_call_simple.cc @@ -14,25 +14,27 @@ OUTPUT: "usr": "c:@F@called#I#", "short_name": "called", "qualified_name": "called", - "declarations": ["1:6"], - "callers": ["2@6:3"], - "uses": ["1:6", "6:3"] + "declarations": ["1:6-1:12"], + "callers": ["2@6:3-6:9"], + "uses": ["1:6-1:12", "6:3-6:9"] }, { "id": 1, "usr": "c:@F@gen#", "short_name": "gen", "qualified_name": "gen", - "definition": "3:5", - "callers": ["2@6:10", "2@6:18"], - "uses": ["3:5", "6:10", "6:18"] + "definition_spelling": "3:5-3:8", + "definition_extent": "3:1-3:24", + "callers": ["2@6:10-6:13", "2@6:18-6:21"], + "uses": ["3:5-3:8", "6:10-6:13", "6:18-6:21"] }, { "id": 2, "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "definition": "5:6", - "callees": ["0@6:3", "1@6:10", "1@6:18"], - "uses": ["5:6"] + "definition_spelling": "5:6-5:9", + "definition_extent": "5:1-7:2", + "callees": ["0@6:3-6:9", "1@6:10-6:13", "1@6:18-6:21"], + "uses": ["5:6-5:9"] }] } */ diff --git a/tests/usage/var_usage_call_function.cc b/tests/usage/var_usage_call_function.cc index 93070118..89679f8d 100644 --- a/tests/usage/var_usage_call_function.cc +++ b/tests/usage/var_usage_call_function.cc @@ -15,25 +15,28 @@ OUTPUT: "usr": "c:@F@called#", "short_name": "called", "qualified_name": "called", - "definition": "1:6", - "callers": ["1@4:13", "1@7:3"], - "uses": ["1:6", "4:13", "7:3"] + "definition_spelling": "1:6-1:12", + "definition_extent": "1:1-1:17", + "callers": ["1@4:13-4:19", "1@7:3-7:9"], + "uses": ["1:6-1:12", "4:13-4:19", "7:3-7:9"] }, { "id": 1, "usr": "c:@F@caller#", "short_name": "caller", "qualified_name": "caller", - "definition": "3:6", - "callees": ["0@4:13", "0@7:3"], - "uses": ["3:6"] + "definition_spelling": "3:6-3:12", + "definition_extent": "3:1-8:2", + "callees": ["0@4:13-4:19", "0@7:3-7:9"], + "uses": ["3:6-3:12"] }], "vars": [{ "id": 0, "usr": "c:var_usage_call_function.cc@39@F@caller#@x", "short_name": "x", "qualified_name": "x", - "definition": "4:8", - "uses": ["4:8", "5:3"] + "definition_spelling": "4:8-4:9", + "definition_extent": "4:3-4:19", + "uses": ["4:8-4:9", "5:3-5:4"] }] } */ diff --git a/tests/usage/var_usage_class_member.cc b/tests/usage/var_usage_class_member.cc index 30962efa..0bf642f0 100644 --- a/tests/usage/var_usage_class_member.cc +++ b/tests/usage/var_usage_class_member.cc @@ -25,60 +25,65 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:7", + "definition_spelling": "1:7-1:10", + "definition_extent": "1:1-5:2", "vars": [0, 1], "instantiations": [2], - "uses": ["*1:7", "*11:3"] + "uses": ["*1:7-1:10", "*11:3-11:6"] }], "funcs": [{ "id": 0, "usr": "c:@F@accept#I#", "short_name": "accept", "qualified_name": "accept", - "declarations": ["7:6"], - "callers": ["2@14:3", "2@15:3", "2@17:3"], - "uses": ["7:6", "14:3", "15:3", "17:3"] + "declarations": ["7:6-7:12"], + "callers": ["2@14:3-14:9", "2@15:3-15:9", "2@17:3-17:9"], + "uses": ["7:6-7:12", "14:3-14:9", "15:3-15:9", "17:3-17:9"] }, { "id": 1, "usr": "c:@F@accept#*I#", "short_name": "accept", "qualified_name": "accept", - "declarations": ["8:6"], - "callers": ["2@16:3"], - "uses": ["8:6", "16:3"] + "declarations": ["8:6-8:12"], + "callers": ["2@16:3-16:9"], + "uses": ["8:6-8:12", "16:3-16:9"] }, { "id": 2, "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "definition": "10:6", - "callees": ["0@14:3", "0@15:3", "1@16:3", "0@17:3"], - "uses": ["10:6"] + "definition_spelling": "10:6-10:9", + "definition_extent": "10:1-18:2", + "callees": ["0@14:3-14:9", "0@15:3-15:9", "1@16:3-16:9", "0@17:3-17:9"], + "uses": ["10:6-10:9"] }], "vars": [{ "id": 0, "usr": "c:@S@Foo@FI@x", "short_name": "x", "qualified_name": "Foo::x", - "definition": "3:7", + "definition_spelling": "3:7-3:8", + "definition_extent": "3:3-3:8", "declaring_type": 0, - "uses": ["3:7", "12:5", "13:5", "14:12", "15:12", "16:13"] + "uses": ["3:7-3:8", "12:5-12:6", "13:5-13:6", "14:12-14:13", "15:12-15:13", "16:13-16:14"] }, { "id": 1, "usr": "c:@S@Foo@FI@y", "short_name": "y", "qualified_name": "Foo::y", - "definition": "4:7", + "definition_spelling": "4:7-4:8", + "definition_extent": "4:3-4:8", "declaring_type": 0, - "uses": ["4:7", "17:12"] + "uses": ["4:7-4:8", "17:12-17:13"] }, { "id": 2, "usr": "c:var_usage_class_member.cc@105@F@foo#@f", "short_name": "f", "qualified_name": "f", - "definition": "11:7", + "definition_spelling": "11:7-11:8", + "definition_extent": "11:3-11:8", "variable_type": 0, - "uses": ["11:7", "12:3", "13:3", "14:10", "15:10", "16:11", "17:10"] + "uses": ["11:7-11:8", "12:3-12:4", "13:3-13:4", "14:10-14:11", "15:10-15:11", "16:11-16:12", "17:10-17:11"] }] } */ diff --git a/tests/usage/var_usage_class_member_static.cc b/tests/usage/var_usage_class_member_static.cc index 410714ba..b89a672a 100644 --- a/tests/usage/var_usage_class_member_static.cc +++ b/tests/usage/var_usage_class_member_static.cc @@ -16,33 +16,35 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:8", - "uses": ["*1:8", "8:10"] + "definition_spelling": "1:8-1:11", + "definition_extent": "1:1-3:2", + "uses": ["*1:8-1:11", "8:10-8:13"] }], "funcs": [{ "id": 0, "usr": "c:@F@accept#I#", "short_name": "accept", "qualified_name": "accept", - "declarations": ["5:6"], - "callers": ["1@8:3"], - "uses": ["5:6", "8:3"] + "declarations": ["5:6-5:12"], + "callers": ["1@8:3-8:9"], + "uses": ["5:6-5:12", "8:3-8:9"] }, { "id": 1, "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "definition": "7:6", - "callees": ["0@8:3"], - "uses": ["7:6"] + "definition_spelling": "7:6-7:9", + "definition_extent": "7:1-9:2", + "callees": ["0@8:3-8:9"], + "uses": ["7:6-7:9"] }], "vars": [{ "id": 0, "usr": "c:@S@Foo@x", "short_name": "x", "qualified_name": "Foo::x", - "declaration": "2:14", - "uses": ["2:14", "8:15"] + "declaration": "2:14-2:15", + "uses": ["2:14-2:15", "8:15-8:16"] }] } */ diff --git a/tests/usage/var_usage_cstyle_cast.cc b/tests/usage/var_usage_cstyle_cast.cc index a1690287..a040f305 100644 --- a/tests/usage/var_usage_cstyle_cast.cc +++ b/tests/usage/var_usage_cstyle_cast.cc @@ -15,28 +15,31 @@ OUTPUT: "usr": "c:@E@VarType", "short_name": "VarType", "qualified_name": "VarType", - "definition": "1:6", + "definition_spelling": "1:6-1:13", + "definition_extent": "1:1-1:16", "instantiations": [0], - "uses": ["*1:6", "*4:20", "*4:42", "*7:7"] + "uses": ["*1:6-1:13", "*4:20-4:27", "*4:42-4:49", "*7:7-7:14"] }, { "id": 1, "usr": "c:@S@Holder", "short_name": "Holder", "qualified_name": "Holder", - "definition": "3:8", + "definition_spelling": "3:8-3:14", + "definition_extent": "3:1-5:2", "vars": [0], - "uses": ["*3:8", "7:15"] + "uses": ["*3:8-3:14", "7:15-7:21"] }], "vars": [{ "id": 0, "usr": "c:@S@Holder@static_var", "short_name": "static_var", "qualified_name": "Holder::static_var", - "declaration": "4:28", - "definition": "7:23", + "declaration": "4:28-4:38", + "definition_spelling": "7:23-7:33", + "definition_extent": "7:1-7:33", "variable_type": 0, "declaring_type": 1, - "uses": ["4:28", "7:23"] + "uses": ["4:28-4:38", "7:23-7:33"] }] } */ diff --git a/tests/usage/var_usage_extern.cc b/tests/usage/var_usage_extern.cc index 05973ad1..7b4241e9 100644 --- a/tests/usage/var_usage_extern.cc +++ b/tests/usage/var_usage_extern.cc @@ -11,16 +11,17 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "definition": "3:6", - "uses": ["3:6"] + "definition_spelling": "3:6-3:9", + "definition_extent": "3:1-5:2", + "uses": ["3:6-3:9"] }], "vars": [{ "id": 0, "usr": "c:@a", "short_name": "a", "qualified_name": "a", - "declaration": "1:12", - "uses": ["1:12", "4:3"] + "declaration": "1:12-1:13", + "uses": ["1:12-1:13", "4:3-4:4"] }] } */ diff --git a/tests/usage/var_usage_func_parameter.cc b/tests/usage/var_usage_func_parameter.cc index ae1fa915..fa2ea760 100644 --- a/tests/usage/var_usage_func_parameter.cc +++ b/tests/usage/var_usage_func_parameter.cc @@ -9,16 +9,18 @@ OUTPUT: "usr": "c:@F@foo#I#", "short_name": "foo", "qualified_name": "foo", - "definition": "1:6", - "uses": ["1:6"] + "definition_spelling": "1:6-1:9", + "definition_extent": "1:1-3:2", + "uses": ["1:6-1:9"] }], "vars": [{ "id": 0, "usr": "c:var_usage_func_parameter.cc@9@F@foo#I#@a", "short_name": "a", "qualified_name": "a", - "definition": "1:14", - "uses": ["1:14", "2:3"] + "definition_spelling": "1:14-1:15", + "definition_extent": "1:10-1:15", + "uses": ["1:14-1:15", "2:3-2:4"] }] } */ diff --git a/tests/usage/var_usage_local.cc b/tests/usage/var_usage_local.cc index 7393ecd9..5b6f970e 100644 --- a/tests/usage/var_usage_local.cc +++ b/tests/usage/var_usage_local.cc @@ -10,16 +10,18 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "definition": "1:6", - "uses": ["1:6"] + "definition_spelling": "1:6-1:9", + "definition_extent": "1:1-4:2", + "uses": ["1:6-1:9"] }], "vars": [{ "id": 0, "usr": "c:var_usage_local.cc@16@F@foo#@x", "short_name": "x", "qualified_name": "x", - "definition": "2:7", - "uses": ["2:7", "3:3"] + "definition_spelling": "2:7-2:8", + "definition_extent": "2:3-2:8", + "uses": ["2:7-2:8", "3:3-3:4"] }] } */ diff --git a/tests/usage/var_usage_shadowed_local.cc b/tests/usage/var_usage_shadowed_local.cc index 793c35a0..8d3c5396 100644 --- a/tests/usage/var_usage_shadowed_local.cc +++ b/tests/usage/var_usage_shadowed_local.cc @@ -15,23 +15,26 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "definition": "1:6", - "uses": ["1:6"] + "definition_spelling": "1:6-1:9", + "definition_extent": "1:1-9:2", + "uses": ["1:6-1:9"] }], "vars": [{ "id": 0, "usr": "c:var_usage_shadowed_local.cc@16@F@foo#@a", "short_name": "a", "qualified_name": "a", - "definition": "2:7", - "uses": ["2:7", "3:3", "8:3"] + "definition_spelling": "2:7-2:8", + "definition_extent": "2:3-2:8", + "uses": ["2:7-2:8", "3:3-3:4", "8:3-8:4"] }, { "id": 1, "usr": "c:var_usage_shadowed_local.cc@43@F@foo#@a", "short_name": "a", "qualified_name": "a", - "definition": "5:9", - "uses": ["5:9", "6:5"] + "definition_spelling": "5:9-5:10", + "definition_extent": "5:5-5:10", + "uses": ["5:9-5:10", "6:5-6:6"] }] } */ diff --git a/tests/usage/var_usage_shadowed_parameter.cc b/tests/usage/var_usage_shadowed_parameter.cc index 64e9db26..eec504bb 100644 --- a/tests/usage/var_usage_shadowed_parameter.cc +++ b/tests/usage/var_usage_shadowed_parameter.cc @@ -15,23 +15,26 @@ OUTPUT: "usr": "c:@F@foo#I#", "short_name": "foo", "qualified_name": "foo", - "definition": "1:6", - "uses": ["1:6"] + "definition_spelling": "1:6-1:9", + "definition_extent": "1:1-8:2", + "uses": ["1:6-1:9"] }], "vars": [{ "id": 0, "usr": "c:var_usage_shadowed_parameter.cc@9@F@foo#I#@a", "short_name": "a", "qualified_name": "a", - "definition": "1:14", - "uses": ["1:14", "2:3", "7:3"] + "definition_spelling": "1:14-1:15", + "definition_extent": "1:10-1:15", + "uses": ["1:14-1:15", "2:3-2:4", "7:3-7:4"] }, { "id": 1, "usr": "c:var_usage_shadowed_parameter.cc@38@F@foo#I#@a", "short_name": "a", "qualified_name": "a", - "definition": "4:9", - "uses": ["4:9", "5:5"] + "definition_spelling": "4:9-4:10", + "definition_extent": "4:5-4:10", + "uses": ["4:9-4:10", "5:5-5:6"] }] } */ diff --git a/tests/usage/var_usage_static.cc b/tests/usage/var_usage_static.cc index 42cd3bac..0664ebfc 100644 --- a/tests/usage/var_usage_static.cc +++ b/tests/usage/var_usage_static.cc @@ -12,16 +12,18 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "definition": "3:6", - "uses": ["3:6"] + "definition_spelling": "3:6-3:9", + "definition_extent": "3:1-5:2", + "uses": ["3:6-3:9"] }], "vars": [{ "id": 0, "usr": "c:var_usage_static.cc@a", "short_name": "a", "qualified_name": "a", - "definition": "1:12", - "uses": ["1:12", "4:3"] + "definition_spelling": "1:12-1:13", + "definition_extent": "1:1-1:13", + "uses": ["1:12-1:13", "4:3-4:4"] }] } */ diff --git a/tests/vars/class_member.cc b/tests/vars/class_member.cc index 1985e65d..73cfa9af 100644 --- a/tests/vars/class_member.cc +++ b/tests/vars/class_member.cc @@ -9,20 +9,22 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:7", + "definition_spelling": "1:7-1:10", + "definition_extent": "1:1-3:2", "vars": [0], "instantiations": [0], - "uses": ["*1:7", "*2:3"] + "uses": ["*1:7-1:10", "*2:3-2:6"] }], "vars": [{ "id": 0, "usr": "c:@S@Foo@FI@member", "short_name": "member", "qualified_name": "Foo::member", - "definition": "2:8", + "definition_spelling": "2:8-2:14", + "definition_extent": "2:3-2:14", "variable_type": 0, "declaring_type": 0, - "uses": ["2:8"] + "uses": ["2:8-2:14"] }] } */ diff --git a/tests/vars/class_static_member.cc b/tests/vars/class_static_member.cc index 79a801ae..84720b1d 100644 --- a/tests/vars/class_static_member.cc +++ b/tests/vars/class_static_member.cc @@ -11,21 +11,23 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:7", + "definition_spelling": "1:7-1:10", + "definition_extent": "1:1-3:2", "vars": [0], "instantiations": [0], - "uses": ["*1:7", "*2:10", "*4:1", "4:6"] + "uses": ["*1:7-1:10", "*2:10-2:13", "*4:1-4:4", "4:6-4:9"] }], "vars": [{ "id": 0, "usr": "c:@S@Foo@member", "short_name": "member", "qualified_name": "Foo::member", - "declaration": "2:15", - "definition": "4:11", + "declaration": "2:15-2:21", + "definition_spelling": "4:11-4:17", + "definition_extent": "4:1-4:27", "variable_type": 0, "declaring_type": 0, - "uses": ["2:15", "4:11"] + "uses": ["2:15-2:21", "4:11-4:17"] }] } */ diff --git a/tests/vars/class_static_member_decl_only.cc b/tests/vars/class_static_member_decl_only.cc index ac68a846..fcbc8862 100644 --- a/tests/vars/class_static_member_decl_only.cc +++ b/tests/vars/class_static_member_decl_only.cc @@ -9,16 +9,17 @@ OUTPUT: "usr": "c:@S@Foo", "short_name": "Foo", "qualified_name": "Foo", - "definition": "1:7", - "uses": ["*1:7"] + "definition_spelling": "1:7-1:10", + "definition_extent": "1:1-3:2", + "uses": ["*1:7-1:10"] }], "vars": [{ "id": 0, "usr": "c:@S@Foo@member", "short_name": "member", "qualified_name": "Foo::member", - "declaration": "2:14", - "uses": ["2:14"] + "declaration": "2:14-2:20", + "uses": ["2:14-2:20"] }] } */ diff --git a/tests/vars/function_local.cc b/tests/vars/function_local.cc index 65ab9ef0..7848e1fd 100644 --- a/tests/vars/function_local.cc +++ b/tests/vars/function_local.cc @@ -11,24 +11,26 @@ OUTPUT: "id": 0, "usr": "c:@S@Foo", "instantiations": [0], - "uses": ["1:8", "*4:3"] + "uses": ["1:8-1:11", "*4:3-4:6"] }], "funcs": [{ "id": 0, "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "definition": "3:6", - "uses": ["3:6"] + "definition_spelling": "3:6-3:9", + "definition_extent": "3:1-5:2", + "uses": ["3:6-3:9"] }], "vars": [{ "id": 0, "usr": "c:function_local.cc@31@F@foo#@a", "short_name": "a", "qualified_name": "a", - "definition": "4:8", + "definition_spelling": "4:8-4:9", + "definition_extent": "4:3-4:9", "variable_type": 0, - "uses": ["4:8"] + "uses": ["4:8-4:9"] }] } */ diff --git a/tests/vars/function_param.cc b/tests/vars/function_param.cc index 1d97de89..b68b8787 100644 --- a/tests/vars/function_param.cc +++ b/tests/vars/function_param.cc @@ -9,32 +9,35 @@ OUTPUT: "id": 0, "usr": "c:@S@Foo", "instantiations": [0, 1], - "uses": ["1:8", "*3:10", "*3:19"] + "uses": ["1:8-1:11", "*3:10-3:13", "*3:19-3:22"] }], "funcs": [{ "id": 0, "usr": "c:@F@foo#*$@S@Foo#S0_#", "short_name": "foo", "qualified_name": "foo", - "definition": "3:6", - "uses": ["3:6"] + "definition_spelling": "3:6-3:9", + "definition_extent": "3:1-3:30", + "uses": ["3:6-3:9"] }], "vars": [{ "id": 0, "usr": "c:function_param.cc@24@F@foo#*$@S@Foo#S0_#@p0", "short_name": "p0", "qualified_name": "p0", - "definition": "3:15", + "definition_spelling": "3:15-3:17", + "definition_extent": "3:10-3:17", "variable_type": 0, - "uses": ["3:15"] + "uses": ["3:15-3:17"] }, { "id": 1, "usr": "c:function_param.cc@33@F@foo#*$@S@Foo#S0_#@p1", "short_name": "p1", "qualified_name": "p1", - "definition": "3:24", + "definition_spelling": "3:24-3:26", + "definition_extent": "3:19-3:26", "variable_type": 0, - "uses": ["3:24"] + "uses": ["3:24-3:26"] }] } */ diff --git a/tests/vars/function_param_unnamed.cc b/tests/vars/function_param_unnamed.cc index 98ce0462..48257cc5 100644 --- a/tests/vars/function_param_unnamed.cc +++ b/tests/vars/function_param_unnamed.cc @@ -7,8 +7,9 @@ OUTPUT: "usr": "c:@F@foo#I#I#", "short_name": "foo", "qualified_name": "foo", - "definition": "1:6", - "uses": ["1:6"] + "definition_spelling": "1:6-1:9", + "definition_extent": "1:1-1:22", + "uses": ["1:6-1:9"] }] } */ diff --git a/tests/vars/function_shadow_local.cc b/tests/vars/function_shadow_local.cc index c237bd45..a4485aee 100644 --- a/tests/vars/function_shadow_local.cc +++ b/tests/vars/function_shadow_local.cc @@ -15,23 +15,26 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", - "definition": "1:6", - "uses": ["1:6"] + "definition_spelling": "1:6-1:9", + "definition_extent": "1:1-9:2", + "uses": ["1:6-1:9"] }], "vars": [{ "id": 0, "usr": "c:function_shadow_local.cc@16@F@foo#@a", "short_name": "a", "qualified_name": "a", - "definition": "2:7", - "uses": ["2:7", "3:3", "8:3"] + "definition_spelling": "2:7-2:8", + "definition_extent": "2:3-2:8", + "uses": ["2:7-2:8", "3:3-3:4", "8:3-8:4"] }, { "id": 1, "usr": "c:function_shadow_local.cc@43@F@foo#@a", "short_name": "a", "qualified_name": "a", - "definition": "5:9", - "uses": ["5:9", "6:5"] + "definition_spelling": "5:9-5:10", + "definition_extent": "5:5-5:10", + "uses": ["5:9-5:10", "6:5-6:6"] }] } */ diff --git a/tests/vars/function_shadow_param.cc b/tests/vars/function_shadow_param.cc index 2ef1bb3d..acaf2664 100644 --- a/tests/vars/function_shadow_param.cc +++ b/tests/vars/function_shadow_param.cc @@ -9,23 +9,26 @@ OUTPUT: "usr": "c:@F@foo#I#", "short_name": "foo", "qualified_name": "foo", - "definition": "1:6", - "uses": ["1:6"] + "definition_spelling": "1:6-1:9", + "definition_extent": "1:1-3:2", + "uses": ["1:6-1:9"] }], "vars": [{ "id": 0, "usr": "c:function_shadow_param.cc@9@F@foo#I#@p", "short_name": "p", "qualified_name": "p", - "definition": "1:14", - "uses": ["1:14"] + "definition_spelling": "1:14-1:15", + "definition_extent": "1:10-1:15", + "uses": ["1:14-1:15"] }, { "id": 1, "usr": "c:function_shadow_param.cc@21@F@foo#I#@p", "short_name": "p", "qualified_name": "p", - "definition": "2:7", - "uses": ["2:7"] + "definition_spelling": "2:7-2:8", + "definition_extent": "2:3-2:8", + "uses": ["2:7-2:8"] }] } */ diff --git a/tests/vars/global_variable.cc b/tests/vars/global_variable.cc index ef3507ae..c445b61d 100644 --- a/tests/vars/global_variable.cc +++ b/tests/vars/global_variable.cc @@ -7,8 +7,9 @@ OUTPUT: "usr": "c:global_variable.cc@global", "short_name": "global", "qualified_name": "global", - "definition": "1:12", - "uses": ["1:12"] + "definition_spelling": "1:12-1:18", + "definition_extent": "1:1-1:22", + "uses": ["1:12-1:18"] }] } */ diff --git a/tests/vars/global_variable_decl_only.cc b/tests/vars/global_variable_decl_only.cc index 53a6459a..a48d6af1 100644 --- a/tests/vars/global_variable_decl_only.cc +++ b/tests/vars/global_variable_decl_only.cc @@ -7,8 +7,8 @@ OUTPUT: "usr": "c:@global", "short_name": "global", "qualified_name": "global", - "declaration": "1:12", - "uses": ["1:12"] + "declaration": "1:12-1:18", + "uses": ["1:12-1:18"] }] } */