From 0dabbb30932ea04a718d719ae3b66822a84d9647 Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Sun, 19 Feb 2017 23:51:31 -0800 Subject: [PATCH] index declaration vs definition --- main.cpp | 26 ++++++++-- tests/constructors/constructor.cc | 4 +- tests/constructors/destructor.cc | 2 +- tests/declaration_vs_definition/class.cc | 22 +++++++++ .../declaration_vs_definition/class_member.cc | 28 +++++++++++ .../class_member_static.cc | 31 ++++++++++++ tests/declaration_vs_definition/func.cc | 23 +++++++++ tests/declaration_vs_definition/method.cc | 48 +++++++++++++++++++ tests/foobar.cc | 1 + tests/function_declaration.cc | 1 + tests/function_declaration_definition.cc | 1 + tests/inheritance/function_override.cc | 1 + tests/method_declaration.cc | 1 + tests/method_definition.cc | 1 + tests/namespaces/anonymous_function.cc | 1 + tests/namespaces/function_declaration.cc | 1 + tests/namespaces/method_declaration.cc | 1 + tests/namespaces/method_definition.cc | 3 +- tests/usage/func_usage_addr_func.cc | 2 +- tests/usage/func_usage_addr_method.cc | 3 +- tests/usage/func_usage_call_method.cc | 3 +- .../usage/func_usage_class_inline_var_def.cc | 2 +- tests/usage/func_usage_forward_decl_func.cc | 1 + tests/usage/func_usage_forward_decl_method.cc | 3 +- tests/usage/type_usage_declare_field.cc | 4 +- tests/usage/type_usage_declare_local.cc | 4 +- tests/usage/type_usage_declare_param.cc | 4 +- .../type_usage_declare_param_prototype.cc | 3 +- tests/usage/type_usage_declare_qualifiers.cc | 12 ++--- tests/usage/type_usage_declare_static.cc | 2 +- tests/usage/type_usage_on_return_type.cc | 5 ++ tests/usage/type_usage_various.cc | 3 +- tests/usage/usage_inside_of_call.cc | 9 ++-- tests/usage/usage_inside_of_call_simple.cc | 1 + tests/usage/var_usage_call_function.cc | 2 +- tests/usage/var_usage_class_member.cc | 8 ++-- tests/usage/var_usage_class_member_static.cc | 1 + tests/usage/var_usage_func_parameter.cc | 2 +- tests/usage/var_usage_local.cc | 2 +- tests/usage/var_usage_shadowed_local.cc | 4 +- tests/usage/var_usage_shadowed_parameter.cc | 4 +- tests/usage/var_usage_static.cc | 2 +- tests/vars/class_member.cc | 2 +- tests/vars/class_static_member.cc | 3 +- tests/vars/function_local.cc | 2 +- tests/vars/function_param.cc | 4 +- tests/vars/function_shadow_local.cc | 4 +- tests/vars/function_shadow_param.cc | 4 +- tests/vars/global_variable.cc | 2 +- 49 files changed, 252 insertions(+), 51 deletions(-) create mode 100644 tests/declaration_vs_definition/class.cc create mode 100644 tests/declaration_vs_definition/class_member.cc create mode 100644 tests/declaration_vs_definition/class_member_static.cc create mode 100644 tests/declaration_vs_definition/func.cc create mode 100644 tests/declaration_vs_definition/method.cc diff --git a/main.cpp b/main.cpp index aa940a34..dc3f2d7a 100644 --- a/main.cpp +++ b/main.cpp @@ -70,7 +70,16 @@ struct TypeDef { std::string usr; std::string short_name; std::string qualified_name; - std::optional declaration; // Forward decl. TODO: remove + + // While a class/type can technically have a separate declaration/definition, + // it doesn't really happen in practice. The declaration never contains + // comments or insightful information. The user always wants to jump from + // the declaration to the definition - never the other way around like in + // functions and (less often) variables. + // + // It's also difficult to identify a `class Foo;` statement with the clang + // indexer API (it's doable using cursor AST traversal), so we don't bother + // supporting the feature. std::optional definition; // If set, then this is the same underlying type as the given value (ie, this @@ -141,6 +150,9 @@ struct VarDef { std::string short_name; std::string qualified_name; std::optional declaration; + // TODO: definitions should be a list of locations, since there can be more + // than one. + std::optional definition; // Type of the variable. std::optional variable_type; @@ -360,7 +372,6 @@ std::string ParsingDatabase::ToString() { WRITE(usr); WRITE(short_name); WRITE(qualified_name); - WRITE(declaration); WRITE(definition); WRITE(alias_of); WRITE(parents); @@ -406,6 +417,7 @@ std::string ParsingDatabase::ToString() { WRITE(short_name); WRITE(qualified_name); WRITE(declaration); + WRITE(definition); WRITE(variable_type); WRITE(declaring_type); //WRITE(initializations); @@ -1303,7 +1315,11 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) { var_def->qualified_name = ns->QualifiedName(decl->semanticContainer, var_def->short_name); //} - var_def->declaration = decl->loc; + if (decl->isDefinition) + var_def->definition = decl->loc; + else + var_def->declaration = decl->loc; + var_def->all_uses.push_back(decl->loc); // Declaring variable type information. @@ -1351,6 +1367,8 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) { if (decl->isDefinition) func_def->definition = decl->loc; + else + func_def->declaration = decl->loc; func_def->all_uses.push_back(decl->loc); @@ -1464,6 +1482,7 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) { type_def->qualified_name = ns->QualifiedName(decl->semanticContainer, type_def->short_name); // } + assert(decl->isDefinition); type_def->definition = decl->loc; type_def->all_uses.push_back(decl->loc); @@ -1796,6 +1815,7 @@ int main(int argc, char** argv) { for (std::string path : GetFilesInFolder("tests")) { // TODO: Fix all existing tests. + //if (path != "tests/declaration_vs_definition/method.cc") continue; //if (path == "tests/usage/type_usage_declare_extern.cc") continue; //if (path != "tests/constructors/destructor.cc") continue; //if (path != "tests/usage/usage_inside_of_call.cc") continue; diff --git a/tests/constructors/constructor.cc b/tests/constructors/constructor.cc index b5d9a49e..59c23baf 100644 --- a/tests/constructors/constructor.cc +++ b/tests/constructors/constructor.cc @@ -45,7 +45,7 @@ OUTPUT: "usr": "c:constructor.cc@56@F@foo#@f", "short_name": "f", "qualified_name": "f", - "declaration": "tests/constructors/constructor.cc:7:7", + "definition": "tests/constructors/constructor.cc:7:7", "variable_type": 0, "all_uses": ["tests/constructors/constructor.cc:7:7"] }, { @@ -53,7 +53,7 @@ OUTPUT: "usr": "c:constructor.cc@66@F@foo#@f2", "short_name": "f2", "qualified_name": "f2", - "declaration": "tests/constructors/constructor.cc:8:8", + "definition": "tests/constructors/constructor.cc:8:8", "variable_type": 0, "all_uses": ["tests/constructors/constructor.cc:8:8"] }] diff --git a/tests/constructors/destructor.cc b/tests/constructors/destructor.cc index 0d245c48..958f5f08 100644 --- a/tests/constructors/destructor.cc +++ b/tests/constructors/destructor.cc @@ -57,7 +57,7 @@ OUTPUT: "usr": "c:destructor.cc@70@F@foo#@f", "short_name": "f", "qualified_name": "f", - "declaration": "tests/constructors/destructor.cc:8:7", + "definition": "tests/constructors/destructor.cc:8:7", "variable_type": 0, "all_uses": ["tests/constructors/destructor.cc:8:7"] }] diff --git a/tests/declaration_vs_definition/class.cc b/tests/declaration_vs_definition/class.cc new file mode 100644 index 00000000..d6f58949 --- /dev/null +++ b/tests/declaration_vs_definition/class.cc @@ -0,0 +1,22 @@ +class Foo; +class Foo; +class Foo {}; +class Foo; + +/* +// NOTE: Separate decl/definition are not supported for classes. See source +// for comments. +OUTPUT: +{ + "types": [{ + "id": 0, + "usr": "c:@S@Foo", + "short_name": "Foo", + "qualified_name": "Foo", + "definition": "tests/declaration_vs_definition/class.cc:3:7", + "all_uses": ["tests/declaration_vs_definition/class.cc:1:7", "tests/declaration_vs_definition/class.cc:2:7", "tests/declaration_vs_definition/class.cc:3:7", "tests/declaration_vs_definition/class.cc:4:7"] + }], + "functions": [], + "variables": [] +} +*/ \ No newline at end of file diff --git a/tests/declaration_vs_definition/class_member.cc b/tests/declaration_vs_definition/class_member.cc new file mode 100644 index 00000000..d7c0712f --- /dev/null +++ b/tests/declaration_vs_definition/class_member.cc @@ -0,0 +1,28 @@ +class Foo { + int foo; +}; + +/* +OUTPUT: +{ + "types": [{ + "id": 0, + "usr": "c:@S@Foo", + "short_name": "Foo", + "qualified_name": "Foo", + "definition": "tests/declaration_vs_definition/class_member.cc:1:7", + "vars": [0], + "all_uses": ["tests/declaration_vs_definition/class_member.cc:1:7"] + }], + "functions": [], + "variables": [{ + "id": 0, + "usr": "c:@S@Foo@FI@foo", + "short_name": "foo", + "qualified_name": "Foo::foo", + "definition": "tests/declaration_vs_definition/class_member.cc:2:7", + "declaring_type": 0, + "all_uses": ["tests/declaration_vs_definition/class_member.cc:2:7"] + }] +} +*/ \ No newline at end of file diff --git a/tests/declaration_vs_definition/class_member_static.cc b/tests/declaration_vs_definition/class_member_static.cc new file mode 100644 index 00000000..36224a0d --- /dev/null +++ b/tests/declaration_vs_definition/class_member_static.cc @@ -0,0 +1,31 @@ +class Foo { + static int foo; +}; + +int Foo::foo; + +/* +OUTPUT: +{ + "types": [{ + "id": 0, + "usr": "c:@S@Foo", + "short_name": "Foo", + "qualified_name": "Foo", + "definition": "tests/declaration_vs_definition/class_member_static.cc:1:7", + "vars": [0], + "all_uses": ["tests/declaration_vs_definition/class_member_static.cc:1:7", "tests/declaration_vs_definition/class_member_static.cc:5:5"] + }], + "functions": [], + "variables": [{ + "id": 0, + "usr": "c:@S@Foo@foo", + "short_name": "foo", + "qualified_name": "Foo::foo", + "declaration": "tests/declaration_vs_definition/class_member_static.cc:2:14", + "definition": "tests/declaration_vs_definition/class_member_static.cc:5:10", + "declaring_type": 0, + "all_uses": ["tests/declaration_vs_definition/class_member_static.cc:2:14", "tests/declaration_vs_definition/class_member_static.cc:5:10"] + }] +} +*/ \ No newline at end of file diff --git a/tests/declaration_vs_definition/func.cc b/tests/declaration_vs_definition/func.cc new file mode 100644 index 00000000..a7d905e0 --- /dev/null +++ b/tests/declaration_vs_definition/func.cc @@ -0,0 +1,23 @@ +void foo(); +void foo(); +void foo() {} +void foo(); + +/* +// Note: we always use the latest seen ("most local") definition/declaration. +OUTPUT: +{ + "types": [], + "functions": [{ + "id": 0, + "usr": "c:@F@foo#", + "short_name": "foo", + "qualified_name": "foo", + "declaration": "tests/declaration_vs_definition/func.cc:4:6", + "definition": "tests/declaration_vs_definition/func.cc:3:6", + "all_uses": ["tests/declaration_vs_definition/func.cc:1:6", "tests/declaration_vs_definition/func.cc:2:6", "tests/declaration_vs_definition/func.cc:3:6", "tests/declaration_vs_definition/func.cc:4:6"] + }], + "variables": [] +} + +*/ \ No newline at end of file diff --git a/tests/declaration_vs_definition/method.cc b/tests/declaration_vs_definition/method.cc new file mode 100644 index 00000000..701f7b2f --- /dev/null +++ b/tests/declaration_vs_definition/method.cc @@ -0,0 +1,48 @@ +class Foo { + void declonly(); + virtual void purevirtual() = 0; + void def(); +}; + +void Foo::def() {} + +/* +OUTPUT: +{ + "types": [{ + "id": 0, + "usr": "c:@S@Foo", + "short_name": "Foo", + "qualified_name": "Foo", + "definition": "tests/declaration_vs_definition/method.cc:1:7", + "funcs": [1, 2], + "all_uses": ["tests/declaration_vs_definition/method.cc:1:7", "tests/declaration_vs_definition/method.cc:7:6"] + }], + "functions": [{ + "id": 0, + "usr": "c:@S@Foo@F@declonly#", + "short_name": "declonly", + "qualified_name": "Foo::declonly", + "declaration": "tests/declaration_vs_definition/method.cc:2:8", + "all_uses": ["tests/declaration_vs_definition/method.cc:2:8"] + }, { + "id": 1, + "usr": "c:@S@Foo@F@purevirtual#", + "short_name": "purevirtual", + "qualified_name": "Foo::purevirtual", + "declaration": "tests/declaration_vs_definition/method.cc:3:16", + "declaring_type": 0, + "all_uses": ["tests/declaration_vs_definition/method.cc:3:16"] + }, { + "id": 2, + "usr": "c:@S@Foo@F@def#", + "short_name": "def", + "qualified_name": "Foo::def", + "declaration": "tests/declaration_vs_definition/method.cc:4:8", + "definition": "tests/declaration_vs_definition/method.cc:7:11", + "declaring_type": 0, + "all_uses": ["tests/declaration_vs_definition/method.cc:4:8", "tests/declaration_vs_definition/method.cc:7:11"] + }], + "variables": [] +} +*/ \ No newline at end of file diff --git a/tests/foobar.cc b/tests/foobar.cc index 2bcb7922..f0406f20 100644 --- a/tests/foobar.cc +++ b/tests/foobar.cc @@ -15,6 +15,7 @@ OUTPUT: "usr": "c:@F@called#I#", "short_name": "called", "qualified_name": "called", + "declaration": "tests/foobar.cc:1:6", "callers": ["2@tests/foobar.cc:6:3"], "all_uses": ["tests/foobar.cc:1:6", "tests/foobar.cc:6:3"] }, { diff --git a/tests/function_declaration.cc b/tests/function_declaration.cc index c0b97ce6..2868b0ed 100644 --- a/tests/function_declaration.cc +++ b/tests/function_declaration.cc @@ -9,6 +9,7 @@ OUTPUT: "usr": "c:@F@foo#I#I#", "short_name": "foo", "qualified_name": "foo", + "declaration": "tests/function_declaration.cc:1:6", "all_uses": ["tests/function_declaration.cc:1:6"] }], "variables": [] diff --git a/tests/function_declaration_definition.cc b/tests/function_declaration_definition.cc index 79b54516..fbeb99e2 100644 --- a/tests/function_declaration_definition.cc +++ b/tests/function_declaration_definition.cc @@ -11,6 +11,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", + "declaration": "tests/function_declaration_definition.cc:1:6", "definition": "tests/function_declaration_definition.cc:3:6", "all_uses": ["tests/function_declaration_definition.cc:1:6", "tests/function_declaration_definition.cc:3:6"] }], diff --git a/tests/inheritance/function_override.cc b/tests/inheritance/function_override.cc index 0d228843..50dc94c3 100644 --- a/tests/inheritance/function_override.cc +++ b/tests/inheritance/function_override.cc @@ -31,6 +31,7 @@ OUTPUT: "usr": "c:@S@Root@F@foo#", "short_name": "foo", "qualified_name": "Root::foo", + "declaration": "tests/inheritance/function_override.cc:2:16", "derived": [1], "all_uses": ["tests/inheritance/function_override.cc:2:16"] }, { diff --git a/tests/method_declaration.cc b/tests/method_declaration.cc index b587b057..9fec0515 100644 --- a/tests/method_declaration.cc +++ b/tests/method_declaration.cc @@ -25,6 +25,7 @@ OUTPUT: "usr": "c:@S@Foo@F@foo#", "short_name": "foo", "qualified_name": "Foo::foo", + "declaration": "tests/method_declaration.cc:2:8", "all_uses": ["tests/method_declaration.cc:2:8"] }], "variables": [] diff --git a/tests/method_definition.cc b/tests/method_definition.cc index 84e54775..721e615e 100644 --- a/tests/method_definition.cc +++ b/tests/method_definition.cc @@ -21,6 +21,7 @@ OUTPUT: "usr": "c:@S@Foo@F@foo#", "short_name": "foo", "qualified_name": "Foo::foo", + "declaration": "tests/method_definition.cc:2:8", "definition": "tests/method_definition.cc:5:11", "declaring_type": 0, "all_uses": ["tests/method_definition.cc:2:8", "tests/method_definition.cc:5:11"] diff --git a/tests/namespaces/anonymous_function.cc b/tests/namespaces/anonymous_function.cc index d763d136..b631ec18 100644 --- a/tests/namespaces/anonymous_function.cc +++ b/tests/namespaces/anonymous_function.cc @@ -11,6 +11,7 @@ OUTPUT: "usr": "c:anonymous_function.cc@aN@F@foo#", "short_name": "foo", "qualified_name": "::foo", + "declaration": "tests/namespaces/anonymous_function.cc:2:6", "all_uses": ["tests/namespaces/anonymous_function.cc:2:6"] }], "variables": [] diff --git a/tests/namespaces/function_declaration.cc b/tests/namespaces/function_declaration.cc index b00bfb4e..57aeab7d 100644 --- a/tests/namespaces/function_declaration.cc +++ b/tests/namespaces/function_declaration.cc @@ -11,6 +11,7 @@ OUTPUT: "usr": "c:@N@hello@F@foo#I#I#", "short_name": "foo", "qualified_name": "hello::foo", + "declaration": "tests/namespaces/function_declaration.cc:2:6", "all_uses": ["tests/namespaces/function_declaration.cc:2:6"] }], "variables": [] diff --git a/tests/namespaces/method_declaration.cc b/tests/namespaces/method_declaration.cc index 7b6ec126..9123107e 100644 --- a/tests/namespaces/method_declaration.cc +++ b/tests/namespaces/method_declaration.cc @@ -20,6 +20,7 @@ OUTPUT: "usr": "c:@N@hello@S@Foo@F@foo#", "short_name": "foo", "qualified_name": "hello::Foo::foo", + "declaration": "tests/namespaces/method_declaration.cc:3:8", "all_uses": ["tests/namespaces/method_declaration.cc:3:8"] }], "variables": [] diff --git a/tests/namespaces/method_definition.cc b/tests/namespaces/method_definition.cc index b79cd8a0..f2dad76d 100644 --- a/tests/namespaces/method_definition.cc +++ b/tests/namespaces/method_definition.cc @@ -23,10 +23,11 @@ OUTPUT: "usr": "c:@N@hello@S@Foo@F@foo#", "short_name": "foo", "qualified_name": "hello::Foo::foo", + "declaration": "tests/namespaces/method_definition.cc:3:8", "definition": "tests/namespaces/method_definition.cc:6:11", "declaring_type": 0, "all_uses": ["tests/namespaces/method_definition.cc:3:8", "tests/namespaces/method_definition.cc:6:11"] - }], + }], "variables": [] } */ \ No newline at end of file diff --git a/tests/usage/func_usage_addr_func.cc b/tests/usage/func_usage_addr_func.cc index 369f5ba7..e50320dd 100644 --- a/tests/usage/func_usage_addr_func.cc +++ b/tests/usage/func_usage_addr_func.cc @@ -41,7 +41,7 @@ OUTPUT: "usr": "c:func_usage_addr_func.cc@61@F@user#@x", "short_name": "x", "qualified_name": "x", - "declaration": "tests/usage/func_usage_addr_func.cc:6:8", + "definition": "tests/usage/func_usage_addr_func.cc:6:8", "all_uses": ["tests/usage/func_usage_addr_func.cc:6:8"] }] } diff --git a/tests/usage/func_usage_addr_method.cc b/tests/usage/func_usage_addr_method.cc index 408a60c7..2f2a84f5 100644 --- a/tests/usage/func_usage_addr_method.cc +++ b/tests/usage/func_usage_addr_method.cc @@ -23,6 +23,7 @@ OUTPUT: "usr": "c:@S@Foo@F@Used#", "short_name": "Used", "qualified_name": "Foo::Used", + "declaration": "tests/usage/func_usage_addr_method.cc:2:8", "callers": ["1@tests/usage/func_usage_addr_method.cc:6:18"], "all_uses": ["tests/usage/func_usage_addr_method.cc:2:8", "tests/usage/func_usage_addr_method.cc:6:18"] }, { @@ -39,7 +40,7 @@ OUTPUT: "usr": "c:func_usage_addr_method.cc@53@F@user#@x", "short_name": "x", "qualified_name": "x", - "declaration": "tests/usage/func_usage_addr_method.cc:6:8", + "definition": "tests/usage/func_usage_addr_method.cc:6:8", "all_uses": ["tests/usage/func_usage_addr_method.cc:6:8"] }] } diff --git a/tests/usage/func_usage_call_method.cc b/tests/usage/func_usage_call_method.cc index 40100057..0c8206dd 100644 --- a/tests/usage/func_usage_call_method.cc +++ b/tests/usage/func_usage_call_method.cc @@ -24,6 +24,7 @@ OUTPUT: "usr": "c:@S@Foo@F@Used#", "short_name": "Used", "qualified_name": "Foo::Used", + "declaration": "tests/usage/func_usage_call_method.cc:2:8", "callers": ["1@tests/usage/func_usage_call_method.cc:7:6"], "all_uses": ["tests/usage/func_usage_call_method.cc:2:8", "tests/usage/func_usage_call_method.cc:7:6"] }, { @@ -40,7 +41,7 @@ OUTPUT: "usr": "c:func_usage_call_method.cc@53@F@user#@f", "short_name": "f", "qualified_name": "f", - "declaration": "tests/usage/func_usage_call_method.cc:6:8", + "definition": "tests/usage/func_usage_call_method.cc:6:8", "variable_type": 0, "all_uses": ["tests/usage/func_usage_call_method.cc:6:8", "tests/usage/func_usage_call_method.cc:7:3"] }] diff --git a/tests/usage/func_usage_class_inline_var_def.cc b/tests/usage/func_usage_class_inline_var_def.cc index f1ed79b8..6df99eca 100644 --- a/tests/usage/func_usage_class_inline_var_def.cc +++ b/tests/usage/func_usage_class_inline_var_def.cc @@ -31,7 +31,7 @@ OUTPUT: "usr": "c:@S@Foo@FI@x", "short_name": "x", "qualified_name": "Foo::x", - "declaration": "tests/usage/func_usage_class_inline_var_def.cc:6:7", + "definition": "tests/usage/func_usage_class_inline_var_def.cc:6:7", "declaring_type": 0, "all_uses": ["tests/usage/func_usage_class_inline_var_def.cc:6:7"] }] diff --git a/tests/usage/func_usage_forward_decl_func.cc b/tests/usage/func_usage_forward_decl_func.cc index 95380018..d163b531 100644 --- a/tests/usage/func_usage_forward_decl_func.cc +++ b/tests/usage/func_usage_forward_decl_func.cc @@ -12,6 +12,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", + "declaration": "tests/usage/func_usage_forward_decl_func.cc:1:6", "callers": ["1@tests/usage/func_usage_forward_decl_func.cc:4:3"], "all_uses": ["tests/usage/func_usage_forward_decl_func.cc:1:6", "tests/usage/func_usage_forward_decl_func.cc:4:3"] }, { diff --git a/tests/usage/func_usage_forward_decl_method.cc b/tests/usage/func_usage_forward_decl_method.cc index dd6b4a74..26d86b9f 100644 --- a/tests/usage/func_usage_forward_decl_method.cc +++ b/tests/usage/func_usage_forward_decl_method.cc @@ -23,6 +23,7 @@ OUTPUT: "usr": "c:@S@Foo@F@foo#", "short_name": "foo", "qualified_name": "Foo::foo", + "declaration": "tests/usage/func_usage_forward_decl_method.cc:2:8", "callers": ["1@tests/usage/func_usage_forward_decl_method.cc:7:6"], "all_uses": ["tests/usage/func_usage_forward_decl_method.cc:2:8", "tests/usage/func_usage_forward_decl_method.cc:7:6"] }, { @@ -39,7 +40,7 @@ OUTPUT: "usr": "c:func_usage_forward_decl_method.cc@53@F@usage#@f", "short_name": "f", "qualified_name": "f", - "declaration": "tests/usage/func_usage_forward_decl_method.cc:6:8", + "definition": "tests/usage/func_usage_forward_decl_method.cc:6:8", "variable_type": 0, "all_uses": ["tests/usage/func_usage_forward_decl_method.cc:6:8", "tests/usage/func_usage_forward_decl_method.cc:7:3"] }] diff --git a/tests/usage/type_usage_declare_field.cc b/tests/usage/type_usage_declare_field.cc index ec583bd2..7f546f1b 100644 --- a/tests/usage/type_usage_declare_field.cc +++ b/tests/usage/type_usage_declare_field.cc @@ -37,7 +37,7 @@ OUTPUT: "usr": "c:@S@Foo@FI@a", "short_name": "a", "qualified_name": "Foo::a", - "declaration": "tests/usage/type_usage_declare_field.cc:5:16", + "definition": "tests/usage/type_usage_declare_field.cc:5:16", "variable_type": 0, "declaring_type": 2, "all_uses": ["tests/usage/type_usage_declare_field.cc:5:16"] @@ -46,7 +46,7 @@ OUTPUT: "usr": "c:@S@Foo@FI@b", "short_name": "b", "qualified_name": "Foo::b", - "declaration": "tests/usage/type_usage_declare_field.cc:6:19", + "definition": "tests/usage/type_usage_declare_field.cc:6:19", "variable_type": 1, "declaring_type": 2, "all_uses": ["tests/usage/type_usage_declare_field.cc:6:19"] diff --git a/tests/usage/type_usage_declare_local.cc b/tests/usage/type_usage_declare_local.cc index 15b9f514..4e2b95b2 100644 --- a/tests/usage/type_usage_declare_local.cc +++ b/tests/usage/type_usage_declare_local.cc @@ -36,7 +36,7 @@ OUTPUT: "usr": "c:type_usage_declare_local.cc@67@F@Foo#@a", "short_name": "a", "qualified_name": "a", - "declaration": "tests/usage/type_usage_declare_local.cc:5:16", + "definition": "tests/usage/type_usage_declare_local.cc:5:16", "variable_type": 0, "all_uses": ["tests/usage/type_usage_declare_local.cc:5:16"] }, { @@ -44,7 +44,7 @@ OUTPUT: "usr": "c:type_usage_declare_local.cc@86@F@Foo#@b", "short_name": "b", "qualified_name": "b", - "declaration": "tests/usage/type_usage_declare_local.cc:6:19", + "definition": "tests/usage/type_usage_declare_local.cc:6:19", "variable_type": 1, "all_uses": ["tests/usage/type_usage_declare_local.cc:6:19"] }] diff --git a/tests/usage/type_usage_declare_param.cc b/tests/usage/type_usage_declare_param.cc index 73ac8a21..ad9fa45b 100644 --- a/tests/usage/type_usage_declare_param.cc +++ b/tests/usage/type_usage_declare_param.cc @@ -33,7 +33,7 @@ OUTPUT: "usr": "c:type_usage_declare_param.cc@60@F@foo#*$@S@ForwardType#$@S@ImplementedType#@f", "short_name": "f", "qualified_name": "f", - "declaration": "tests/usage/type_usage_declare_param.cc:4:23", + "definition": "tests/usage/type_usage_declare_param.cc:4:23", "variable_type": 0, "all_uses": ["tests/usage/type_usage_declare_param.cc:4:23"] }, { @@ -41,7 +41,7 @@ OUTPUT: "usr": "c:type_usage_declare_param.cc@76@F@foo#*$@S@ForwardType#$@S@ImplementedType#@a", "short_name": "a", "qualified_name": "a", - "declaration": "tests/usage/type_usage_declare_param.cc:4:42", + "definition": "tests/usage/type_usage_declare_param.cc:4:42", "variable_type": 1, "all_uses": ["tests/usage/type_usage_declare_param.cc:4:42"] }] diff --git a/tests/usage/type_usage_declare_param_prototype.cc b/tests/usage/type_usage_declare_param_prototype.cc index 39472edd..a3e9735b 100644 --- a/tests/usage/type_usage_declare_param_prototype.cc +++ b/tests/usage/type_usage_declare_param_prototype.cc @@ -22,6 +22,7 @@ OUTPUT: "usr": "c:@F@foo#*$@S@Foo#S0_#", "short_name": "foo", "qualified_name": "foo", + "declaration": "tests/usage/type_usage_declare_param_prototype.cc:3:6", "definition": "tests/usage/type_usage_declare_param_prototype.cc:4:6", "all_uses": ["tests/usage/type_usage_declare_param_prototype.cc:3:6", "tests/usage/type_usage_declare_param_prototype.cc:4:6"] }], @@ -30,7 +31,7 @@ OUTPUT: "usr": "c:type_usage_declare_param_prototype.cc@49@F@foo#*$@S@Foo#S0_#@f", "short_name": "f", "qualified_name": "f", - "declaration": "tests/usage/type_usage_declare_param_prototype.cc:4:15", + "definition": "tests/usage/type_usage_declare_param_prototype.cc:4:15", "variable_type": 0, "all_uses": ["tests/usage/type_usage_declare_param_prototype.cc:4:15"] }] diff --git a/tests/usage/type_usage_declare_qualifiers.cc b/tests/usage/type_usage_declare_qualifiers.cc index 504275b4..12ce8e6a 100644 --- a/tests/usage/type_usage_declare_qualifiers.cc +++ b/tests/usage/type_usage_declare_qualifiers.cc @@ -31,7 +31,7 @@ OUTPUT: "usr": "c:type_usage_declare_qualifiers.cc@28@F@foo#&$@S@Type#&1S1_#@a0", "short_name": "a0", "qualified_name": "a0", - "declaration": "tests/usage/type_usage_declare_qualifiers.cc:3:16", + "definition": "tests/usage/type_usage_declare_qualifiers.cc:3:16", "variable_type": 0, "all_uses": ["tests/usage/type_usage_declare_qualifiers.cc:3:16"] }, { @@ -39,7 +39,7 @@ OUTPUT: "usr": "c:type_usage_declare_qualifiers.cc@38@F@foo#&$@S@Type#&1S1_#@a1", "short_name": "a1", "qualified_name": "a1", - "declaration": "tests/usage/type_usage_declare_qualifiers.cc:3:32", + "definition": "tests/usage/type_usage_declare_qualifiers.cc:3:32", "variable_type": 0, "all_uses": ["tests/usage/type_usage_declare_qualifiers.cc:3:32"] }, { @@ -47,7 +47,7 @@ OUTPUT: "usr": "c:type_usage_declare_qualifiers.cc@59@F@foo#&$@S@Type#&1S1_#@a2", "short_name": "a2", "qualified_name": "a2", - "declaration": "tests/usage/type_usage_declare_qualifiers.cc:4:8", + "definition": "tests/usage/type_usage_declare_qualifiers.cc:4:8", "variable_type": 0, "all_uses": ["tests/usage/type_usage_declare_qualifiers.cc:4:8"] }, { @@ -55,7 +55,7 @@ OUTPUT: "usr": "c:type_usage_declare_qualifiers.cc@71@F@foo#&$@S@Type#&1S1_#@a3", "short_name": "a3", "qualified_name": "a3", - "declaration": "tests/usage/type_usage_declare_qualifiers.cc:5:9", + "definition": "tests/usage/type_usage_declare_qualifiers.cc:5:9", "variable_type": 0, "all_uses": ["tests/usage/type_usage_declare_qualifiers.cc:5:9"] }, { @@ -63,7 +63,7 @@ OUTPUT: "usr": "c:type_usage_declare_qualifiers.cc@84@F@foo#&$@S@Type#&1S1_#@a4", "short_name": "a4", "qualified_name": "a4", - "declaration": "tests/usage/type_usage_declare_qualifiers.cc:6:15", + "definition": "tests/usage/type_usage_declare_qualifiers.cc:6:15", "variable_type": 0, "all_uses": ["tests/usage/type_usage_declare_qualifiers.cc:6:15"] }, { @@ -71,7 +71,7 @@ OUTPUT: "usr": "c:type_usage_declare_qualifiers.cc@103@F@foo#&$@S@Type#&1S1_#@a5", "short_name": "a5", "qualified_name": "a5", - "declaration": "tests/usage/type_usage_declare_qualifiers.cc:7:21", + "definition": "tests/usage/type_usage_declare_qualifiers.cc:7:21", "variable_type": 0, "all_uses": ["tests/usage/type_usage_declare_qualifiers.cc:7:21"] }] diff --git a/tests/usage/type_usage_declare_static.cc b/tests/usage/type_usage_declare_static.cc index b7e81cd5..d5966997 100644 --- a/tests/usage/type_usage_declare_static.cc +++ b/tests/usage/type_usage_declare_static.cc @@ -15,7 +15,7 @@ OUTPUT: "usr": "c:type_usage_declare_static.cc@t", "short_name": "t", "qualified_name": "t", - "declaration": "tests/usage/type_usage_declare_static.cc:2:13", + "definition": "tests/usage/type_usage_declare_static.cc:2:13", "variable_type": 0, "all_uses": ["tests/usage/type_usage_declare_static.cc:2:13"] }] diff --git a/tests/usage/type_usage_on_return_type.cc b/tests/usage/type_usage_on_return_type.cc index 43973d9a..0f7753d4 100644 --- a/tests/usage/type_usage_on_return_type.cc +++ b/tests/usage/type_usage_on_return_type.cc @@ -39,6 +39,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "qualified_name": "foo", + "declaration": "tests/usage/type_usage_on_return_type.cc:4:7", "definition": "tests/usage/type_usage_on_return_type.cc:5:7", "all_uses": ["tests/usage/type_usage_on_return_type.cc:3:7", "tests/usage/type_usage_on_return_type.cc:4:7", "tests/usage/type_usage_on_return_type.cc:5:7"] }, { @@ -46,6 +47,7 @@ OUTPUT: "usr": "c:@S@Foo@F@Get#I#", "short_name": "Get", "qualified_name": "Foo::Get", + "declaration": "tests/usage/type_usage_on_return_type.cc:8:9", "definition": "tests/usage/type_usage_on_return_type.cc:12:12", "declaring_type": 1, "all_uses": ["tests/usage/type_usage_on_return_type.cc:8:9", "tests/usage/type_usage_on_return_type.cc:12:12"] @@ -54,6 +56,7 @@ OUTPUT: "usr": "c:@S@Foo@F@Empty#", "short_name": "Empty", "qualified_name": "Foo::Empty", + "declaration": "tests/usage/type_usage_on_return_type.cc:9:8", "definition": "tests/usage/type_usage_on_return_type.cc:13:11", "declaring_type": 1, "all_uses": ["tests/usage/type_usage_on_return_type.cc:9:8", "tests/usage/type_usage_on_return_type.cc:13:11"] @@ -62,12 +65,14 @@ OUTPUT: "usr": "c:@F@external#", "short_name": "external", "qualified_name": "external", + "declaration": "tests/usage/type_usage_on_return_type.cc:15:20", "all_uses": ["tests/usage/type_usage_on_return_type.cc:15:20"] }, { "id": 4, "usr": "c:type_usage_on_return_type.cc@F@bar#", "short_name": "bar", "qualified_name": "bar", + "declaration": "tests/usage/type_usage_on_return_type.cc:17:14", "definition": "tests/usage/type_usage_on_return_type.cc:18:14", "all_uses": ["tests/usage/type_usage_on_return_type.cc:17:14", "tests/usage/type_usage_on_return_type.cc:18:14"] }], diff --git a/tests/usage/type_usage_various.cc b/tests/usage/type_usage_various.cc index 5019dab0..3fe2f6f4 100644 --- a/tests/usage/type_usage_various.cc +++ b/tests/usage/type_usage_various.cc @@ -27,6 +27,7 @@ OUTPUT: "usr": "c:@S@Foo@F@make#", "short_name": "make", "qualified_name": "Foo::make", + "declaration": "tests/usage/type_usage_various.cc:2:8", "definition": "tests/usage/type_usage_various.cc:5:11", "declaring_type": 0, "all_uses": ["tests/usage/type_usage_various.cc:2:8", "tests/usage/type_usage_various.cc:5:11"] @@ -36,7 +37,7 @@ OUTPUT: "usr": "c:type_usage_various.cc@58@S@Foo@F@make#@f", "short_name": "f", "qualified_name": "f", - "declaration": "tests/usage/type_usage_various.cc:6:7", + "definition": "tests/usage/type_usage_various.cc:6:7", "variable_type": 0, "all_uses": ["tests/usage/type_usage_various.cc:6:7"] }, { diff --git a/tests/usage/usage_inside_of_call.cc b/tests/usage/usage_inside_of_call.cc index 28347e63..c2ba84ee 100644 --- a/tests/usage/usage_inside_of_call.cc +++ b/tests/usage/usage_inside_of_call.cc @@ -31,6 +31,7 @@ OUTPUT: "usr": "c:@F@called#I#", "short_name": "called", "qualified_name": "called", + "declaration": "tests/usage/usage_inside_of_call.cc:1:6", "callers": ["2@tests/usage/usage_inside_of_call.cc:14:3"], "all_uses": ["tests/usage/usage_inside_of_call.cc:1:6", "tests/usage/usage_inside_of_call.cc:14:3"] }, { @@ -38,6 +39,7 @@ OUTPUT: "usr": "c:@F@gen#", "short_name": "gen", "qualified_name": "gen", + "declaration": "tests/usage/usage_inside_of_call.cc:3:5", "callers": ["2@tests/usage/usage_inside_of_call.cc:14:14"], "all_uses": ["tests/usage/usage_inside_of_call.cc:3:5", "tests/usage/usage_inside_of_call.cc:14:14"] }, { @@ -54,7 +56,8 @@ OUTPUT: "usr": "c:@S@Foo@static_var", "short_name": "static_var", "qualified_name": "Foo::static_var", - "declaration": "tests/usage/usage_inside_of_call.cc:10:10", + "declaration": "tests/usage/usage_inside_of_call.cc:6:14", + "definition": "tests/usage/usage_inside_of_call.cc:10:10", "declaring_type": 0, "all_uses": ["tests/usage/usage_inside_of_call.cc:6:14", "tests/usage/usage_inside_of_call.cc:10:10", "tests/usage/usage_inside_of_call.cc:14:45"] }, { @@ -62,7 +65,7 @@ OUTPUT: "usr": "c:@S@Foo@FI@field_var", "short_name": "field_var", "qualified_name": "Foo::field_var", - "declaration": "tests/usage/usage_inside_of_call.cc:7:7", + "definition": "tests/usage/usage_inside_of_call.cc:7:7", "declaring_type": 0, "all_uses": ["tests/usage/usage_inside_of_call.cc:7:7", "tests/usage/usage_inside_of_call.cc:14:28"] }, { @@ -70,7 +73,7 @@ OUTPUT: "usr": "c:usage_inside_of_call.cc@145@F@foo#@a", "short_name": "a", "qualified_name": "a", - "declaration": "tests/usage/usage_inside_of_call.cc:13:7", + "definition": "tests/usage/usage_inside_of_call.cc:13:7", "all_uses": ["tests/usage/usage_inside_of_call.cc:13:7", "tests/usage/usage_inside_of_call.cc:14:10"] }] } diff --git a/tests/usage/usage_inside_of_call_simple.cc b/tests/usage/usage_inside_of_call_simple.cc index 7b25c97d..1c667742 100644 --- a/tests/usage/usage_inside_of_call_simple.cc +++ b/tests/usage/usage_inside_of_call_simple.cc @@ -15,6 +15,7 @@ OUTPUT: "usr": "c:@F@called#I#", "short_name": "called", "qualified_name": "called", + "declaration": "tests/usage/usage_inside_of_call_simple.cc:1:6", "callers": ["2@tests/usage/usage_inside_of_call_simple.cc:6:3"], "all_uses": ["tests/usage/usage_inside_of_call_simple.cc:1:6", "tests/usage/usage_inside_of_call_simple.cc:6:3"] }, { diff --git a/tests/usage/var_usage_call_function.cc b/tests/usage/var_usage_call_function.cc index 14005241..a5814be5 100644 --- a/tests/usage/var_usage_call_function.cc +++ b/tests/usage/var_usage_call_function.cc @@ -33,7 +33,7 @@ OUTPUT: "usr": "c:var_usage_call_function.cc@39@F@caller#@x", "short_name": "x", "qualified_name": "x", - "declaration": "tests/usage/var_usage_call_function.cc:4:8", + "definition": "tests/usage/var_usage_call_function.cc:4:8", "all_uses": ["tests/usage/var_usage_call_function.cc:4:8", "tests/usage/var_usage_call_function.cc:5:3"] }] } diff --git a/tests/usage/var_usage_class_member.cc b/tests/usage/var_usage_class_member.cc index ead7acad..0e37bb15 100644 --- a/tests/usage/var_usage_class_member.cc +++ b/tests/usage/var_usage_class_member.cc @@ -35,6 +35,7 @@ OUTPUT: "usr": "c:@F@accept#I#", "short_name": "accept", "qualified_name": "accept", + "declaration": "tests/usage/var_usage_class_member.cc:7:6", "callers": ["2@tests/usage/var_usage_class_member.cc:14:3", "2@tests/usage/var_usage_class_member.cc:15:3", "2@tests/usage/var_usage_class_member.cc:17:3"], "all_uses": ["tests/usage/var_usage_class_member.cc:7:6", "tests/usage/var_usage_class_member.cc:14:3", "tests/usage/var_usage_class_member.cc:15:3", "tests/usage/var_usage_class_member.cc:17:3"] }, { @@ -42,6 +43,7 @@ OUTPUT: "usr": "c:@F@accept#*I#", "short_name": "accept", "qualified_name": "accept", + "declaration": "tests/usage/var_usage_class_member.cc:8:6", "callers": ["2@tests/usage/var_usage_class_member.cc:16:3"], "all_uses": ["tests/usage/var_usage_class_member.cc:8:6", "tests/usage/var_usage_class_member.cc:16:3"] }, { @@ -58,7 +60,7 @@ OUTPUT: "usr": "c:@S@Foo@FI@x", "short_name": "x", "qualified_name": "Foo::x", - "declaration": "tests/usage/var_usage_class_member.cc:3:7", + "definition": "tests/usage/var_usage_class_member.cc:3:7", "declaring_type": 0, "all_uses": ["tests/usage/var_usage_class_member.cc:3:7", "tests/usage/var_usage_class_member.cc:12:5", "tests/usage/var_usage_class_member.cc:13:5", "tests/usage/var_usage_class_member.cc:14:12", "tests/usage/var_usage_class_member.cc:15:12", "tests/usage/var_usage_class_member.cc:16:13"] }, { @@ -66,7 +68,7 @@ OUTPUT: "usr": "c:@S@Foo@FI@y", "short_name": "y", "qualified_name": "Foo::y", - "declaration": "tests/usage/var_usage_class_member.cc:4:7", + "definition": "tests/usage/var_usage_class_member.cc:4:7", "declaring_type": 0, "all_uses": ["tests/usage/var_usage_class_member.cc:4:7", "tests/usage/var_usage_class_member.cc:17:12"] }, { @@ -74,7 +76,7 @@ OUTPUT: "usr": "c:var_usage_class_member.cc@105@F@foo#@f", "short_name": "f", "qualified_name": "f", - "declaration": "tests/usage/var_usage_class_member.cc:11:7", + "definition": "tests/usage/var_usage_class_member.cc:11:7", "variable_type": 0, "all_uses": ["tests/usage/var_usage_class_member.cc:11:7", "tests/usage/var_usage_class_member.cc:12:3", "tests/usage/var_usage_class_member.cc:13:3", "tests/usage/var_usage_class_member.cc:14:10", "tests/usage/var_usage_class_member.cc:15:10", "tests/usage/var_usage_class_member.cc:16:11", "tests/usage/var_usage_class_member.cc:17:10"] }] diff --git a/tests/usage/var_usage_class_member_static.cc b/tests/usage/var_usage_class_member_static.cc index 9bb95595..eeed2cc0 100644 --- a/tests/usage/var_usage_class_member_static.cc +++ b/tests/usage/var_usage_class_member_static.cc @@ -24,6 +24,7 @@ OUTPUT: "usr": "c:@F@accept#I#", "short_name": "accept", "qualified_name": "accept", + "declaration": "tests/usage/var_usage_class_member_static.cc:5:6", "callers": ["1@tests/usage/var_usage_class_member_static.cc:8:3"], "all_uses": ["tests/usage/var_usage_class_member_static.cc:5:6", "tests/usage/var_usage_class_member_static.cc:8:3"] }, { diff --git a/tests/usage/var_usage_func_parameter.cc b/tests/usage/var_usage_func_parameter.cc index 1b1a6ff7..49ee8488 100644 --- a/tests/usage/var_usage_func_parameter.cc +++ b/tests/usage/var_usage_func_parameter.cc @@ -18,7 +18,7 @@ OUTPUT: "usr": "c:var_usage_func_parameter.cc@9@F@foo#I#@a", "short_name": "a", "qualified_name": "a", - "declaration": "tests/usage/var_usage_func_parameter.cc:1:14", + "definition": "tests/usage/var_usage_func_parameter.cc:1:14", "all_uses": ["tests/usage/var_usage_func_parameter.cc:1:14", "tests/usage/var_usage_func_parameter.cc:2:3"] }] } diff --git a/tests/usage/var_usage_local.cc b/tests/usage/var_usage_local.cc index 0d86a45d..7ccda6db 100644 --- a/tests/usage/var_usage_local.cc +++ b/tests/usage/var_usage_local.cc @@ -19,7 +19,7 @@ OUTPUT: "usr": "c:var_usage_local.cc@16@F@foo#@x", "short_name": "x", "qualified_name": "x", - "declaration": "tests/usage/var_usage_local.cc:2:7", + "definition": "tests/usage/var_usage_local.cc:2:7", "all_uses": ["tests/usage/var_usage_local.cc:2:7", "tests/usage/var_usage_local.cc:3:3"] }] } diff --git a/tests/usage/var_usage_shadowed_local.cc b/tests/usage/var_usage_shadowed_local.cc index c555c5c8..8440d365 100644 --- a/tests/usage/var_usage_shadowed_local.cc +++ b/tests/usage/var_usage_shadowed_local.cc @@ -24,14 +24,14 @@ OUTPUT: "usr": "c:var_usage_shadowed_local.cc@16@F@foo#@a", "short_name": "a", "qualified_name": "a", - "declaration": "tests/usage/var_usage_shadowed_local.cc:2:7", + "definition": "tests/usage/var_usage_shadowed_local.cc:2:7", "all_uses": ["tests/usage/var_usage_shadowed_local.cc:2:7", "tests/usage/var_usage_shadowed_local.cc:3:3", "tests/usage/var_usage_shadowed_local.cc:8:3"] }, { "id": 1, "usr": "c:var_usage_shadowed_local.cc@43@F@foo#@a", "short_name": "a", "qualified_name": "a", - "declaration": "tests/usage/var_usage_shadowed_local.cc:5:9", + "definition": "tests/usage/var_usage_shadowed_local.cc:5:9", "all_uses": ["tests/usage/var_usage_shadowed_local.cc:5:9", "tests/usage/var_usage_shadowed_local.cc:6:5"] }] } diff --git a/tests/usage/var_usage_shadowed_parameter.cc b/tests/usage/var_usage_shadowed_parameter.cc index caaf653f..b6276ce4 100644 --- a/tests/usage/var_usage_shadowed_parameter.cc +++ b/tests/usage/var_usage_shadowed_parameter.cc @@ -24,14 +24,14 @@ OUTPUT: "usr": "c:var_usage_shadowed_parameter.cc@9@F@foo#I#@a", "short_name": "a", "qualified_name": "a", - "declaration": "tests/usage/var_usage_shadowed_parameter.cc:1:14", + "definition": "tests/usage/var_usage_shadowed_parameter.cc:1:14", "all_uses": ["tests/usage/var_usage_shadowed_parameter.cc:1:14", "tests/usage/var_usage_shadowed_parameter.cc:2:3", "tests/usage/var_usage_shadowed_parameter.cc:7:3"] }, { "id": 1, "usr": "c:var_usage_shadowed_parameter.cc@38@F@foo#I#@a", "short_name": "a", "qualified_name": "a", - "declaration": "tests/usage/var_usage_shadowed_parameter.cc:4:9", + "definition": "tests/usage/var_usage_shadowed_parameter.cc:4:9", "all_uses": ["tests/usage/var_usage_shadowed_parameter.cc:4:9", "tests/usage/var_usage_shadowed_parameter.cc:5:5"] }] } diff --git a/tests/usage/var_usage_static.cc b/tests/usage/var_usage_static.cc index aae45312..f979a594 100644 --- a/tests/usage/var_usage_static.cc +++ b/tests/usage/var_usage_static.cc @@ -21,7 +21,7 @@ OUTPUT: "usr": "c:var_usage_static.cc@a", "short_name": "a", "qualified_name": "a", - "declaration": "tests/usage/var_usage_static.cc:1:12", + "definition": "tests/usage/var_usage_static.cc:1:12", "all_uses": ["tests/usage/var_usage_static.cc:1:12", "tests/usage/var_usage_static.cc:4:3"] }] } diff --git a/tests/vars/class_member.cc b/tests/vars/class_member.cc index 30e65600..3da94daf 100644 --- a/tests/vars/class_member.cc +++ b/tests/vars/class_member.cc @@ -20,7 +20,7 @@ OUTPUT: "usr": "c:@S@Foo@FI@member", "short_name": "member", "qualified_name": "Foo::member", - "declaration": "tests/vars/class_member.cc:2:8", + "definition": "tests/vars/class_member.cc:2:8", "variable_type": 0, "declaring_type": 0, "all_uses": ["tests/vars/class_member.cc:2:8"] diff --git a/tests/vars/class_static_member.cc b/tests/vars/class_static_member.cc index 0d3b0230..9557b663 100644 --- a/tests/vars/class_static_member.cc +++ b/tests/vars/class_static_member.cc @@ -25,7 +25,8 @@ OUTPUT: "usr": "c:@S@Foo@member", "short_name": "member", "qualified_name": "Foo::member", - "declaration": "tests/vars/class_static_member.cc:4:11", + "declaration": "tests/vars/class_static_member.cc:2:15", + "definition": "tests/vars/class_static_member.cc:4:11", "variable_type": 0, "declaring_type": 0, "all_uses": ["tests/vars/class_static_member.cc:2:15", "tests/vars/class_static_member.cc:4:11"] diff --git a/tests/vars/function_local.cc b/tests/vars/function_local.cc index 59168a70..bb12a6ff 100644 --- a/tests/vars/function_local.cc +++ b/tests/vars/function_local.cc @@ -26,7 +26,7 @@ OUTPUT: "usr": "c:function_local.cc@31@F@foo#@a", "short_name": "a", "qualified_name": "a", - "declaration": "tests/vars/function_local.cc:4:8", + "definition": "tests/vars/function_local.cc:4:8", "variable_type": 0, "all_uses": ["tests/vars/function_local.cc:4:8"] }] diff --git a/tests/vars/function_param.cc b/tests/vars/function_param.cc index 3149bfbe..787d1543 100644 --- a/tests/vars/function_param.cc +++ b/tests/vars/function_param.cc @@ -24,7 +24,7 @@ OUTPUT: "usr": "c:function_param.cc@24@F@foo#*$@S@Foo#S0_#@p0", "short_name": "p0", "qualified_name": "p0", - "declaration": "tests/vars/function_param.cc:3:15", + "definition": "tests/vars/function_param.cc:3:15", "variable_type": 0, "all_uses": ["tests/vars/function_param.cc:3:15"] }, { @@ -32,7 +32,7 @@ OUTPUT: "usr": "c:function_param.cc@33@F@foo#*$@S@Foo#S0_#@p1", "short_name": "p1", "qualified_name": "p1", - "declaration": "tests/vars/function_param.cc:3:24", + "definition": "tests/vars/function_param.cc:3:24", "variable_type": 0, "all_uses": ["tests/vars/function_param.cc:3:24"] }] diff --git a/tests/vars/function_shadow_local.cc b/tests/vars/function_shadow_local.cc index 63e5b391..6353f548 100644 --- a/tests/vars/function_shadow_local.cc +++ b/tests/vars/function_shadow_local.cc @@ -24,14 +24,14 @@ OUTPUT: "usr": "c:function_shadow_local.cc@16@F@foo#@a", "short_name": "a", "qualified_name": "a", - "declaration": "tests/vars/function_shadow_local.cc:2:7", + "definition": "tests/vars/function_shadow_local.cc:2:7", "all_uses": ["tests/vars/function_shadow_local.cc:2:7", "tests/vars/function_shadow_local.cc:3:3", "tests/vars/function_shadow_local.cc:8:3"] }, { "id": 1, "usr": "c:function_shadow_local.cc@43@F@foo#@a", "short_name": "a", "qualified_name": "a", - "declaration": "tests/vars/function_shadow_local.cc:5:9", + "definition": "tests/vars/function_shadow_local.cc:5:9", "all_uses": ["tests/vars/function_shadow_local.cc:5:9", "tests/vars/function_shadow_local.cc:6:5"] }] } diff --git a/tests/vars/function_shadow_param.cc b/tests/vars/function_shadow_param.cc index 1f30342f..834af05f 100644 --- a/tests/vars/function_shadow_param.cc +++ b/tests/vars/function_shadow_param.cc @@ -18,14 +18,14 @@ OUTPUT: "usr": "c:function_shadow_param.cc@9@F@foo#I#@p", "short_name": "p", "qualified_name": "p", - "declaration": "tests/vars/function_shadow_param.cc:1:14", + "definition": "tests/vars/function_shadow_param.cc:1:14", "all_uses": ["tests/vars/function_shadow_param.cc:1:14"] }, { "id": 1, "usr": "c:function_shadow_param.cc@21@F@foo#I#@p", "short_name": "p", "qualified_name": "p", - "declaration": "tests/vars/function_shadow_param.cc:2:7", + "definition": "tests/vars/function_shadow_param.cc:2:7", "all_uses": ["tests/vars/function_shadow_param.cc:2:7"] }] } diff --git a/tests/vars/global_variable.cc b/tests/vars/global_variable.cc index 67ead27e..2dd83b6a 100644 --- a/tests/vars/global_variable.cc +++ b/tests/vars/global_variable.cc @@ -9,7 +9,7 @@ OUTPUT: "usr": "c:global_variable.cc@global", "short_name": "global", "qualified_name": "global", - "declaration": "tests/vars/global_variable.cc:1:12", + "definition": "tests/vars/global_variable.cc:1:12", "all_uses": ["tests/vars/global_variable.cc:1:12"] }] }