From 96e0f0fafaa0e7149130093a7edf020bfe7e627a Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 7 Jul 2018 16:56:47 -0700 Subject: [PATCH] clangIndex --- index_tests/_empty_test.cc | 2 +- index_tests/class_forward_declaration.cc | 8 +- index_tests/constructors/constructor.cc | 20 +- index_tests/constructors/destructor.cc | 24 +- .../constructors/implicit_constructor.cc | 24 +- index_tests/constructors/invalid_reference.cc | 16 +- index_tests/constructors/make_functions.cc | 193 +----- .../declaration_vs_definition/class.cc | 8 +- .../declaration_vs_definition/class_member.cc | 28 +- .../class_member_static.cc | 47 +- index_tests/declaration_vs_definition/func.cc | 4 +- .../func_associated_function_params.cc | 18 +- .../declaration_vs_definition/method.cc | 24 +- index_tests/enums/enum_class_decl.cc | 58 +- index_tests/enums/enum_decl.cc | 38 +- index_tests/enums/enum_inherit.cc | 78 ++- index_tests/enums/enum_usage.cc | 36 +- index_tests/foobar.cc | 26 +- index_tests/function_declaration.cc | 2 +- .../function_declaration_definition.cc | 4 +- index_tests/function_definition.cc | 2 +- index_tests/inheritance/class_inherit.cc | 14 +- .../class_inherit_templated_parent.cc | 88 +-- .../inheritance/class_multiple_inherit.cc | 30 +- index_tests/inheritance/function_override.cc | 24 +- .../inheritance/interface_pure_virtual.cc | 12 +- .../inheritance/multiple_base_functions.cc | 46 +- index_tests/lambdas/lambda.cc | 41 +- index_tests/macros/complex.cc | 28 +- index_tests/macros/foo.cc | 56 +- index_tests/method_declaration.cc | 10 +- index_tests/method_definition.cc | 14 +- index_tests/method_inline_declaration.cc | 10 +- index_tests/multi_file/funky_enum.cc | 60 +- index_tests/multi_file/impl.cc | 98 +-- index_tests/multi_file/simple_impl.cc | 21 +- index_tests/multi_file/static.cc | 41 +- index_tests/namespaces/anonymous_function.cc | 4 +- .../namespaces/function_declaration.cc | 31 +- index_tests/namespaces/function_definition.cc | 31 +- index_tests/namespaces/method_declaration.cc | 41 +- index_tests/namespaces/method_definition.cc | 47 +- .../namespaces/method_inline_declaration.cc | 41 +- index_tests/namespaces/namespace_alias.cc | 122 ++-- index_tests/namespaces/namespace_reference.cc | 68 +- index_tests/operators/operator.cc | 20 +- .../outline/static_function_in_type.cc | 117 ++-- index_tests/preprocessor/include_guard.cc | 6 +- index_tests/preprocessor/skipped.cc | 2 +- .../func_specialized_template_param.cc | 18 +- .../implicit_variable_instantiation.cc | 137 ++-- .../templates/member_ref_in_template.cc | 45 +- ...ass_template_func_usage_folded_into_one.cc | 79 ++- ...ace_template_type_usage_folded_into_one.cc | 63 +- index_tests/templates/specialization.cc | 250 +++----- .../templates/specialized_func_definition.cc | 51 +- ...mplate_class_func_usage_folded_into_one.cc | 24 +- ...ass_template_func_usage_folded_into_one.cc | 24 +- ...mplate_class_type_usage_folded_into_one.cc | 26 +- ...emplate_class_var_usage_folded_into_one.cc | 44 +- .../template_func_usage_folded_into_one.cc | 12 +- .../template_type_usage_folded_into_one.cc | 8 +- .../template_var_usage_folded_into_one.cc | 27 +- index_tests/types/anonymous_struct.cc | 81 ++- index_tests/types/typedefs.cc | 26 +- index_tests/unions/union_decl.cc | 40 +- index_tests/unions/union_usage.cc | 46 +- .../usage/func_called_from_constructor.cc | 22 +- .../usage/func_called_from_macro_argument.cc | 14 +- .../usage/func_called_from_template.cc | 10 +- .../usage/func_called_implicit_ctor.cc | 20 +- index_tests/usage/func_usage_addr_func.cc | 15 +- index_tests/usage/func_usage_addr_method.cc | 22 +- index_tests/usage/func_usage_call_func.cc | 6 +- index_tests/usage/func_usage_call_method.cc | 18 +- .../usage/func_usage_class_inline_var_def.cc | 30 +- .../usage/func_usage_forward_decl_func.cc | 6 +- .../usage/func_usage_forward_decl_method.cc | 18 +- index_tests/usage/func_usage_template_func.cc | 25 +- .../usage/type_usage_as_template_parameter.cc | 20 +- ...ype_usage_as_template_parameter_complex.cc | 32 +- ...type_usage_as_template_parameter_simple.cc | 14 +- .../usage/type_usage_declare_extern.cc | 10 +- index_tests/usage/type_usage_declare_field.cc | 38 +- index_tests/usage/type_usage_declare_local.cc | 14 +- index_tests/usage/type_usage_declare_param.cc | 16 +- .../type_usage_declare_param_prototype.cc | 12 +- .../usage/type_usage_declare_param_unnamed.cc | 6 +- .../usage/type_usage_declare_qualifiers.cc | 12 +- .../usage/type_usage_declare_static.cc | 10 +- .../usage/type_usage_on_return_type.cc | 34 +- .../usage/type_usage_typedef_and_using.cc | 51 +- .../type_usage_typedef_and_using_template.cc | 26 +- index_tests/usage/type_usage_various.cc | 20 +- index_tests/usage/usage_inside_of_call.cc | 63 +- .../usage/usage_inside_of_call_simple.cc | 8 +- index_tests/usage/var_usage_call_function.cc | 16 +- index_tests/usage/var_usage_class_member.cc | 42 +- .../usage/var_usage_class_member_static.cc | 38 +- index_tests/usage/var_usage_cstyle_cast.cc | 49 +- index_tests/usage/var_usage_extern.cc | 12 +- index_tests/usage/var_usage_func_parameter.cc | 10 +- index_tests/usage/var_usage_local.cc | 10 +- index_tests/usage/var_usage_shadowed_local.cc | 14 +- .../usage/var_usage_shadowed_parameter.cc | 16 +- index_tests/usage/var_usage_static.cc | 12 +- index_tests/vars/class_member.cc | 24 +- index_tests/vars/class_static_member.cc | 43 +- .../vars/class_static_member_decl_only.cc | 34 +- index_tests/vars/deduce_auto_type.cc | 22 +- index_tests/vars/function_local.cc | 8 +- index_tests/vars/function_param.cc | 12 +- index_tests/vars/function_param_unnamed.cc | 2 +- index_tests/vars/function_shadow_local.cc | 14 +- index_tests/vars/function_shadow_param.cc | 12 +- index_tests/vars/global_variable.cc | 12 +- index_tests/vars/global_variable_decl_only.cc | 10 +- .../vars/type_instance_on_using_type.cc | 15 +- src/file_consumer.cc | 21 +- src/file_consumer.h | 4 +- src/indexer.cc | 590 ++++++++++++------ src/indexer.h | 5 +- src/query.cc | 3 +- src/serializer.cc | 6 +- src/utils.cc | 4 + src/utils.h | 5 + 126 files changed, 2209 insertions(+), 2232 deletions(-) diff --git a/index_tests/_empty_test.cc b/index_tests/_empty_test.cc index 87accc88..d1ae7a6c 100644 --- a/index_tests/_empty_test.cc +++ b/index_tests/_empty_test.cc @@ -2,7 +2,7 @@ OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [], "usr2var": [] diff --git a/index_tests/class_forward_declaration.cc b/index_tests/class_forward_declaration.cc index 29728298..a90ce125 100644 --- a/index_tests/class_forward_declaration.cc +++ b/index_tests/class_forward_declaration.cc @@ -7,17 +7,17 @@ class Foo; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": ["1:7-1:10|0|1|1", "2:7-2:10|0|1|1", "4:7-4:10|0|1|1"], "spell": "3:7-3:10|0|1|2", - "extent": "3:1-3:13|0|1|0", + "extent": "1:1-1:10|0|1|0", "alias_of": 0, "bases": [], "derived": [], diff --git a/index_tests/constructors/constructor.cc b/index_tests/constructors/constructor.cc index 33c2ff6c..46f44dbe 100644 --- a/index_tests/constructors/constructor.cc +++ b/index_tests/constructors/constructor.cc @@ -12,7 +12,7 @@ void foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 3385168158331140247, "detailed_name": "Foo::Foo()", @@ -21,13 +21,13 @@ OUTPUT: "kind": 9, "storage": 0, "declarations": [], - "spell": "3:3-3:6|15041163540773201510|2|2", + "spell": "3:3-3:6|15041163540773201510|2|514", "extent": "3:3-3:11|15041163540773201510|2|0", - "declaring_type": 15041163540773201510, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], - "uses": ["7:7-7:8|4259594751088586730|3|288", "8:17-8:20|4259594751088586730|3|32"], + "uses": ["7:7-7:8|15041163540773201510|2|8228", "8:17-8:20|15041163540773201510|2|8228"], "callees": [] }, { "usr": 4259594751088586730, @@ -42,17 +42,17 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [10983126130596230582, 17165811951126099095], + "vars": [], "uses": [], - "callees": ["7:7-7:8|3385168158331140247|3|288", "7:7-7:8|3385168158331140247|3|288", "8:17-8:20|3385168158331140247|3|32", "8:17-8:20|3385168158331140247|3|32"] + "callees": [] }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, - "declarations": ["3:3-3:6|0|1|4"], + "declarations": [], "spell": "1:7-1:10|0|1|2", "extent": "1:1-4:2|0|1|0", "alias_of": 0, @@ -62,7 +62,7 @@ OUTPUT: "funcs": [3385168158331140247], "vars": [], "instances": [10983126130596230582, 17165811951126099095], - "uses": ["3:3-3:6|15041163540773201510|2|4", "7:3-7:6|0|1|4", "8:3-8:6|0|1|4", "8:17-8:20|0|1|4"] + "uses": ["3:3-3:6|0|1|4", "7:3-7:6|0|1|4", "8:3-8:6|0|1|4", "8:17-8:20|0|1|4"] }], "usr2var": [{ "usr": 10983126130596230582, diff --git a/index_tests/constructors/destructor.cc b/index_tests/constructors/destructor.cc index ff79a520..c722bab0 100644 --- a/index_tests/constructors/destructor.cc +++ b/index_tests/constructors/destructor.cc @@ -17,7 +17,7 @@ void foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 3385168158331140247, "detailed_name": "Foo::Foo()", @@ -26,13 +26,13 @@ OUTPUT: "kind": 9, "storage": 0, "declarations": [], - "spell": "3:3-3:6|15041163540773201510|2|2", + "spell": "3:3-3:6|15041163540773201510|2|514", "extent": "3:3-3:11|15041163540773201510|2|0", - "declaring_type": 15041163540773201510, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], - "uses": ["8:7-8:8|4259594751088586730|3|288"], + "uses": ["8:7-8:8|15041163540773201510|2|8228"], "callees": [] }, { "usr": 4259594751088586730, @@ -47,9 +47,9 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [1893354193220338759], + "vars": [], "uses": [], - "callees": ["8:7-8:8|3385168158331140247|3|288", "8:7-8:8|3385168158331140247|3|288"] + "callees": [] }, { "usr": 7440261702884428359, "detailed_name": "Foo::~Foo() noexcept", @@ -58,9 +58,9 @@ OUTPUT: "kind": 6, "storage": 0, "declarations": [], - "spell": "4:3-4:7|15041163540773201510|2|2", + "spell": "4:3-4:4|15041163540773201510|2|514", "extent": "4:3-4:12|15041163540773201510|2|0", - "declaring_type": 15041163540773201510, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -69,11 +69,11 @@ OUTPUT: }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, - "declarations": ["3:3-3:6|0|1|4", "4:4-4:7|0|1|4"], + "declarations": [], "spell": "1:7-1:10|0|1|2", "extent": "1:1-5:2|0|1|0", "alias_of": 0, @@ -83,7 +83,7 @@ OUTPUT: "funcs": [3385168158331140247, 7440261702884428359], "vars": [], "instances": [1893354193220338759], - "uses": ["3:3-3:6|15041163540773201510|2|4", "8:3-8:6|0|1|4"] + "uses": ["3:3-3:6|0|1|4", "4:4-4:7|0|1|4", "8:3-8:6|0|1|4"] }], "usr2var": [{ "usr": 1893354193220338759, diff --git a/index_tests/constructors/implicit_constructor.cc b/index_tests/constructors/implicit_constructor.cc index 6600ac37..abcbd9a5 100644 --- a/index_tests/constructors/implicit_constructor.cc +++ b/index_tests/constructors/implicit_constructor.cc @@ -11,7 +11,7 @@ void Make() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 3957104924306079513, "detailed_name": "void Make()", @@ -25,9 +25,9 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [449111627548814328, 17097499197730163115], + "vars": [], "uses": [], - "callees": ["6:8-6:12|10530961286677896857|3|288", "6:8-6:12|10530961286677896857|3|288", "7:15-7:19|10530961286677896857|3|32", "7:15-7:19|10530961286677896857|3|32"] + "callees": [] }, { "usr": 10530961286677896857, "detailed_name": "Type::Type()", @@ -36,22 +36,22 @@ OUTPUT: "kind": 9, "storage": 0, "declarations": [], - "spell": "2:3-2:7|13487927231218873822|2|2", + "spell": "2:3-2:7|13487927231218873822|2|514", "extent": "2:3-2:12|13487927231218873822|2|0", - "declaring_type": 13487927231218873822, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], - "uses": ["6:8-6:12|3957104924306079513|3|288", "7:15-7:19|3957104924306079513|3|32"], + "uses": ["6:8-6:12|13487927231218873822|2|8228", "7:15-7:19|13487927231218873822|2|8228"], "callees": [] }], "usr2type": [{ "usr": 13487927231218873822, - "detailed_name": "Type", - "qual_name_offset": 0, + "detailed_name": "struct Type {}", + "qual_name_offset": 7, "short_name": "Type", "kind": 23, - "declarations": ["2:3-2:7|0|1|4"], + "declarations": [], "spell": "1:8-1:12|0|1|2", "extent": "1:1-3:2|0|1|0", "alias_of": 0, @@ -61,7 +61,7 @@ OUTPUT: "funcs": [10530961286677896857], "vars": [], "instances": [449111627548814328, 17097499197730163115], - "uses": ["2:3-2:7|13487927231218873822|2|4", "6:3-6:7|0|1|4", "7:15-7:19|0|1|4"] + "uses": ["2:3-2:7|0|1|4", "6:3-6:7|0|1|4", "7:15-7:19|0|1|4"] }], "usr2var": [{ "usr": 449111627548814328, @@ -77,10 +77,10 @@ OUTPUT: "storage": 0 }, { "usr": 17097499197730163115, - "detailed_name": "Type foo1", + "detailed_name": "auto foo1", "qual_name_offset": 5, "short_name": "foo1", - "hover": "Type foo1 = Type()", + "hover": "auto foo1 = Type()", "declarations": [], "spell": "7:8-7:12|3957104924306079513|3|2", "extent": "7:3-7:21|3957104924306079513|3|0", diff --git a/index_tests/constructors/invalid_reference.cc b/index_tests/constructors/invalid_reference.cc index 29118e1e..c68bc86e 100644 --- a/index_tests/constructors/invalid_reference.cc +++ b/index_tests/constructors/invalid_reference.cc @@ -11,18 +11,18 @@ EXTRA_FLAGS: OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 17319723337446061757, - "detailed_name": "Foo::Foo()", + "detailed_name": "Foo::Foo::Foo()", "qual_name_offset": 0, "short_name": "Foo", "kind": 9, "storage": 0, "declarations": [], - "spell": "4:6-4:9|15041163540773201510|2|2", + "spell": "4:6-4:9|0|1|514", "extent": "4:1-4:11|0|1|0", - "declaring_type": 15041163540773201510, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -31,11 +31,11 @@ OUTPUT: }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo {}", + "qual_name_offset": 7, "short_name": "Foo", "kind": 23, - "declarations": ["4:6-4:9|0|1|4"], + "declarations": [], "spell": "1:8-1:11|0|1|2", "extent": "1:1-1:14|0|1|0", "alias_of": 0, @@ -45,7 +45,7 @@ OUTPUT: "funcs": [17319723337446061757], "vars": [], "instances": [], - "uses": ["4:6-4:9|0|1|4", "4:1-4:4|0|1|4"] + "uses": ["4:1-4:4|0|1|4", "4:6-4:9|0|1|4"] }], "usr2var": [] } diff --git a/index_tests/constructors/make_functions.cc b/index_tests/constructors/make_functions.cc index 7407640a..5a74373a 100644 --- a/index_tests/constructors/make_functions.cc +++ b/index_tests/constructors/make_functions.cc @@ -27,7 +27,7 @@ void caller22() { OUTPUT: make_functions.h { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 3765833212244435302, "detailed_name": "Foobar::Foobar(int &&, Bar *, bool *)", @@ -36,9 +36,9 @@ OUTPUT: make_functions.h "kind": 9, "storage": 0, "declarations": [], - "spell": "7:3-7:9|14935975554338052500|2|2", + "spell": "7:3-7:9|14935975554338052500|2|514", "extent": "7:3-7:32|14935975554338052500|2|0", - "declaring_type": 14935975554338052500, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -52,9 +52,9 @@ OUTPUT: make_functions.h "kind": 9, "storage": 0, "declarations": [], - "spell": "6:3-6:9|14935975554338052500|2|2", + "spell": "6:3-6:9|14935975554338052500|2|514", "extent": "6:3-6:17|14935975554338052500|2|0", - "declaring_type": 14935975554338052500, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -68,9 +68,9 @@ OUTPUT: make_functions.h "kind": 9, "storage": 0, "declarations": [], - "spell": "5:3-5:9|14935975554338052500|2|2", + "spell": "5:3-5:9|14935975554338052500|2|514", "extent": "5:3-5:14|14935975554338052500|2|0", - "declaring_type": 14935975554338052500, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -84,9 +84,9 @@ OUTPUT: make_functions.h "kind": 9, "storage": 0, "declarations": [], - "spell": "8:3-8:9|14935975554338052500|2|2", + "spell": "8:3-8:9|14935975554338052500|2|514", "extent": "8:3-8:30|14935975554338052500|2|0", - "declaring_type": 14935975554338052500, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -95,8 +95,8 @@ OUTPUT: make_functions.h }], "usr2type": [{ "usr": 12993848456528750350, - "detailed_name": "Bar", - "qual_name_offset": 0, + "detailed_name": "struct Bar {}", + "qual_name_offset": 7, "short_name": "Bar", "kind": 23, "declarations": [], @@ -112,11 +112,11 @@ OUTPUT: make_functions.h "uses": ["7:17-7:20|0|1|4", "8:15-8:18|0|1|4"] }, { "usr": 14935975554338052500, - "detailed_name": "Foobar", - "qual_name_offset": 0, + "detailed_name": "class Foobar {}", + "qual_name_offset": 6, "short_name": "Foobar", "kind": 5, - "declarations": ["5:3-5:9|0|1|4", "6:3-6:9|0|1|4", "7:3-7:9|0|1|4", "8:3-8:9|0|1|4"], + "declarations": [], "spell": "3:7-3:13|0|1|2", "extent": "3:1-9:2|0|1|0", "alias_of": 0, @@ -126,17 +126,14 @@ OUTPUT: make_functions.h "funcs": [13131778807733950299, 13028995015627606181, 3765833212244435302, 17321436359755983845], "vars": [], "instances": [], - "uses": ["5:3-5:9|14935975554338052500|2|4", "6:3-6:9|14935975554338052500|2|4", "7:3-7:9|14935975554338052500|2|4", "8:3-8:9|14935975554338052500|2|4"] + "uses": ["5:3-5:9|0|1|4", "6:3-6:9|0|1|4", "7:3-7:9|0|1|4", "8:3-8:9|0|1|4"] }], "usr2var": [] } OUTPUT: make_functions.cc { - "includes": [{ - "line": 0, - "resolved_path": "&make_functions.h" - }], - "skipped_by_preprocessor": [], + "includes": [], + "skipped_ranges": [], "usr2func": [{ "usr": 2532818908869373467, "detailed_name": "T *maKE_NoRefs(Args ...args)", @@ -150,8 +147,8 @@ OUTPUT: make_functions.cc "declaring_type": 0, "bases": [], "derived": [], - "vars": [3908732770590594660], - "uses": ["17:3-17:14|2816883305867289955|3|32"], + "vars": [], + "uses": ["17:3-17:14|0|1|8228"], "callees": [] }, { "usr": 2816883305867289955, @@ -168,48 +165,6 @@ OUTPUT: make_functions.cc "derived": [], "vars": [], "uses": [], - "callees": ["14:3-14:13|15793662558620604611|3|32", "15:3-15:13|15793662558620604611|3|32", "16:3-16:13|15793662558620604611|3|32", "17:3-17:14|2532818908869373467|3|32"] - }, { - "usr": 3765833212244435302, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "storage": 0, - "declarations": [], - "declaring_type": 0, - "bases": [], - "derived": [], - "vars": [], - "uses": ["16:3-16:13|0|1|288"], - "callees": [] - }, { - "usr": 13028995015627606181, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "storage": 0, - "declarations": [], - "declaring_type": 0, - "bases": [], - "derived": [], - "vars": [], - "uses": ["15:3-15:13|0|1|288"], - "callees": [] - }, { - "usr": 13131778807733950299, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "storage": 0, - "declarations": [], - "declaring_type": 0, - "bases": [], - "derived": [], - "vars": [], - "uses": ["14:3-14:13|0|1|288"], "callees": [] }, { "usr": 15793662558620604611, @@ -224,98 +179,16 @@ OUTPUT: make_functions.cc "declaring_type": 0, "bases": [], "derived": [], - "vars": [8463700030555379526], - "uses": ["14:3-14:13|2816883305867289955|3|32", "15:3-15:13|2816883305867289955|3|32", "16:3-16:13|2816883305867289955|3|32"], - "callees": [] - }, { - "usr": 17321436359755983845, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "storage": 0, - "declarations": [], - "declaring_type": 0, - "bases": [], - "derived": [], "vars": [], - "uses": ["17:3-17:14|0|1|288"], + "uses": ["14:3-14:13|0|1|8228", "15:3-15:13|0|1|8228", "16:3-16:13|0|1|8228"], "callees": [] }], "usr2type": [{ - "usr": 3337128087216004141, - "detailed_name": "Args", - "qual_name_offset": 0, - "short_name": "Args", - "kind": 26, - "declarations": [], - "spell": "8:35-8:39|2532818908869373467|3|2", - "extent": "8:23-8:39|2532818908869373467|3|0", - "alias_of": 0, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["9:16-9:20|0|1|4"] - }, { - "usr": 9281343527065946499, - "detailed_name": "T", - "qual_name_offset": 0, - "short_name": "T", - "kind": 26, - "declarations": [], - "spell": "3:20-3:21|15793662558620604611|3|2", - "extent": "3:11-3:21|15793662558620604611|3|0", - "alias_of": 0, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["4:1-4:2|0|1|4"] - }, { - "usr": 10771590811355716928, - "detailed_name": "Args", - "qual_name_offset": 0, - "short_name": "Args", - "kind": 26, - "declarations": [], - "spell": "3:35-3:39|15793662558620604611|3|2", - "extent": "3:23-3:39|15793662558620604611|3|0", - "alias_of": 0, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["4:15-4:19|0|1|4"] - }, { - "usr": 11897454629873246477, - "detailed_name": "T", - "qual_name_offset": 0, - "short_name": "T", - "kind": 26, - "declarations": [], - "spell": "8:20-8:21|2532818908869373467|3|2", - "extent": "8:11-8:21|2532818908869373467|3|0", - "alias_of": 0, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["9:1-9:2|0|1|4"] - }, { "usr": 12993848456528750350, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, + "detailed_name": "struct Bar {}", + "qual_name_offset": 7, + "short_name": "Bar", + "kind": 23, "declarations": [], "alias_of": 0, "bases": [], @@ -327,10 +200,10 @@ OUTPUT: make_functions.cc "uses": ["16:29-16:32|0|1|4", "17:30-17:33|0|1|4"] }, { "usr": 14935975554338052500, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, + "detailed_name": "class Foobar {}", + "qual_name_offset": 6, + "short_name": "Foobar", + "kind": 5, "declarations": [], "alias_of": 0, "bases": [], @@ -343,11 +216,11 @@ OUTPUT: make_functions.cc }], "usr2var": [{ "usr": 3908732770590594660, - "detailed_name": "Args... args", + "detailed_name": "Args ...args", "qual_name_offset": 8, "short_name": "args", "declarations": [], - "spell": "9:24-9:28|2532818908869373467|3|2", + "spell": "9:24-9:28|2532818908869373467|3|514", "extent": "9:16-9:28|2532818908869373467|3|0", "type": 0, "uses": [], @@ -355,11 +228,11 @@ OUTPUT: make_functions.cc "storage": 0 }, { "usr": 8463700030555379526, - "detailed_name": "Args &&... args", - "qual_name_offset": 11, + "detailed_name": "Args &&...args", + "qual_name_offset": 10, "short_name": "args", "declarations": [], - "spell": "4:25-4:29|15793662558620604611|3|2", + "spell": "4:25-4:29|15793662558620604611|3|514", "extent": "4:15-4:29|15793662558620604611|3|0", "type": 0, "uses": [], diff --git a/index_tests/declaration_vs_definition/class.cc b/index_tests/declaration_vs_definition/class.cc index 23d24d7d..e8aa0e94 100644 --- a/index_tests/declaration_vs_definition/class.cc +++ b/index_tests/declaration_vs_definition/class.cc @@ -9,17 +9,17 @@ class Foo; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": ["1:7-1:10|0|1|1", "2:7-2:10|0|1|1", "4:7-4:10|0|1|1"], "spell": "3:7-3:10|0|1|2", - "extent": "3:1-3:13|0|1|0", + "extent": "1:1-1:10|0|1|0", "alias_of": 0, "bases": [], "derived": [], diff --git a/index_tests/declaration_vs_definition/class_member.cc b/index_tests/declaration_vs_definition/class_member.cc index b0feb85b..37649b69 100644 --- a/index_tests/declaration_vs_definition/class_member.cc +++ b/index_tests/declaration_vs_definition/class_member.cc @@ -6,10 +6,24 @@ class Foo { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], + "skipped_ranges": [], + "usr2func": [{ + "usr": 15041163540773201510, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [9736582033442720743], + "uses": [], + "callees": [] + }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -25,8 +39,8 @@ OUTPUT: "uses": [] }, { "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], @@ -50,9 +64,9 @@ OUTPUT: "qual_name_offset": 4, "short_name": "foo", "declarations": [], - "spell": "2:7-2:10|15041163540773201510|2|2", + "spell": "2:7-2:10|15041163540773201510|2|514", "extent": "2:3-2:10|15041163540773201510|2|0", - "type": 17, + "type": 53, "uses": [], "kind": 8, "storage": 0 diff --git a/index_tests/declaration_vs_definition/class_member_static.cc b/index_tests/declaration_vs_definition/class_member_static.cc index 2de0195d..5c522d44 100644 --- a/index_tests/declaration_vs_definition/class_member_static.cc +++ b/index_tests/declaration_vs_definition/class_member_static.cc @@ -8,10 +8,24 @@ int Foo::foo; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], + "skipped_ranges": [], + "usr2func": [{ + "usr": 15041163540773201510, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [8942920329766232482, 8942920329766232482], + "uses": [], + "callees": [] + }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -23,12 +37,12 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [8942920329766232482], + "instances": [8942920329766232482, 8942920329766232482], "uses": [] }, { "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], @@ -39,25 +53,22 @@ OUTPUT: "derived": [], "types": [], "funcs": [], - "vars": [{ - "L": 8942920329766232482, - "R": -1 - }], + "vars": [], "instances": [], "uses": ["5:5-5:8|0|1|4"] }], "usr2var": [{ "usr": 8942920329766232482, - "detailed_name": "int Foo::foo", - "qual_name_offset": 4, + "detailed_name": "static int Foo::foo", + "qual_name_offset": 11, "short_name": "foo", - "declarations": ["2:14-2:17|15041163540773201510|2|1"], - "spell": "5:10-5:13|15041163540773201510|2|2", - "extent": "5:1-5:13|0|1|0", - "type": 17, + "declarations": ["2:14-2:17|15041163540773201510|2|513"], + "spell": "5:10-5:13|15041163540773201510|2|514", + "extent": "2:3-2:17|15041163540773201510|2|0", + "type": 53, "uses": [], - "kind": 8, - "storage": 0 + "kind": 13, + "storage": 2 }] } */ diff --git a/index_tests/declaration_vs_definition/func.cc b/index_tests/declaration_vs_definition/func.cc index 4fa73102..eb24139c 100644 --- a/index_tests/declaration_vs_definition/func.cc +++ b/index_tests/declaration_vs_definition/func.cc @@ -8,7 +8,7 @@ void foo(); OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", @@ -18,7 +18,7 @@ OUTPUT: "storage": 0, "declarations": ["1:6-1:9|0|1|1", "2:6-2:9|0|1|1", "4:6-4:9|0|1|1"], "spell": "3:6-3:9|0|1|2", - "extent": "3:1-3:14|0|1|0", + "extent": "1:1-1:11|0|1|0", "declaring_type": 0, "bases": [], "derived": [], diff --git a/index_tests/declaration_vs_definition/func_associated_function_params.cc b/index_tests/declaration_vs_definition/func_associated_function_params.cc index 61cf8c6e..74ddc593 100644 --- a/index_tests/declaration_vs_definition/func_associated_function_params.cc +++ b/index_tests/declaration_vs_definition/func_associated_function_params.cc @@ -8,26 +8,26 @@ int foo(int a, int b) { return 0; } OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 2747674671862363334, - "detailed_name": "int foo(int a, int b)", + "detailed_name": "int foo(int, int)", "qual_name_offset": 4, "short_name": "foo", "kind": 12, "storage": 0, "declarations": ["1:5-1:8|0|1|1", "2:5-2:8|0|1|1", "4:5-4:8|0|1|1"], "spell": "5:5-5:8|0|1|2", - "extent": "5:1-5:36|0|1|0", + "extent": "1:1-1:18|0|1|0", "declaring_type": 0, "bases": [], "derived": [], - "vars": [14555488990109936920, 10963664335057337329], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -48,9 +48,9 @@ OUTPUT: "qual_name_offset": 4, "short_name": "b", "declarations": [], - "spell": "5:20-5:21|2747674671862363334|3|2", + "spell": "5:20-5:21|2747674671862363334|3|514", "extent": "5:16-5:21|2747674671862363334|3|0", - "type": 17, + "type": 53, "uses": [], "kind": 253, "storage": 0 @@ -60,9 +60,9 @@ OUTPUT: "qual_name_offset": 4, "short_name": "a", "declarations": [], - "spell": "5:13-5:14|2747674671862363334|3|2", + "spell": "5:13-5:14|2747674671862363334|3|514", "extent": "5:9-5:14|2747674671862363334|3|0", - "type": 17, + "type": 53, "uses": [], "kind": 253, "storage": 0 diff --git a/index_tests/declaration_vs_definition/method.cc b/index_tests/declaration_vs_definition/method.cc index f3362df7..94011284 100644 --- a/index_tests/declaration_vs_definition/method.cc +++ b/index_tests/declaration_vs_definition/method.cc @@ -10,7 +10,7 @@ void Foo::def() {} OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4012226004228259562, "detailed_name": "void Foo::declonly()", @@ -18,8 +18,8 @@ OUTPUT: "short_name": "declonly", "kind": 6, "storage": 0, - "declarations": ["2:8-2:16|15041163540773201510|2|1"], - "declaring_type": 15041163540773201510, + "declarations": ["2:8-2:16|15041163540773201510|2|513"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -32,10 +32,8 @@ OUTPUT: "short_name": "purevirtual", "kind": 6, "storage": 0, - "declarations": [], - "spell": "3:16-3:27|15041163540773201510|2|2", - "extent": "3:3-3:33|15041163540773201510|2|0", - "declaring_type": 15041163540773201510, + "declarations": ["3:16-3:27|15041163540773201510|2|577"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -48,10 +46,10 @@ OUTPUT: "short_name": "def", "kind": 6, "storage": 0, - "declarations": ["4:8-4:11|15041163540773201510|2|1"], - "spell": "7:11-7:14|15041163540773201510|2|2", - "extent": "7:1-7:19|0|1|0", - "declaring_type": 15041163540773201510, + "declarations": ["4:8-4:11|15041163540773201510|2|513"], + "spell": "7:11-7:14|15041163540773201510|2|514", + "extent": "4:3-4:13|15041163540773201510|2|0", + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -60,8 +58,8 @@ OUTPUT: }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], diff --git a/index_tests/enums/enum_class_decl.cc b/index_tests/enums/enum_class_decl.cc index 10bfbb88..3518fbee 100644 --- a/index_tests/enums/enum_class_decl.cc +++ b/index_tests/enums/enum_class_decl.cc @@ -8,15 +8,31 @@ enum class Foo : uint8_t { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], - "usr2type": [{ - "usr": 5, + "skipped_ranges": [], + "usr2func": [{ + "usr": 16985894625255407295, "detailed_name": "", "qual_name_offset": 0, "short_name": "", "kind": 0, + "storage": 0, "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [439339022761937396, 15962370213938840720], + "uses": [], + "callees": [] + }], + "usr2type": [{ + "usr": 2010430204259339553, + "detailed_name": "typedef unsigned char uint8_t", + "qual_name_offset": 22, + "short_name": "uint8_t", + "kind": 252, + "declarations": [], + "spell": "1:23-1:30|0|1|2", + "extent": "1:1-1:30|0|1|0", "alias_of": 0, "bases": [], "derived": [], @@ -25,28 +41,10 @@ OUTPUT: "vars": [], "instances": [], "uses": [] - }, { - "usr": 2010430204259339553, - "detailed_name": "uint8_t", - "qual_name_offset": 0, - "short_name": "uint8_t", - "kind": 252, - "hover": "typedef unsigned char uint8_t", - "declarations": [], - "spell": "1:23-1:30|0|1|2", - "extent": "1:1-1:30|0|1|0", - "alias_of": 5, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["1:23-1:30|0|1|4", "2:12-2:15|0|1|4"] }, { "usr": 16985894625255407295, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "enum class Foo : uint8_t {\n}", + "qual_name_offset": 11, "short_name": "Foo", "kind": 10, "declarations": [], @@ -68,22 +66,22 @@ OUTPUT: "short_name": "A", "hover": "Foo::A = 0", "declarations": [], - "spell": "3:3-3:4|16985894625255407295|2|2", + "spell": "3:3-3:4|16985894625255407295|2|514", "extent": "3:3-3:4|16985894625255407295|2|0", - "type": 16985894625255407295, + "type": 0, "uses": [], "kind": 22, "storage": 0 }, { "usr": 15962370213938840720, - "detailed_name": "Foo::B", + "detailed_name": "Foo::B = 20", "qual_name_offset": 0, "short_name": "B", - "hover": "Foo::B = 20", + "hover": "Foo::B = 20 = 20", "declarations": [], - "spell": "4:3-4:4|16985894625255407295|2|2", + "spell": "4:3-4:4|16985894625255407295|2|514", "extent": "4:3-4:9|16985894625255407295|2|0", - "type": 16985894625255407295, + "type": 0, "uses": [], "kind": 22, "storage": 0 diff --git a/index_tests/enums/enum_decl.cc b/index_tests/enums/enum_decl.cc index 7972f850..ae283d35 100644 --- a/index_tests/enums/enum_decl.cc +++ b/index_tests/enums/enum_decl.cc @@ -7,12 +7,26 @@ enum Foo { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], + "skipped_ranges": [], + "usr2func": [{ + "usr": 16985894625255407295, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [439339022761937396, 15962370213938840720], + "uses": [], + "callees": [] + }], "usr2type": [{ "usr": 16985894625255407295, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "enum Foo {\n}", + "qual_name_offset": 5, "short_name": "Foo", "kind": 10, "declarations": [], @@ -29,27 +43,27 @@ OUTPUT: }], "usr2var": [{ "usr": 439339022761937396, - "detailed_name": "Foo::A", + "detailed_name": "A", "qual_name_offset": 0, "short_name": "A", - "hover": "Foo::A = 0", + "hover": "A = 0", "declarations": [], - "spell": "2:3-2:4|16985894625255407295|2|2", + "spell": "2:3-2:4|16985894625255407295|2|514", "extent": "2:3-2:4|16985894625255407295|2|0", - "type": 16985894625255407295, + "type": 0, "uses": [], "kind": 22, "storage": 0 }, { "usr": 15962370213938840720, - "detailed_name": "Foo::B", + "detailed_name": "B = 20", "qual_name_offset": 0, "short_name": "B", - "hover": "Foo::B = 20", + "hover": "B = 20 = 20", "declarations": [], - "spell": "3:3-3:4|16985894625255407295|2|2", + "spell": "3:3-3:4|16985894625255407295|2|514", "extent": "3:3-3:9|16985894625255407295|2|0", - "type": 16985894625255407295, + "type": 0, "uses": [], "kind": 22, "storage": 0 diff --git a/index_tests/enums/enum_inherit.cc b/index_tests/enums/enum_inherit.cc index 2e4c774c..fab7c3d3 100644 --- a/index_tests/enums/enum_inherit.cc +++ b/index_tests/enums/enum_inherit.cc @@ -14,27 +14,40 @@ enum class E : int32_t { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], - "usr2type": [{ - "usr": 17, + "skipped_ranges": [], + "usr2func": [{ + "usr": 2986879766914123941, "detailed_name": "", "qual_name_offset": 0, "short_name": "", "kind": 0, + "storage": 0, "declarations": [], - "alias_of": 0, + "declaring_type": 0, "bases": [], "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": [] + "vars": [16614320383091394267, 16847439761518576294], + "uses": [], + "callees": [] }, { - "usr": 2986879766914123941, - "detailed_name": "E", + "usr": 16985894625255407295, + "detailed_name": "", "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [439339022761937396, 15962370213938840720], + "uses": [], + "callees": [] + }], + "usr2type": [{ + "usr": 2986879766914123941, + "detailed_name": "enum class E : int32_t {\n}", + "qual_name_offset": 11, "short_name": "E", "kind": 10, "declarations": [], @@ -50,26 +63,25 @@ OUTPUT: "uses": [] }, { "usr": 14939241684006947339, - "detailed_name": "int32_t", - "qual_name_offset": 0, + "detailed_name": "typedef int int32_t", + "qual_name_offset": 12, "short_name": "int32_t", "kind": 252, - "hover": "typedef int int32_t", "declarations": [], "spell": "6:13-6:20|0|1|2", "extent": "6:1-6:20|0|1|0", - "alias_of": 17, + "alias_of": 0, "bases": [], "derived": [], "types": [], "funcs": [], "vars": [], "instances": [], - "uses": ["6:13-6:20|0|1|4", "8:12-8:13|0|1|4"] + "uses": [] }, { "usr": 16985894625255407295, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "enum Foo : int {\n}", + "qual_name_offset": 5, "short_name": "Foo", "kind": 10, "declarations": [], @@ -86,27 +98,27 @@ OUTPUT: }], "usr2var": [{ "usr": 439339022761937396, - "detailed_name": "Foo::A", + "detailed_name": "A", "qual_name_offset": 0, "short_name": "A", - "hover": "Foo::A = 0", + "hover": "A = 0", "declarations": [], - "spell": "2:3-2:4|16985894625255407295|2|2", + "spell": "2:3-2:4|16985894625255407295|2|514", "extent": "2:3-2:4|16985894625255407295|2|0", - "type": 16985894625255407295, + "type": 0, "uses": [], "kind": 22, "storage": 0 }, { "usr": 15962370213938840720, - "detailed_name": "Foo::B", + "detailed_name": "B = 20", "qual_name_offset": 0, "short_name": "B", - "hover": "Foo::B = 20", + "hover": "B = 20 = 20", "declarations": [], - "spell": "3:3-3:4|16985894625255407295|2|2", + "spell": "3:3-3:4|16985894625255407295|2|514", "extent": "3:3-3:9|16985894625255407295|2|0", - "type": 16985894625255407295, + "type": 0, "uses": [], "kind": 22, "storage": 0 @@ -117,22 +129,22 @@ OUTPUT: "short_name": "E0", "hover": "E::E0 = 0", "declarations": [], - "spell": "9:3-9:5|2986879766914123941|2|2", + "spell": "9:3-9:5|2986879766914123941|2|514", "extent": "9:3-9:5|2986879766914123941|2|0", - "type": 2986879766914123941, + "type": 0, "uses": [], "kind": 22, "storage": 0 }, { "usr": 16847439761518576294, - "detailed_name": "E::E20", + "detailed_name": "E::E20 = 20", "qual_name_offset": 0, "short_name": "E20", - "hover": "E::E20 = 20", + "hover": "E::E20 = 20 = 20", "declarations": [], - "spell": "10:3-10:6|2986879766914123941|2|2", + "spell": "10:3-10:6|2986879766914123941|2|514", "extent": "10:3-10:11|2986879766914123941|2|0", - "type": 2986879766914123941, + "type": 0, "uses": [], "kind": 22, "storage": 0 diff --git a/index_tests/enums/enum_usage.cc b/index_tests/enums/enum_usage.cc index 745a5a6e..b3c24b4a 100644 --- a/index_tests/enums/enum_usage.cc +++ b/index_tests/enums/enum_usage.cc @@ -9,12 +9,26 @@ Foo x = Foo::A; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], + "skipped_ranges": [], + "usr2func": [{ + "usr": 16985894625255407295, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [439339022761937396, 15962370213938840720], + "uses": [], + "callees": [] + }], "usr2type": [{ "usr": 16985894625255407295, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "enum class Foo : int {\n}", + "qual_name_offset": 11, "short_name": "Foo", "kind": 10, "declarations": [], @@ -36,10 +50,10 @@ OUTPUT: "short_name": "A", "hover": "Foo::A = 0", "declarations": [], - "spell": "2:3-2:4|16985894625255407295|2|2", + "spell": "2:3-2:4|16985894625255407295|2|514", "extent": "2:3-2:4|16985894625255407295|2|0", - "type": 16985894625255407295, - "uses": ["6:14-6:15|0|1|4"], + "type": 0, + "uses": ["6:14-6:15|16985894625255407295|2|4"], "kind": 22, "storage": 0 }, { @@ -57,14 +71,14 @@ OUTPUT: "storage": 0 }, { "usr": 15962370213938840720, - "detailed_name": "Foo::B", + "detailed_name": "Foo::B = 20", "qual_name_offset": 0, "short_name": "B", - "hover": "Foo::B = 20", + "hover": "Foo::B = 20 = 20", "declarations": [], - "spell": "3:3-3:4|16985894625255407295|2|2", + "spell": "3:3-3:4|16985894625255407295|2|514", "extent": "3:3-3:9|16985894625255407295|2|0", - "type": 16985894625255407295, + "type": 0, "uses": [], "kind": 22, "storage": 0 diff --git a/index_tests/foobar.cc b/index_tests/foobar.cc index 79f3922c..bb21a22a 100644 --- a/index_tests/foobar.cc +++ b/index_tests/foobar.cc @@ -12,12 +12,12 @@ Foo b; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [{ "usr": 6697181287623958829, - "detailed_name": "A", - "qual_name_offset": 0, + "detailed_name": "enum A {\n}", + "qual_name_offset": 5, "short_name": "A", "kind": 10, "declarations": [], @@ -33,25 +33,25 @@ OUTPUT: "uses": ["9:5-9:6|0|1|4"] }, { "usr": 10528472276654770367, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo {}", + "qual_name_offset": 7, "short_name": "Foo", - "kind": 5, + "kind": 23, "declarations": [], "spell": "5:8-5:11|0|1|2", "extent": "5:1-7:2|0|1|0", "alias_of": 0, "bases": [], "derived": [], - "types": [], + "types": [13938528237873543349], "funcs": [], "vars": [], "instances": [12028309045033782423], "uses": ["9:1-9:4|0|1|4", "10:1-10:4|0|1|4"] }, { "usr": 13892793056005362145, - "detailed_name": "B", - "qual_name_offset": 0, + "detailed_name": "enum B {\n}", + "qual_name_offset": 5, "short_name": "B", "kind": 10, "declarations": [], @@ -67,12 +67,12 @@ OUTPUT: "uses": ["10:5-10:6|0|1|4"] }, { "usr": 13938528237873543349, - "detailed_name": "Foo::Inner", - "qual_name_offset": 0, + "detailed_name": "struct Foo::Inner {}", + "qual_name_offset": 7, "short_name": "Inner", "kind": 23, "declarations": [], - "spell": "6:10-6:15|10528472276654770367|2|2", + "spell": "6:10-6:15|10528472276654770367|2|514", "extent": "6:3-6:18|10528472276654770367|2|0", "alias_of": 0, "bases": [], @@ -81,7 +81,7 @@ OUTPUT: "funcs": [], "vars": [], "instances": [16721564935990383768], - "uses": ["9:9-9:14|0|1|4"] + "uses": ["9:9-9:14|10528472276654770367|2|4"] }], "usr2var": [{ "usr": 12028309045033782423, diff --git a/index_tests/function_declaration.cc b/index_tests/function_declaration.cc index 144fee63..8c012d02 100644 --- a/index_tests/function_declaration.cc +++ b/index_tests/function_declaration.cc @@ -4,7 +4,7 @@ void foo(int a, int b); OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 2747674671862363334, "detailed_name": "void foo(int a, int b)", diff --git a/index_tests/function_declaration_definition.cc b/index_tests/function_declaration_definition.cc index e3822453..8a934cae 100644 --- a/index_tests/function_declaration_definition.cc +++ b/index_tests/function_declaration_definition.cc @@ -6,7 +6,7 @@ void foo() {} OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", @@ -16,7 +16,7 @@ OUTPUT: "storage": 0, "declarations": ["1:6-1:9|0|1|1"], "spell": "3:6-3:9|0|1|2", - "extent": "3:1-3:14|0|1|0", + "extent": "1:1-1:11|0|1|0", "declaring_type": 0, "bases": [], "derived": [], diff --git a/index_tests/function_definition.cc b/index_tests/function_definition.cc index b92b0d37..9a58dfaf 100644 --- a/index_tests/function_definition.cc +++ b/index_tests/function_definition.cc @@ -4,7 +4,7 @@ void foo() {} OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", diff --git a/index_tests/inheritance/class_inherit.cc b/index_tests/inheritance/class_inherit.cc index 52959abc..68149852 100644 --- a/index_tests/inheritance/class_inherit.cc +++ b/index_tests/inheritance/class_inherit.cc @@ -5,15 +5,15 @@ class Derived : public Parent {}; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [{ "usr": 3866412049634585509, - "detailed_name": "Parent", - "qual_name_offset": 0, + "detailed_name": "class Parent {}", + "qual_name_offset": 6, "short_name": "Parent", "kind": 5, - "declarations": ["2:24-2:30|0|1|4"], + "declarations": [], "spell": "1:7-1:13|0|1|2", "extent": "1:1-1:16|0|1|0", "alias_of": 0, @@ -23,11 +23,11 @@ OUTPUT: "funcs": [], "vars": [], "instances": [], - "uses": ["2:24-2:30|0|1|4"] + "uses": ["2:24-2:30|0|1|1028"] }, { "usr": 10963370434658308541, - "detailed_name": "Derived", - "qual_name_offset": 0, + "detailed_name": "class Derived : public Parent {}", + "qual_name_offset": 6, "short_name": "Derived", "kind": 5, "declarations": [], diff --git a/index_tests/inheritance/class_inherit_templated_parent.cc b/index_tests/inheritance/class_inherit_templated_parent.cc index da6331e6..1c9f1b9c 100644 --- a/index_tests/inheritance/class_inherit_templated_parent.cc +++ b/index_tests/inheritance/class_inherit_templated_parent.cc @@ -16,30 +16,15 @@ class Derived : Base1<3>, Base2, Derived1<4>, Derived2 {}; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [{ - "usr": 9, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], - "alias_of": 0, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [12990052348105569112], - "uses": [] - }, { "usr": 5863733211528032190, - "detailed_name": "Derived1", - "qual_name_offset": 0, + "detailed_name": "class Derived1 : Base1 {}", + "qual_name_offset": 6, "short_name": "Derived1", "kind": 5, - "declarations": ["13:43-13:51|0|1|4"], + "declarations": [], "spell": "8:7-8:15|0|1|2", "extent": "8:1-8:29|0|1|0", "alias_of": 0, @@ -49,31 +34,14 @@ OUTPUT: "funcs": [], "vars": [], "instances": [], - "uses": ["13:43-13:51|0|1|4"] - }, { - "usr": 7916588271848318236, - "detailed_name": "T", - "qual_name_offset": 0, - "short_name": "T", - "kind": 26, - "declarations": [], - "spell": "10:19-10:20|0|1|2", - "extent": "10:10-10:20|0|1|0", - "alias_of": 0, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["11:24-11:25|0|1|4"] + "uses": ["13:43-13:51|0|1|1028"] }, { "usr": 10651399730831737929, - "detailed_name": "Derived2", - "qual_name_offset": 0, + "detailed_name": "class Derived2 : Base2 {}", + "qual_name_offset": 6, "short_name": "Derived2", "kind": 5, - "declarations": ["13:56-13:64|0|1|4"], + "declarations": [], "spell": "11:7-11:15|0|1|2", "extent": "11:1-11:29|0|1|0", "alias_of": 0, @@ -83,14 +51,14 @@ OUTPUT: "funcs": [], "vars": [], "instances": [], - "uses": ["13:56-13:64|0|1|4"] + "uses": ["13:56-13:64|0|1|1028"] }, { "usr": 10963370434658308541, - "detailed_name": "Derived", - "qual_name_offset": 0, + "detailed_name": "class Derived : Base1<3>, Base2, Derived1<4>, Derived2 {}", + "qual_name_offset": 6, "short_name": "Derived", "kind": 5, - "declarations": ["13:33-13:40|0|1|4", "13:65-13:72|0|1|4"], + "declarations": [], "spell": "13:7-13:14|0|1|2", "extent": "13:1-13:76|0|1|0", "alias_of": 0, @@ -100,14 +68,14 @@ OUTPUT: "funcs": [], "vars": [], "instances": [], - "uses": ["13:33-13:40|0|1|4", "13:65-13:72|0|1|4"] + "uses": ["13:33-13:40|0|1|1028", "13:65-13:72|0|1|1028"] }, { "usr": 11118288764693061434, - "detailed_name": "Base2", - "qual_name_offset": 0, + "detailed_name": "class Base2 {}", + "qual_name_offset": 6, "short_name": "Base2", "kind": 5, - "declarations": ["11:18-11:23|0|1|4", "13:27-13:32|0|1|4"], + "declarations": [], "spell": "5:7-5:12|0|1|2", "extent": "5:1-5:15|0|1|0", "alias_of": 0, @@ -117,14 +85,14 @@ OUTPUT: "funcs": [], "vars": [], "instances": [], - "uses": ["11:18-11:23|0|1|4", "13:27-13:32|0|1|4"] + "uses": ["11:18-11:23|0|1|1028", "13:27-13:32|0|1|1028"] }, { "usr": 11930058224338108382, - "detailed_name": "Base1", - "qual_name_offset": 0, + "detailed_name": "class Base1 {}", + "qual_name_offset": 6, "short_name": "Base1", "kind": 5, - "declarations": ["8:18-8:23|0|1|4", "13:17-13:22|0|1|4"], + "declarations": [], "spell": "2:7-2:12|0|1|2", "extent": "2:1-2:15|0|1|0", "alias_of": 0, @@ -134,20 +102,8 @@ OUTPUT: "funcs": [], "vars": [], "instances": [], - "uses": ["8:18-8:23|0|1|4", "13:17-13:22|0|1|4"] + "uses": ["8:18-8:23|0|1|1028", "13:17-13:22|0|1|1028"] }], - "usr2var": [{ - "usr": 12990052348105569112, - "detailed_name": "unsigned int T", - "qual_name_offset": 13, - "short_name": "", - "declarations": [], - "spell": "7:23-7:24|0|1|2", - "extent": "7:10-7:24|0|1|0", - "type": 9, - "uses": ["8:24-8:25|0|1|4"], - "kind": 26, - "storage": 0 - }] + "usr2var": [] } */ diff --git a/index_tests/inheritance/class_multiple_inherit.cc b/index_tests/inheritance/class_multiple_inherit.cc index 84338ad6..37742632 100644 --- a/index_tests/inheritance/class_multiple_inherit.cc +++ b/index_tests/inheritance/class_multiple_inherit.cc @@ -7,15 +7,15 @@ class Derived : public MiddleA, public MiddleB {}; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [{ "usr": 3897841498936210886, - "detailed_name": "Root", - "qual_name_offset": 0, + "detailed_name": "class Root {}", + "qual_name_offset": 6, "short_name": "Root", "kind": 5, - "declarations": ["2:24-2:28|0|1|4", "3:24-3:28|0|1|4"], + "declarations": [], "spell": "1:7-1:11|0|1|2", "extent": "1:1-1:14|0|1|0", "alias_of": 0, @@ -25,11 +25,11 @@ OUTPUT: "funcs": [], "vars": [], "instances": [], - "uses": ["2:24-2:28|0|1|4", "3:24-3:28|0|1|4"] + "uses": ["2:24-2:28|0|1|1028", "3:24-3:28|0|1|1028"] }, { "usr": 10963370434658308541, - "detailed_name": "Derived", - "qual_name_offset": 0, + "detailed_name": "class Derived : public MiddleA, public MiddleB {}", + "qual_name_offset": 6, "short_name": "Derived", "kind": 5, "declarations": [], @@ -45,11 +45,11 @@ OUTPUT: "uses": [] }, { "usr": 11863524815063131483, - "detailed_name": "MiddleA", - "qual_name_offset": 0, + "detailed_name": "class MiddleA : public Root {}", + "qual_name_offset": 6, "short_name": "MiddleA", "kind": 5, - "declarations": ["4:24-4:31|0|1|4"], + "declarations": [], "spell": "2:7-2:14|0|1|2", "extent": "2:1-2:31|0|1|0", "alias_of": 0, @@ -59,14 +59,14 @@ OUTPUT: "funcs": [], "vars": [], "instances": [], - "uses": ["4:24-4:31|0|1|4"] + "uses": ["4:24-4:31|0|1|1028"] }, { "usr": 14022569716337624303, - "detailed_name": "MiddleB", - "qual_name_offset": 0, + "detailed_name": "class MiddleB : public Root {}", + "qual_name_offset": 6, "short_name": "MiddleB", "kind": 5, - "declarations": ["4:40-4:47|0|1|4"], + "declarations": [], "spell": "3:7-3:14|0|1|2", "extent": "3:1-3:31|0|1|0", "alias_of": 0, @@ -76,7 +76,7 @@ OUTPUT: "funcs": [], "vars": [], "instances": [], - "uses": ["4:40-4:47|0|1|4"] + "uses": ["4:40-4:47|0|1|1028"] }], "usr2var": [] } diff --git a/index_tests/inheritance/function_override.cc b/index_tests/inheritance/function_override.cc index 34da20a6..446e0816 100644 --- a/index_tests/inheritance/function_override.cc +++ b/index_tests/inheritance/function_override.cc @@ -9,18 +9,18 @@ class Derived : public Root { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 6666242542855173890, - "detailed_name": "void Derived::foo() override", + "detailed_name": "void Derived::foo()", "qual_name_offset": 5, "short_name": "foo", "kind": 6, "storage": 0, "declarations": [], - "spell": "5:8-5:11|10963370434658308541|2|2", + "spell": "5:8-5:11|10963370434658308541|2|2626", "extent": "5:3-5:25|10963370434658308541|2|0", - "declaring_type": 10963370434658308541, + "declaring_type": 0, "bases": [9948027785633571339], "derived": [], "vars": [], @@ -33,8 +33,8 @@ OUTPUT: "short_name": "foo", "kind": 6, "storage": 0, - "declarations": ["2:16-2:19|3897841498936210886|2|1"], - "declaring_type": 3897841498936210886, + "declarations": ["2:16-2:19|3897841498936210886|2|577"], + "declaring_type": 0, "bases": [], "derived": [6666242542855173890], "vars": [], @@ -43,11 +43,11 @@ OUTPUT: }], "usr2type": [{ "usr": 3897841498936210886, - "detailed_name": "Root", - "qual_name_offset": 0, + "detailed_name": "class Root {}", + "qual_name_offset": 6, "short_name": "Root", "kind": 5, - "declarations": ["4:24-4:28|0|1|4"], + "declarations": [], "spell": "1:7-1:11|0|1|2", "extent": "1:1-3:2|0|1|0", "alias_of": 0, @@ -57,11 +57,11 @@ OUTPUT: "funcs": [9948027785633571339], "vars": [], "instances": [], - "uses": ["4:24-4:28|0|1|4"] + "uses": ["4:24-4:28|0|1|1028"] }, { "usr": 10963370434658308541, - "detailed_name": "Derived", - "qual_name_offset": 0, + "detailed_name": "class Derived : public Root {}", + "qual_name_offset": 6, "short_name": "Derived", "kind": 5, "declarations": [], diff --git a/index_tests/inheritance/interface_pure_virtual.cc b/index_tests/inheritance/interface_pure_virtual.cc index 0d99ad9a..2778e0af 100644 --- a/index_tests/inheritance/interface_pure_virtual.cc +++ b/index_tests/inheritance/interface_pure_virtual.cc @@ -6,7 +6,7 @@ class IFoo { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 3277829753446788562, "detailed_name": "virtual void IFoo::foo() = 0", @@ -14,10 +14,8 @@ OUTPUT: "short_name": "foo", "kind": 6, "storage": 0, - "declarations": [], - "spell": "2:16-2:19|9949214233977131946|2|2", - "extent": "2:3-2:25|9949214233977131946|2|0", - "declaring_type": 9949214233977131946, + "declarations": ["2:16-2:19|9949214233977131946|2|577"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -26,8 +24,8 @@ OUTPUT: }], "usr2type": [{ "usr": 9949214233977131946, - "detailed_name": "IFoo", - "qual_name_offset": 0, + "detailed_name": "class IFoo {}", + "qual_name_offset": 6, "short_name": "IFoo", "kind": 5, "declarations": [], diff --git a/index_tests/inheritance/multiple_base_functions.cc b/index_tests/inheritance/multiple_base_functions.cc index 83fa7a9b..1d86907f 100644 --- a/index_tests/inheritance/multiple_base_functions.cc +++ b/index_tests/inheritance/multiple_base_functions.cc @@ -12,7 +12,7 @@ struct Derived : Base0, Base1 { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 8401779086123965305, "detailed_name": "virtual Base1::~Base1() noexcept", @@ -21,26 +21,26 @@ OUTPUT: "kind": 6, "storage": 0, "declarations": [], - "spell": "5:11-5:17|15826803741381445676|2|2", + "spell": "5:11-5:12|15826803741381445676|2|578", "extent": "5:3-5:23|15826803741381445676|2|0", - "declaring_type": 15826803741381445676, + "declaring_type": 0, "bases": [], - "derived": [13164726294460837993], + "derived": [], "vars": [], "uses": [], "callees": [] }, { "usr": 13164726294460837993, - "detailed_name": "Derived::~Derived() noexcept override", + "detailed_name": "Derived::~Derived() noexcept", "qual_name_offset": 0, "short_name": "~Derived", "kind": 6, "storage": 0, "declarations": [], - "spell": "8:3-8:11|10963370434658308541|2|2", + "spell": "8:3-8:4|10963370434658308541|2|2626", "extent": "8:3-8:26|10963370434658308541|2|0", - "declaring_type": 10963370434658308541, - "bases": [16347272523198263017, 8401779086123965305], + "declaring_type": 0, + "bases": [], "derived": [], "vars": [], "uses": [], @@ -53,22 +53,22 @@ OUTPUT: "kind": 6, "storage": 0, "declarations": [], - "spell": "2:11-2:17|11628904180681204356|2|2", + "spell": "2:11-2:12|11628904180681204356|2|578", "extent": "2:3-2:23|11628904180681204356|2|0", - "declaring_type": 11628904180681204356, + "declaring_type": 0, "bases": [], - "derived": [13164726294460837993], + "derived": [], "vars": [], "uses": [], "callees": [] }], "usr2type": [{ "usr": 10963370434658308541, - "detailed_name": "Derived", - "qual_name_offset": 0, + "detailed_name": "struct Derived : Base0, Base1 {}", + "qual_name_offset": 7, "short_name": "Derived", "kind": 23, - "declarations": ["8:4-8:11|0|1|4"], + "declarations": [], "spell": "7:8-7:15|0|1|2", "extent": "7:1-9:2|0|1|0", "alias_of": 0, @@ -78,14 +78,14 @@ OUTPUT: "funcs": [13164726294460837993], "vars": [], "instances": [], - "uses": [] + "uses": ["8:4-8:11|0|1|4"] }, { "usr": 11628904180681204356, - "detailed_name": "Base0", - "qual_name_offset": 0, + "detailed_name": "struct Base0 {}", + "qual_name_offset": 7, "short_name": "Base0", "kind": 23, - "declarations": ["2:12-2:17|0|1|4", "7:18-7:23|0|1|4"], + "declarations": [], "spell": "1:8-1:13|0|1|2", "extent": "1:1-3:2|0|1|0", "alias_of": 0, @@ -95,14 +95,14 @@ OUTPUT: "funcs": [16347272523198263017], "vars": [], "instances": [], - "uses": ["7:18-7:23|0|1|4"] + "uses": ["2:12-2:17|0|1|4", "7:18-7:23|0|1|1028"] }, { "usr": 15826803741381445676, - "detailed_name": "Base1", - "qual_name_offset": 0, + "detailed_name": "struct Base1 {}", + "qual_name_offset": 7, "short_name": "Base1", "kind": 23, - "declarations": ["5:12-5:17|0|1|4", "7:25-7:30|0|1|4"], + "declarations": [], "spell": "4:8-4:13|0|1|2", "extent": "4:1-6:2|0|1|0", "alias_of": 0, @@ -112,7 +112,7 @@ OUTPUT: "funcs": [8401779086123965305], "vars": [], "instances": [], - "uses": ["7:25-7:30|0|1|4"] + "uses": ["5:12-5:17|0|1|4", "7:25-7:30|0|1|1028"] }], "usr2var": [] } diff --git a/index_tests/lambdas/lambda.cc b/index_tests/lambdas/lambda.cc index b1bdc451..d3738010 100644 --- a/index_tests/lambdas/lambda.cc +++ b/index_tests/lambdas/lambda.cc @@ -15,7 +15,7 @@ void foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", @@ -29,26 +29,26 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [12666114896600231317, 2981279427664991319], + "vars": [], "uses": [], - "callees": ["9:14-9:15|17926497908620168464|3|32", "10:14-10:15|17926497908620168464|3|32", "11:14-11:15|17926497908620168464|3|32"] + "callees": [] }, { "usr": 17926497908620168464, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, + "detailed_name": "inline void foo()::(anon class)::operator()(int y) const", + "qual_name_offset": 12, + "short_name": "operator()", + "kind": 6, "storage": 0, "declarations": [], "declaring_type": 0, "bases": [], "derived": [], "vars": [], - "uses": ["9:14-9:15|4259594751088586730|3|32", "10:14-10:15|4259594751088586730|3|32", "11:14-11:15|4259594751088586730|3|32"], + "uses": ["9:14-9:15|14635009347499519042|2|8228", "10:14-10:15|14635009347499519042|2|8228", "11:14-11:15|14635009347499519042|2|8228"], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -60,7 +60,7 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [12666114896600231317, 12879188959314906706], + "instances": [12666114896600231317], "uses": [] }, { "usr": 14635009347499519042, @@ -75,18 +75,19 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [2981279427664991319], + "instances": [], "uses": [] }], "usr2var": [{ "usr": 2981279427664991319, - "detailed_name": "lambda dosomething", - "qual_name_offset": 7, + "detailed_name": "auto dosomething", + "qual_name_offset": 5, "short_name": "dosomething", + "hover": "auto dosomething = [&x] (int y) {\n ++x;\n ++y;\n }\n", "declarations": [], "spell": "4:8-4:19|4259594751088586730|3|2", "extent": "4:3-7:4|4259594751088586730|3|0", - "type": 14635009347499519042, + "type": 0, "uses": ["9:3-9:14|4259594751088586730|3|4", "10:3-10:14|4259594751088586730|3|4", "11:3-11:14|4259594751088586730|3|4"], "kind": 13, "storage": 0 @@ -98,20 +99,18 @@ OUTPUT: "declarations": [], "spell": "2:7-2:8|4259594751088586730|3|2", "extent": "2:3-2:8|4259594751088586730|3|0", - "type": 17, - "uses": ["5:7-5:8|0|1|4", "4:24-4:25|4259594751088586730|3|4"], + "type": 53, + "uses": ["4:24-4:25|4259594751088586730|3|4", "5:7-5:8|4259594751088586730|3|28"], "kind": 13, "storage": 0 }, { "usr": 12879188959314906706, "detailed_name": "int y", "qual_name_offset": 4, - "short_name": "", + "short_name": "y", "declarations": [], - "spell": "4:31-4:32|4259594751088586730|3|2", - "extent": "4:27-4:32|4259594751088586730|3|0", - "type": 17, - "uses": ["6:7-6:8|4259594751088586730|3|4"], + "type": 0, + "uses": ["6:7-6:8|17926497908620168464|3|28"], "kind": 253, "storage": 0 }] diff --git a/index_tests/macros/complex.cc b/index_tests/macros/complex.cc index f29cfba3..f014946e 100644 --- a/index_tests/macros/complex.cc +++ b/index_tests/macros/complex.cc @@ -15,7 +15,7 @@ FOO(make1(), make2); OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 9720930732776154610, "detailed_name": "int a()", @@ -23,15 +23,15 @@ OUTPUT: "short_name": "a", "kind": 12, "storage": 0, - "declarations": ["12:1-12:20|0|1|1"], - "spell": "12:1-12:20|0|1|2", - "extent": "12:1-12:20|0|1|0", + "declarations": ["12:1-12:4|0|1|1"], + "spell": "12:1-12:4|0|1|2", + "extent": "1:1-1:1|0|1|0", "declaring_type": 0, "bases": [], "derived": [], "vars": [], - "uses": [], - "callees": ["12:5-12:10|14400399977994209582|3|32"] + "uses": ["2:7-2:8|0|1|64", "3:7-3:8|0|1|64"], + "callees": [] }, { "usr": 14400399977994209582, "detailed_name": "int make1()", @@ -46,11 +46,11 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["12:5-12:10|9720930732776154610|3|32"], + "uses": ["12:5-12:10|0|1|8228"], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -74,21 +74,21 @@ OUTPUT: "declarations": [], "spell": "9:11-9:16|0|1|2", "extent": "9:1-9:20|0|1|0", - "type": 17, - "uses": ["12:14-12:19|9720930732776154610|3|4"], + "type": 53, + "uses": ["12:14-12:19|0|1|12"], "kind": 13, "storage": 0 }, { - "usr": 4261071340275951718, + "usr": 14219599523415845943, "detailed_name": "FOO", "qual_name_offset": 0, "short_name": "FOO", - "hover": "#define FOO(aaa, bbb)\n int a();\n int a() { return aaa + bbb; }", + "hover": "#define FOO", "declarations": [], "spell": "1:9-1:12|0|1|2", - "extent": "1:9-3:32|0|1|0", + "extent": "1:9-1:12|0|1|2", "type": 0, - "uses": ["12:1-12:4|0|1|4"], + "uses": ["12:1-12:20|0|1|4"], "kind": 255, "storage": 0 }] diff --git a/index_tests/macros/foo.cc b/index_tests/macros/foo.cc index 00cb44ed..50f38b94 100644 --- a/index_tests/macros/foo.cc +++ b/index_tests/macros/foo.cc @@ -11,7 +11,7 @@ int x = A; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 13788753348312146871, "detailed_name": "Foo::Foo(Foo &&) = delete", @@ -20,9 +20,9 @@ OUTPUT: "kind": 9, "storage": 0, "declarations": [], - "spell": "5:12-5:15|15041163540773201510|2|2", - "extent": "5:12-5:16|15041163540773201510|2|0", - "declaring_type": 15041163540773201510, + "spell": "5:12-5:15|15041163540773201510|2|514", + "extent": "1:1-1:1|15041163540773201510|2|0", + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -30,7 +30,7 @@ OUTPUT: "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -46,11 +46,11 @@ OUTPUT: "uses": [] }, { "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo {}", + "qual_name_offset": 7, "short_name": "Foo", "kind": 23, - "declarations": ["5:12-5:15|0|1|4"], + "declarations": [], "spell": "4:8-4:11|0|1|2", "extent": "4:1-6:2|0|1|0", "alias_of": 0, @@ -60,44 +60,44 @@ OUTPUT: "funcs": [13788753348312146871], "vars": [], "instances": [], - "uses": ["5:12-5:15|15041163540773201510|2|4"] + "uses": ["5:12-5:15|0|1|4"] }], "usr2var": [{ - "usr": 2056319845419860263, - "detailed_name": "DISALLOW", - "qual_name_offset": 0, - "short_name": "DISALLOW", - "hover": "#define DISALLOW(type) type(type&&) = delete;", - "declarations": [], - "spell": "2:9-2:17|0|1|2", - "extent": "2:9-2:46|0|1|0", - "type": 0, - "uses": ["5:3-5:11|0|1|4"], - "kind": 255, - "storage": 0 - }, { - "usr": 7651988378939587454, + "usr": 1569772797058982873, "detailed_name": "A", "qual_name_offset": 0, "short_name": "A", - "hover": "#define A 5", + "hover": "#define A", "declarations": [], "spell": "1:9-1:10|0|1|2", - "extent": "1:9-1:12|0|1|0", + "extent": "1:9-1:10|0|1|2", "type": 0, "uses": ["8:9-8:10|0|1|4"], "kind": 255, "storage": 0 + }, { + "usr": 4904139678698066671, + "detailed_name": "DISALLOW", + "qual_name_offset": 0, + "short_name": "DISALLOW", + "hover": "#define DISALLOW", + "declarations": [], + "spell": "2:9-2:17|0|1|2", + "extent": "2:9-2:17|0|1|2", + "type": 0, + "uses": ["5:3-5:16|0|1|4"], + "kind": 255, + "storage": 0 }, { "usr": 10677751717622394455, "detailed_name": "int x", "qual_name_offset": 4, "short_name": "x", - "hover": "int x = A", + "hover": "int x = 5", "declarations": [], "spell": "8:5-8:6|0|1|2", - "extent": "8:1-8:10|0|1|0", - "type": 17, + "extent": "8:1-1:1|0|1|0", + "type": 53, "uses": [], "kind": 13, "storage": 0 diff --git a/index_tests/method_declaration.cc b/index_tests/method_declaration.cc index 3eaf1f73..c423ccdf 100644 --- a/index_tests/method_declaration.cc +++ b/index_tests/method_declaration.cc @@ -10,7 +10,7 @@ class Foo { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 17922201480358737771, "detailed_name": "void Foo::foo()", @@ -18,8 +18,8 @@ OUTPUT: "short_name": "foo", "kind": 6, "storage": 0, - "declarations": ["2:8-2:11|15041163540773201510|2|1"], - "declaring_type": 15041163540773201510, + "declarations": ["2:8-2:11|15041163540773201510|2|513"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -28,8 +28,8 @@ OUTPUT: }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], diff --git a/index_tests/method_definition.cc b/index_tests/method_definition.cc index e9d2c040..28caf615 100644 --- a/index_tests/method_definition.cc +++ b/index_tests/method_definition.cc @@ -8,7 +8,7 @@ void Foo::foo() const {} OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 6446764306530590711, "detailed_name": "void Foo::foo() const", @@ -16,10 +16,10 @@ OUTPUT: "short_name": "foo", "kind": 6, "storage": 0, - "declarations": ["2:8-2:11|15041163540773201510|2|1"], - "spell": "5:11-5:14|15041163540773201510|2|2", - "extent": "5:1-5:25|0|1|0", - "declaring_type": 15041163540773201510, + "declarations": ["2:8-2:11|15041163540773201510|2|513"], + "spell": "5:11-5:14|15041163540773201510|2|514", + "extent": "2:3-2:19|15041163540773201510|2|0", + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -28,8 +28,8 @@ OUTPUT: }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], diff --git a/index_tests/method_inline_declaration.cc b/index_tests/method_inline_declaration.cc index 08391d63..e676130f 100644 --- a/index_tests/method_inline_declaration.cc +++ b/index_tests/method_inline_declaration.cc @@ -6,7 +6,7 @@ class Foo { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 17922201480358737771, "detailed_name": "void Foo::foo()", @@ -15,9 +15,9 @@ OUTPUT: "kind": 6, "storage": 0, "declarations": [], - "spell": "2:8-2:11|15041163540773201510|2|2", + "spell": "2:8-2:11|15041163540773201510|2|514", "extent": "2:3-2:16|15041163540773201510|2|0", - "declaring_type": 15041163540773201510, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -26,8 +26,8 @@ OUTPUT: }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], diff --git a/index_tests/multi_file/funky_enum.cc b/index_tests/multi_file/funky_enum.cc index 0787f9db..ea291468 100644 --- a/index_tests/multi_file/funky_enum.cc +++ b/index_tests/multi_file/funky_enum.cc @@ -9,13 +9,27 @@ enum Foo { OUTPUT: funky_enum.h { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], + "skipped_ranges": [], + "usr2func": [{ + "usr": 16985894625255407295, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [439339022761937396, 15962370213938840720, 8524995777615948802], + "uses": [], + "callees": [] + }], "usr2type": [{ "usr": 16985894625255407295, - "detailed_name": "Foo", + "detailed_name": "", "qual_name_offset": 0, - "short_name": "Foo", + "short_name": "", "kind": 0, "declarations": [], "alias_of": 0, @@ -29,40 +43,43 @@ OUTPUT: funky_enum.h }], "usr2var": [{ "usr": 439339022761937396, - "detailed_name": "Foo::A", + "detailed_name": "A", "qual_name_offset": 0, "short_name": "A", - "hover": "Foo::A = 0", + "hover": "A = 0", + "comments": "This file cannot be built directory. It is included in an enum definition of\nanother file.", "declarations": [], - "spell": "4:1-4:2|16985894625255407295|2|2", + "spell": "4:1-4:2|16985894625255407295|2|514", "extent": "4:1-4:2|16985894625255407295|2|0", - "type": 16985894625255407295, + "type": 0, "uses": [], "kind": 22, "storage": 0 }, { "usr": 8524995777615948802, - "detailed_name": "Foo::C", + "detailed_name": "C", "qual_name_offset": 0, "short_name": "C", - "hover": "Foo::C = 2", + "hover": "C = 2", + "comments": "This file cannot be built directory. It is included in an enum definition of\nanother file.", "declarations": [], - "spell": "6:1-6:2|16985894625255407295|2|2", + "spell": "6:1-6:2|16985894625255407295|2|514", "extent": "6:1-6:2|16985894625255407295|2|0", - "type": 16985894625255407295, + "type": 0, "uses": [], "kind": 22, "storage": 0 }, { "usr": 15962370213938840720, - "detailed_name": "Foo::B", + "detailed_name": "B", "qual_name_offset": 0, "short_name": "B", - "hover": "Foo::B = 1", + "hover": "B = 1", + "comments": "This file cannot be built directory. It is included in an enum definition of\nanother file.", "declarations": [], - "spell": "5:1-5:2|16985894625255407295|2|2", + "spell": "5:1-5:2|16985894625255407295|2|514", "extent": "5:1-5:2|16985894625255407295|2|0", - "type": 16985894625255407295, + "type": 0, "uses": [], "kind": 22, "storage": 0 @@ -70,16 +87,13 @@ OUTPUT: funky_enum.h } OUTPUT: funky_enum.cc { - "includes": [{ - "line": 1, - "resolved_path": "&funky_enum.h" - }], - "skipped_by_preprocessor": [], + "includes": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [{ "usr": 16985894625255407295, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "enum Foo {\n}", + "qual_name_offset": 5, "short_name": "Foo", "kind": 10, "declarations": [], diff --git a/index_tests/multi_file/impl.cc b/index_tests/multi_file/impl.cc index 1a52c2de..a978e97e 100644 --- a/index_tests/multi_file/impl.cc +++ b/index_tests/multi_file/impl.cc @@ -8,8 +8,22 @@ void Impl() { OUTPUT: header.h { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ + "usr": 4481210672785600703, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [6141718166919284735, 17716334512218775320, 7285646116511901840], + "uses": [], + "callees": [] + }, { "usr": 11650481237659640387, "detailed_name": "void Foo1()", "qual_name_offset": 5, @@ -27,7 +41,7 @@ OUTPUT: header.h "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -43,10 +57,10 @@ OUTPUT: header.h "uses": [] }, { "usr": 529393482671181129, - "detailed_name": "Foo2", - "qual_name_offset": 0, + "detailed_name": "struct Foo2 {}", + "qual_name_offset": 7, "short_name": "Foo2", - "kind": 5, + "kind": 23, "declarations": [], "spell": "13:8-13:12|0|1|2", "extent": "13:1-13:15|0|1|0", @@ -60,11 +74,10 @@ OUTPUT: header.h "uses": [] }, { "usr": 619345544228965342, - "detailed_name": "Foo0", - "qual_name_offset": 0, + "detailed_name": "using Foo0 = SameFileDerived", + "qual_name_offset": 6, "short_name": "Foo0", "kind": 252, - "hover": "using Foo0 = SameFileDerived", "declarations": [], "spell": "7:7-7:11|0|1|2", "extent": "7:1-7:29|0|1|0", @@ -75,11 +88,11 @@ OUTPUT: header.h "funcs": [], "vars": [], "instances": [], - "uses": ["7:7-7:11|0|1|4"] + "uses": [] }, { "usr": 4481210672785600703, - "detailed_name": "Foo3", - "qual_name_offset": 0, + "detailed_name": "enum Foo3 {\n}", + "qual_name_offset": 5, "short_name": "Foo3", "kind": 10, "declarations": [], @@ -95,11 +108,11 @@ OUTPUT: header.h "uses": [] }, { "usr": 8420119006782424779, - "detailed_name": "Base", - "qual_name_offset": 0, + "detailed_name": "struct Base {}", + "qual_name_offset": 7, "short_name": "Base", "kind": 23, - "declarations": ["5:26-5:30|0|1|4"], + "declarations": [], "spell": "3:8-3:12|0|1|2", "extent": "3:1-3:15|0|1|0", "alias_of": 0, @@ -109,11 +122,11 @@ OUTPUT: header.h "funcs": [], "vars": [], "instances": [], - "uses": ["5:26-5:30|0|1|4"] + "uses": ["5:26-5:30|0|1|1028"] }, { "usr": 16750616846959666305, - "detailed_name": "SameFileDerived", - "qual_name_offset": 0, + "detailed_name": "struct SameFileDerived : Base {}", + "qual_name_offset": 7, "short_name": "SameFileDerived", "kind": 23, "declarations": [], @@ -136,58 +149,58 @@ OUTPUT: header.h "declarations": [], "spell": "17:5-17:9|0|1|2", "extent": "17:1-17:9|0|1|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 }, { "usr": 6141718166919284735, - "detailed_name": "Foo3::A", + "detailed_name": "A", "qual_name_offset": 0, "short_name": "A", - "hover": "Foo3::A = 0", + "hover": "A = 0", "declarations": [], - "spell": "15:13-15:14|4481210672785600703|2|2", + "spell": "15:13-15:14|4481210672785600703|2|514", "extent": "15:13-15:14|4481210672785600703|2|0", - "type": 4481210672785600703, + "type": 0, "uses": [], "kind": 22, "storage": 0 }, { "usr": 7285646116511901840, - "detailed_name": "Foo3::C", + "detailed_name": "C", "qual_name_offset": 0, "short_name": "C", - "hover": "Foo3::C = 2", + "hover": "C = 2", "declarations": [], - "spell": "15:19-15:20|4481210672785600703|2|2", + "spell": "15:19-15:20|4481210672785600703|2|514", "extent": "15:19-15:20|4481210672785600703|2|0", - "type": 4481210672785600703, + "type": 0, "uses": [], "kind": 22, "storage": 0 }, { "usr": 8395885290297540138, - "detailed_name": "int Foo5", - "qual_name_offset": 4, + "detailed_name": "static int Foo5", + "qual_name_offset": 11, "short_name": "Foo5", "declarations": [], "spell": "18:12-18:16|0|1|2", "extent": "18:1-18:16|0|1|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 2 }, { "usr": 17716334512218775320, - "detailed_name": "Foo3::B", + "detailed_name": "B", "qual_name_offset": 0, "short_name": "B", - "hover": "Foo3::B = 1", + "hover": "B = 1", "declarations": [], - "spell": "15:16-15:17|4481210672785600703|2|2", + "spell": "15:16-15:17|4481210672785600703|2|514", "extent": "15:16-15:17|4481210672785600703|2|0", - "type": 4481210672785600703, + "type": 0, "uses": [], "kind": 22, "storage": 0 @@ -195,11 +208,8 @@ OUTPUT: header.h } OUTPUT: impl.cc { - "includes": [{ - "line": 0, - "resolved_path": "&header.h" - }], - "skipped_by_preprocessor": [], + "includes": [], + "skipped_ranges": [], "usr2func": [{ "usr": 5817708529036841195, "detailed_name": "void Impl()", @@ -215,20 +225,20 @@ OUTPUT: impl.cc "derived": [], "vars": [], "uses": [], - "callees": ["4:3-4:7|11650481237659640387|3|32"] + "callees": [] }, { "usr": 11650481237659640387, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, + "detailed_name": "void Foo1()", + "qual_name_offset": 5, + "short_name": "Foo1", + "kind": 12, "storage": 0, "declarations": [], "declaring_type": 0, "bases": [], "derived": [], "vars": [], - "uses": ["4:3-4:7|5817708529036841195|3|32"], + "uses": ["4:3-4:7|0|1|8228"], "callees": [] }], "usr2type": [], diff --git a/index_tests/multi_file/simple_impl.cc b/index_tests/multi_file/simple_impl.cc index 3469d9fc..639d0f69 100644 --- a/index_tests/multi_file/simple_impl.cc +++ b/index_tests/multi_file/simple_impl.cc @@ -8,7 +8,7 @@ void impl() { OUTPUT: simple_header.h { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 16236105532929924676, "detailed_name": "void header()", @@ -29,11 +29,8 @@ OUTPUT: simple_header.h } OUTPUT: simple_impl.cc { - "includes": [{ - "line": 0, - "resolved_path": "&simple_header.h" - }], - "skipped_by_preprocessor": [], + "includes": [], + "skipped_ranges": [], "usr2func": [{ "usr": 3373269392705484958, "detailed_name": "void impl()", @@ -49,20 +46,20 @@ OUTPUT: simple_impl.cc "derived": [], "vars": [], "uses": [], - "callees": ["4:3-4:9|16236105532929924676|3|32"] + "callees": [] }, { "usr": 16236105532929924676, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, + "detailed_name": "void header()", + "qual_name_offset": 5, + "short_name": "header", + "kind": 12, "storage": 0, "declarations": [], "declaring_type": 0, "bases": [], "derived": [], "vars": [], - "uses": ["4:3-4:9|3373269392705484958|3|32"], + "uses": ["4:3-4:9|0|1|8228"], "callees": [] }], "usr2type": [], diff --git a/index_tests/multi_file/static.cc b/index_tests/multi_file/static.cc index 89bae0f7..5a607e6a 100644 --- a/index_tests/multi_file/static.cc +++ b/index_tests/multi_file/static.cc @@ -6,16 +6,16 @@ void Buffer::CreateSharedBuffer() {} OUTPUT: static.h { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 14576076421851654759, "detailed_name": "static void Buffer::CreateSharedBuffer()", "qual_name_offset": 12, "short_name": "CreateSharedBuffer", - "kind": 254, - "storage": 2, - "declarations": ["4:15-4:33|9411323049603567600|2|1"], - "declaring_type": 9411323049603567600, + "kind": 6, + "storage": 0, + "declarations": ["4:15-4:33|9411323049603567600|2|513"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -24,8 +24,8 @@ OUTPUT: static.h }], "usr2type": [{ "usr": 9411323049603567600, - "detailed_name": "Buffer", - "qual_name_offset": 0, + "detailed_name": "struct Buffer {}", + "qual_name_offset": 7, "short_name": "Buffer", "kind": 23, "declarations": [], @@ -44,22 +44,19 @@ OUTPUT: static.h } OUTPUT: static.cc { - "includes": [{ - "line": 0, - "resolved_path": "&static.h" - }], - "skipped_by_preprocessor": [], + "includes": [], + "skipped_ranges": [], "usr2func": [{ "usr": 14576076421851654759, - "detailed_name": "void Buffer::CreateSharedBuffer()", - "qual_name_offset": 5, + "detailed_name": "static void Buffer::CreateSharedBuffer()", + "qual_name_offset": 12, "short_name": "CreateSharedBuffer", - "kind": 254, + "kind": 6, "storage": 0, "declarations": [], - "spell": "3:14-3:32|9411323049603567600|2|2", - "extent": "3:1-3:37|0|1|0", - "declaring_type": 9411323049603567600, + "spell": "3:14-3:32|9411323049603567600|2|514", + "extent": "4:3-4:35|9411323049603567600|2|0", + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -68,10 +65,10 @@ OUTPUT: static.cc }], "usr2type": [{ "usr": 9411323049603567600, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, + "detailed_name": "struct Buffer {}", + "qual_name_offset": 7, + "short_name": "Buffer", + "kind": 23, "declarations": [], "alias_of": 0, "bases": [], diff --git a/index_tests/namespaces/anonymous_function.cc b/index_tests/namespaces/anonymous_function.cc index 359691cc..c07d54ab 100644 --- a/index_tests/namespaces/anonymous_function.cc +++ b/index_tests/namespaces/anonymous_function.cc @@ -6,7 +6,7 @@ void foo(); OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 5010253035933134245, "detailed_name": "void (anon ns)::foo()", @@ -15,7 +15,7 @@ OUTPUT: "kind": 12, "storage": 0, "declarations": ["2:6-2:9|7144845543074395457|2|1"], - "declaring_type": 7144845543074395457, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], diff --git a/index_tests/namespaces/function_declaration.cc b/index_tests/namespaces/function_declaration.cc index 81038adc..4a65e65e 100644 --- a/index_tests/namespaces/function_declaration.cc +++ b/index_tests/namespaces/function_declaration.cc @@ -6,7 +6,7 @@ void foo(int a, int b); OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 18343102288837190527, "detailed_name": "void hello::foo(int a, int b)", @@ -14,8 +14,8 @@ OUTPUT: "short_name": "foo", "kind": 12, "storage": 0, - "declarations": ["2:6-2:9|2029211996748007610|2|1"], - "declaring_type": 2029211996748007610, + "declarations": ["2:6-2:9|2029211996748007610|2|513"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -24,35 +24,18 @@ OUTPUT: }], "usr2type": [{ "usr": 2029211996748007610, - "detailed_name": "hello", - "qual_name_offset": 0, + "detailed_name": "namespace hello {\n}", + "qual_name_offset": 10, "short_name": "hello", "kind": 3, - "declarations": [], - "spell": "1:11-1:16|0|1|2", - "extent": "1:1-3:2|0|1|0", + "declarations": ["1:11-1:16|0|1|1"], "alias_of": 0, - "bases": [13838176792705659279], + "bases": [], "derived": [], "types": [], "funcs": [18343102288837190527], "vars": [], "instances": [], - "uses": ["1:11-1:16|0|1|4"] - }, { - "usr": 13838176792705659279, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], - "alias_of": 0, - "bases": [], - "derived": [2029211996748007610], - "types": [], - "funcs": [], - "vars": [], - "instances": [], "uses": [] }], "usr2var": [] diff --git a/index_tests/namespaces/function_definition.cc b/index_tests/namespaces/function_definition.cc index c909296e..08bec46e 100644 --- a/index_tests/namespaces/function_definition.cc +++ b/index_tests/namespaces/function_definition.cc @@ -6,7 +6,7 @@ void foo() {} OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 243328841292951622, "detailed_name": "void hello::foo()", @@ -15,9 +15,9 @@ OUTPUT: "kind": 12, "storage": 0, "declarations": [], - "spell": "2:6-2:9|2029211996748007610|2|2", + "spell": "2:6-2:9|2029211996748007610|2|514", "extent": "2:1-2:14|2029211996748007610|2|0", - "declaring_type": 2029211996748007610, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -26,35 +26,18 @@ OUTPUT: }], "usr2type": [{ "usr": 2029211996748007610, - "detailed_name": "hello", - "qual_name_offset": 0, + "detailed_name": "namespace hello {\n}", + "qual_name_offset": 10, "short_name": "hello", "kind": 3, - "declarations": [], - "spell": "1:11-1:16|0|1|2", - "extent": "1:1-3:2|0|1|0", + "declarations": ["1:11-1:16|0|1|1"], "alias_of": 0, - "bases": [13838176792705659279], + "bases": [], "derived": [], "types": [], "funcs": [243328841292951622], "vars": [], "instances": [], - "uses": ["1:11-1:16|0|1|4"] - }, { - "usr": 13838176792705659279, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], - "alias_of": 0, - "bases": [], - "derived": [2029211996748007610], - "types": [], - "funcs": [], - "vars": [], - "instances": [], "uses": [] }], "usr2var": [] diff --git a/index_tests/namespaces/method_declaration.cc b/index_tests/namespaces/method_declaration.cc index a50505d3..4e728b30 100644 --- a/index_tests/namespaces/method_declaration.cc +++ b/index_tests/namespaces/method_declaration.cc @@ -8,7 +8,7 @@ class Foo { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 10487325150128053272, "detailed_name": "void hello::Foo::foo()", @@ -16,8 +16,8 @@ OUTPUT: "short_name": "foo", "kind": 6, "storage": 0, - "declarations": ["3:8-3:11|4508214972876735896|2|1"], - "declaring_type": 4508214972876735896, + "declarations": ["3:8-3:11|4508214972876735896|2|513"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -26,29 +26,27 @@ OUTPUT: }], "usr2type": [{ "usr": 2029211996748007610, - "detailed_name": "hello", - "qual_name_offset": 0, + "detailed_name": "namespace hello {\n}", + "qual_name_offset": 10, "short_name": "hello", "kind": 3, - "declarations": [], - "spell": "1:11-1:16|0|1|2", - "extent": "1:1-5:2|0|1|0", + "declarations": ["1:11-1:16|0|1|1"], "alias_of": 0, - "bases": [13838176792705659279], + "bases": [], "derived": [], - "types": [], + "types": [4508214972876735896], "funcs": [], "vars": [], "instances": [], - "uses": ["1:11-1:16|0|1|4"] + "uses": [] }, { "usr": 4508214972876735896, - "detailed_name": "hello::Foo", - "qual_name_offset": 0, + "detailed_name": "class hello::Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], - "spell": "2:7-2:10|2029211996748007610|2|2", + "spell": "2:7-2:10|2029211996748007610|2|514", "extent": "2:1-4:2|2029211996748007610|2|0", "alias_of": 0, "bases": [], @@ -58,21 +56,6 @@ OUTPUT: "vars": [], "instances": [], "uses": [] - }, { - "usr": 13838176792705659279, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], - "alias_of": 0, - "bases": [], - "derived": [2029211996748007610], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": [] }], "usr2var": [] } diff --git a/index_tests/namespaces/method_definition.cc b/index_tests/namespaces/method_definition.cc index 68f7f8d8..12efc78b 100644 --- a/index_tests/namespaces/method_definition.cc +++ b/index_tests/namespaces/method_definition.cc @@ -10,7 +10,7 @@ void Foo::foo() {} OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 10487325150128053272, "detailed_name": "void hello::Foo::foo()", @@ -18,10 +18,10 @@ OUTPUT: "short_name": "foo", "kind": 6, "storage": 0, - "declarations": ["3:8-3:11|4508214972876735896|2|1"], - "spell": "6:11-6:14|4508214972876735896|2|2", - "extent": "6:1-6:19|2029211996748007610|2|0", - "declaring_type": 4508214972876735896, + "declarations": ["3:8-3:11|4508214972876735896|2|513"], + "spell": "6:11-6:14|4508214972876735896|2|514", + "extent": "3:3-3:13|4508214972876735896|2|0", + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -30,29 +30,27 @@ OUTPUT: }], "usr2type": [{ "usr": 2029211996748007610, - "detailed_name": "hello", - "qual_name_offset": 0, + "detailed_name": "namespace hello {\n}", + "qual_name_offset": 10, "short_name": "hello", "kind": 3, - "declarations": [], - "spell": "1:11-1:16|0|1|2", - "extent": "1:1-7:2|0|1|0", + "declarations": ["1:11-1:16|0|1|1"], "alias_of": 0, - "bases": [13838176792705659279], + "bases": [], "derived": [], - "types": [], + "types": [4508214972876735896], "funcs": [], "vars": [], "instances": [], - "uses": ["1:11-1:16|0|1|4"] + "uses": [] }, { "usr": 4508214972876735896, - "detailed_name": "hello::Foo", - "qual_name_offset": 0, + "detailed_name": "class hello::Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], - "spell": "2:7-2:10|2029211996748007610|2|2", + "spell": "2:7-2:10|2029211996748007610|2|514", "extent": "2:1-4:2|2029211996748007610|2|0", "alias_of": 0, "bases": [], @@ -61,22 +59,7 @@ OUTPUT: "funcs": [10487325150128053272], "vars": [], "instances": [], - "uses": ["6:6-6:9|0|1|4"] - }, { - "usr": 13838176792705659279, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], - "alias_of": 0, - "bases": [], - "derived": [2029211996748007610], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": [] + "uses": ["6:6-6:9|2029211996748007610|2|4"] }], "usr2var": [] } diff --git a/index_tests/namespaces/method_inline_declaration.cc b/index_tests/namespaces/method_inline_declaration.cc index 97259490..3890719d 100644 --- a/index_tests/namespaces/method_inline_declaration.cc +++ b/index_tests/namespaces/method_inline_declaration.cc @@ -8,7 +8,7 @@ class Foo { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 10487325150128053272, "detailed_name": "void hello::Foo::foo()", @@ -17,9 +17,9 @@ OUTPUT: "kind": 6, "storage": 0, "declarations": [], - "spell": "3:8-3:11|4508214972876735896|2|2", + "spell": "3:8-3:11|4508214972876735896|2|514", "extent": "3:3-3:16|4508214972876735896|2|0", - "declaring_type": 4508214972876735896, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -28,29 +28,27 @@ OUTPUT: }], "usr2type": [{ "usr": 2029211996748007610, - "detailed_name": "hello", - "qual_name_offset": 0, + "detailed_name": "namespace hello {\n}", + "qual_name_offset": 10, "short_name": "hello", "kind": 3, - "declarations": [], - "spell": "1:11-1:16|0|1|2", - "extent": "1:1-5:2|0|1|0", + "declarations": ["1:11-1:16|0|1|1"], "alias_of": 0, - "bases": [13838176792705659279], + "bases": [], "derived": [], - "types": [], + "types": [4508214972876735896], "funcs": [], "vars": [], "instances": [], - "uses": ["1:11-1:16|0|1|4"] + "uses": [] }, { "usr": 4508214972876735896, - "detailed_name": "hello::Foo", - "qual_name_offset": 0, + "detailed_name": "class hello::Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], - "spell": "2:7-2:10|2029211996748007610|2|2", + "spell": "2:7-2:10|2029211996748007610|2|514", "extent": "2:1-4:2|2029211996748007610|2|0", "alias_of": 0, "bases": [], @@ -60,21 +58,6 @@ OUTPUT: "vars": [], "instances": [], "uses": [] - }, { - "usr": 13838176792705659279, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], - "alias_of": 0, - "bases": [], - "derived": [2029211996748007610], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": [] }], "usr2var": [] } diff --git a/index_tests/namespaces/namespace_alias.cc b/index_tests/namespaces/namespace_alias.cc index 9b768031..88f1adf3 100644 --- a/index_tests/namespaces/namespace_alias.cc +++ b/index_tests/namespaces/namespace_alias.cc @@ -17,7 +17,7 @@ void func() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 10818727483146447186, "detailed_name": "void func()", @@ -31,12 +31,26 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [6030927277961448585, 7657277353101371136], + "vars": [], + "uses": [], + "callees": [] + }, { + "usr": 14450849931009540802, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [15042442838933090518], "uses": [], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -52,90 +66,64 @@ OUTPUT: "uses": [] }, { "usr": 926793467007732869, - "detailed_name": "foo", - "qual_name_offset": 0, + "detailed_name": "namespace foo {\n}", + "qual_name_offset": 10, "short_name": "foo", "kind": 3, - "declarations": [], - "spell": "1:11-1:14|0|1|2", - "extent": "1:1-7:2|0|1|0", + "declarations": ["1:11-1:14|0|1|1"], "alias_of": 0, - "bases": [13838176792705659279], - "derived": [17805385787823406700], - "types": [], + "bases": [], + "derived": [], + "types": [17805385787823406700], "funcs": [], "vars": [], "instances": [], - "uses": ["1:11-1:14|0|1|4", "9:17-9:20|0|1|4", "12:11-12:14|10818727483146447186|3|4"] + "uses": ["9:17-9:20|0|1|4", "12:11-12:14|0|1|4"] }, { "usr": 11879713791858506216, - "detailed_name": "fbz", - "qual_name_offset": 0, + "detailed_name": "namespace fbz = foo::bar::baz", + "qual_name_offset": 10, "short_name": "fbz", - "kind": 0, - "declarations": [], - "spell": "9:11-9:14|0|1|2", - "extent": "9:1-9:30|0|1|0", - "alias_of": 0, + "kind": 252, + "declarations": ["9:11-9:14|0|1|1"], + "alias_of": 14450849931009540802, "bases": [], "derived": [], "types": [], "funcs": [], "vars": [], "instances": [], - "uses": ["13:11-13:14|10818727483146447186|3|4"] - }, { - "usr": 13838176792705659279, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], - "alias_of": 0, - "bases": [], - "derived": [926793467007732869], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": [] + "uses": ["13:11-13:14|0|1|4"] }, { "usr": 14450849931009540802, - "detailed_name": "foo::bar::baz", - "qual_name_offset": 0, + "detailed_name": "namespace foo::bar::baz {\n}", + "qual_name_offset": 10, "short_name": "baz", "kind": 3, - "declarations": [], - "spell": "3:20-3:23|17805385787823406700|2|2", - "extent": "3:10-5:11|17805385787823406700|2|0", + "declarations": ["3:20-3:23|17805385787823406700|2|513"], "alias_of": 0, - "bases": [17805385787823406700], + "bases": [], "derived": [], "types": [], "funcs": [], - "vars": [{ - "L": 15042442838933090518, - "R": -1 - }], - "instances": [], - "uses": ["3:20-3:23|17805385787823406700|2|4", "9:27-9:30|0|1|4", "12:21-12:24|10818727483146447186|3|4"] - }, { - "usr": 17805385787823406700, - "detailed_name": "foo::bar", - "qual_name_offset": 0, - "short_name": "bar", - "kind": 3, - "declarations": [], - "spell": "2:15-2:18|926793467007732869|2|2", - "extent": "2:5-6:6|926793467007732869|2|0", - "alias_of": 0, - "bases": [926793467007732869], - "derived": [14450849931009540802], - "types": [], - "funcs": [], "vars": [], "instances": [], - "uses": ["2:15-2:18|926793467007732869|2|4", "9:22-9:25|0|1|4", "12:16-12:19|10818727483146447186|3|4"] + "uses": ["9:27-9:30|17805385787823406700|2|4", "12:21-12:24|17805385787823406700|2|4"] + }, { + "usr": 17805385787823406700, + "detailed_name": "namespace foo::bar {\n}", + "qual_name_offset": 10, + "short_name": "bar", + "kind": 3, + "declarations": ["2:15-2:18|926793467007732869|2|513"], + "alias_of": 0, + "bases": [], + "derived": [], + "types": [14450849931009540802], + "funcs": [], + "vars": [], + "instances": [], + "uses": ["9:22-9:25|926793467007732869|2|4", "12:16-12:19|926793467007732869|2|4"] }], "usr2var": [{ "usr": 6030927277961448585, @@ -146,7 +134,7 @@ OUTPUT: "declarations": [], "spell": "12:7-12:8|10818727483146447186|3|2", "extent": "12:3-12:29|10818727483146447186|3|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 @@ -159,7 +147,7 @@ OUTPUT: "declarations": [], "spell": "13:7-13:8|10818727483146447186|3|2", "extent": "13:3-13:19|10818727483146447186|3|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 @@ -170,10 +158,10 @@ OUTPUT: "short_name": "qux", "hover": "int foo::bar::baz::qux = 42", "declarations": [], - "spell": "4:18-4:21|14450849931009540802|2|2", + "spell": "4:18-4:21|14450849931009540802|2|514", "extent": "4:14-4:26|14450849931009540802|2|0", - "type": 17, - "uses": ["12:26-12:29|0|1|4", "13:16-13:19|0|1|4"], + "type": 53, + "uses": ["12:26-12:29|14450849931009540802|2|12", "13:16-13:19|14450849931009540802|2|12"], "kind": 13, "storage": 0 }] diff --git a/index_tests/namespaces/namespace_reference.cc b/index_tests/namespaces/namespace_reference.cc index 3d7ad72a..c412f7c0 100644 --- a/index_tests/namespaces/namespace_reference.cc +++ b/index_tests/namespaces/namespace_reference.cc @@ -13,7 +13,7 @@ void Runner() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 631910859630953711, "detailed_name": "void Runner()", @@ -29,7 +29,21 @@ OUTPUT: "derived": [], "vars": [], "uses": [], - "callees": ["7:7-7:13|17328473273923617489|3|32", "9:3-9:9|17328473273923617489|3|32"] + "callees": [] + }, { + "usr": 11072669167287398027, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [12898699035586282159], + "uses": [], + "callees": [] }, { "usr": 17328473273923617489, "detailed_name": "void ns::Accept(int a)", @@ -38,17 +52,17 @@ OUTPUT: "kind": 12, "storage": 0, "declarations": [], - "spell": "3:8-3:14|11072669167287398027|2|2", + "spell": "3:8-3:14|11072669167287398027|2|514", "extent": "3:3-3:24|11072669167287398027|2|0", - "declaring_type": 11072669167287398027, + "declaring_type": 0, "bases": [], "derived": [], - "vars": [3649375698083002347], - "uses": ["7:7-7:13|631910859630953711|3|32", "9:3-9:9|631910859630953711|3|32"], + "vars": [], + "uses": ["7:7-7:13|11072669167287398027|2|8228", "9:3-9:9|11072669167287398027|2|8228"], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -64,39 +78,19 @@ OUTPUT: "uses": [] }, { "usr": 11072669167287398027, - "detailed_name": "ns", - "qual_name_offset": 0, + "detailed_name": "namespace ns {\n}", + "qual_name_offset": 10, "short_name": "ns", "kind": 3, - "declarations": [], - "spell": "1:11-1:13|0|1|2", - "extent": "1:1-4:2|0|1|0", + "declarations": ["1:11-1:13|0|1|1"], "alias_of": 0, - "bases": [13838176792705659279], + "bases": [], "derived": [], "types": [], "funcs": [17328473273923617489], - "vars": [{ - "L": 12898699035586282159, - "R": -1 - }], - "instances": [], - "uses": ["1:11-1:13|0|1|4", "7:3-7:5|631910859630953711|3|4", "7:14-7:16|631910859630953711|3|4", "8:19-8:21|631910859630953711|3|4"] - }, { - "usr": 13838176792705659279, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], - "alias_of": 0, - "bases": [], - "derived": [11072669167287398027], - "types": [], - "funcs": [], "vars": [], "instances": [], - "uses": [] + "uses": ["7:3-7:5|0|1|4", "7:14-7:16|0|1|4", "8:19-8:21|0|1|4"] }], "usr2var": [{ "usr": 3649375698083002347, @@ -104,9 +98,9 @@ OUTPUT: "qual_name_offset": 4, "short_name": "a", "declarations": [], - "spell": "3:19-3:20|17328473273923617489|3|2", + "spell": "3:19-3:20|17328473273923617489|3|514", "extent": "3:15-3:20|17328473273923617489|3|0", - "type": 17, + "type": 53, "uses": [], "kind": 253, "storage": 0 @@ -116,10 +110,10 @@ OUTPUT: "qual_name_offset": 4, "short_name": "Foo", "declarations": [], - "spell": "2:7-2:10|11072669167287398027|2|2", + "spell": "2:7-2:10|11072669167287398027|2|514", "extent": "2:3-2:10|11072669167287398027|2|0", - "type": 17, - "uses": ["7:18-7:21|631910859630953711|3|4", "9:10-9:13|631910859630953711|3|4"], + "type": 53, + "uses": ["7:18-7:21|11072669167287398027|2|12", "9:10-9:13|11072669167287398027|2|12"], "kind": 13, "storage": 0 }] diff --git a/index_tests/operators/operator.cc b/index_tests/operators/operator.cc index a50ec055..2463ce43 100644 --- a/index_tests/operators/operator.cc +++ b/index_tests/operators/operator.cc @@ -10,7 +10,7 @@ Foo &operator += (const Foo&, const int&); OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 3545323327609582678, "detailed_name": "void Foo::operator()(bool)", @@ -18,8 +18,8 @@ OUTPUT: "short_name": "operator()", "kind": 6, "storage": 0, - "declarations": ["3:8-3:18|15041163540773201510|2|1"], - "declaring_type": 15041163540773201510, + "declarations": ["3:8-3:16|15041163540773201510|2|513"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -32,8 +32,8 @@ OUTPUT: "short_name": "operator()", "kind": 6, "storage": 0, - "declarations": ["4:7-4:17|15041163540773201510|2|1"], - "declaring_type": 15041163540773201510, + "declarations": ["4:7-4:15|15041163540773201510|2|513"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -47,9 +47,9 @@ OUTPUT: "kind": 6, "storage": 0, "declarations": [], - "spell": "2:8-2:18|15041163540773201510|2|2", + "spell": "2:8-2:16|15041163540773201510|2|514", "extent": "2:3-2:27|15041163540773201510|2|0", - "declaring_type": 15041163540773201510, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -62,7 +62,7 @@ OUTPUT: "short_name": "operator+=", "kind": 12, "storage": 0, - "declarations": ["7:6-7:17|0|1|1"], + "declarations": ["7:6-7:14|0|1|1"], "declaring_type": 0, "bases": [], "derived": [], @@ -72,8 +72,8 @@ OUTPUT: }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], diff --git a/index_tests/outline/static_function_in_type.cc b/index_tests/outline/static_function_in_type.cc index 6bff6f6e..f17ccd16 100644 --- a/index_tests/outline/static_function_in_type.cc +++ b/index_tests/outline/static_function_in_type.cc @@ -10,16 +10,16 @@ void Foo::Register(Manager* m) { OUTPUT: static_function_in_type.h { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 17019747379608639279, "detailed_name": "static void ns::Foo::Register(ns::Manager *)", "qual_name_offset": 12, "short_name": "Register", - "kind": 254, - "storage": 2, - "declarations": ["6:15-6:23|17262466801709381811|2|1"], - "declaring_type": 17262466801709381811, + "kind": 6, + "storage": 0, + "declarations": ["6:15-6:23|17262466801709381811|2|513"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -28,11 +28,11 @@ OUTPUT: static_function_in_type.h }], "usr2type": [{ "usr": 1972401196751872203, - "detailed_name": "ns::Manager", - "qual_name_offset": 0, + "detailed_name": "class ns::Manager", + "qual_name_offset": 6, "short_name": "Manager", "kind": 5, - "declarations": ["3:7-3:14|11072669167287398027|2|1"], + "declarations": ["3:7-3:14|11072669167287398027|2|513"], "alias_of": 0, "bases": [], "derived": [], @@ -40,47 +40,30 @@ OUTPUT: static_function_in_type.h "funcs": [], "vars": [], "instances": [], - "uses": ["6:24-6:31|0|1|4"] + "uses": ["6:24-6:31|11072669167287398027|2|4"] }, { "usr": 11072669167287398027, - "detailed_name": "ns", - "qual_name_offset": 0, + "detailed_name": "namespace ns {\n}", + "qual_name_offset": 10, "short_name": "ns", "kind": 3, - "declarations": [], - "spell": "1:11-1:13|0|1|2", - "extent": "1:1-9:2|0|1|0", - "alias_of": 0, - "bases": [13838176792705659279], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["1:11-1:13|0|1|4"] - }, { - "usr": 13838176792705659279, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], + "declarations": ["1:11-1:13|0|1|1"], "alias_of": 0, "bases": [], - "derived": [11072669167287398027], - "types": [], + "derived": [], + "types": [1972401196751872203, 17262466801709381811], "funcs": [], "vars": [], "instances": [], "uses": [] }, { "usr": 17262466801709381811, - "detailed_name": "ns::Foo", - "qual_name_offset": 0, + "detailed_name": "struct ns::Foo {}", + "qual_name_offset": 7, "short_name": "Foo", "kind": 23, "declarations": [], - "spell": "5:8-5:11|11072669167287398027|2|2", + "spell": "5:8-5:11|11072669167287398027|2|514", "extent": "5:1-7:2|11072669167287398027|2|0", "alias_of": 0, "bases": [], @@ -95,34 +78,31 @@ OUTPUT: static_function_in_type.h } OUTPUT: static_function_in_type.cc { - "includes": [{ - "line": 0, - "resolved_path": "&static_function_in_type.h" - }], - "skipped_by_preprocessor": [], + "includes": [], + "skipped_ranges": [], "usr2func": [{ "usr": 17019747379608639279, - "detailed_name": "void ns::Foo::Register(ns::Manager *m)", - "qual_name_offset": 5, + "detailed_name": "static void ns::Foo::Register(ns::Manager *)", + "qual_name_offset": 12, "short_name": "Register", - "kind": 254, + "kind": 6, "storage": 0, "declarations": [], - "spell": "5:11-5:19|17262466801709381811|2|2", - "extent": "5:1-6:2|11072669167287398027|2|0", - "declaring_type": 17262466801709381811, + "spell": "5:11-5:19|17262466801709381811|2|514", + "extent": "6:3-6:33|17262466801709381811|2|0", + "declaring_type": 0, "bases": [], "derived": [], - "vars": [13569879755236306838], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ "usr": 1972401196751872203, - "detailed_name": "ns::Manager", - "qual_name_offset": 0, + "detailed_name": "class ns::Manager", + "qual_name_offset": 6, "short_name": "Manager", - "kind": 0, + "kind": 5, "declarations": [], "alias_of": 0, "bases": [], @@ -131,34 +111,17 @@ OUTPUT: static_function_in_type.cc "funcs": [], "vars": [], "instances": [13569879755236306838], - "uses": ["5:20-5:27|0|1|4"] + "uses": ["5:20-5:27|11072669167287398027|2|4"] }, { "usr": 11072669167287398027, - "detailed_name": "ns", - "qual_name_offset": 0, + "detailed_name": "namespace ns {\n}", + "qual_name_offset": 10, "short_name": "ns", "kind": 3, - "declarations": [], - "spell": "3:11-3:13|0|1|2", - "extent": "3:1-7:2|0|1|0", - "alias_of": 0, - "bases": [13838176792705659279], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["3:11-3:13|0|1|4"] - }, { - "usr": 13838176792705659279, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], + "declarations": ["3:11-3:13|0|1|1"], "alias_of": 0, "bases": [], - "derived": [11072669167287398027], + "derived": [], "types": [], "funcs": [], "vars": [], @@ -166,10 +129,10 @@ OUTPUT: static_function_in_type.cc "uses": [] }, { "usr": 17262466801709381811, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, + "detailed_name": "struct ns::Foo {}", + "qual_name_offset": 7, + "short_name": "Foo", + "kind": 23, "declarations": [], "alias_of": 0, "bases": [], @@ -178,7 +141,7 @@ OUTPUT: static_function_in_type.cc "funcs": [17019747379608639279], "vars": [], "instances": [], - "uses": ["5:6-5:9|0|1|4"] + "uses": ["5:6-5:9|11072669167287398027|2|4"] }], "usr2var": [{ "usr": 13569879755236306838, @@ -186,7 +149,7 @@ OUTPUT: static_function_in_type.cc "qual_name_offset": 13, "short_name": "m", "declarations": [], - "spell": "5:29-5:30|17019747379608639279|3|2", + "spell": "5:29-5:30|17019747379608639279|3|514", "extent": "5:20-5:30|17019747379608639279|3|0", "type": 1972401196751872203, "uses": [], diff --git a/index_tests/preprocessor/include_guard.cc b/index_tests/preprocessor/include_guard.cc index 5a123d89..9a2edd7d 100644 --- a/index_tests/preprocessor/include_guard.cc +++ b/index_tests/preprocessor/include_guard.cc @@ -7,18 +7,18 @@ OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [], "usr2var": [{ - "usr": 11674328179498211370, + "usr": 14219599523415845943, "detailed_name": "FOO", "qual_name_offset": 0, "short_name": "FOO", "hover": "#define FOO", "declarations": [], "spell": "2:9-2:12|0|1|2", - "extent": "2:9-2:12|0|1|0", + "extent": "2:9-2:12|0|1|2", "type": 0, "uses": [], "kind": 255, diff --git a/index_tests/preprocessor/skipped.cc b/index_tests/preprocessor/skipped.cc index c4345e17..74577e1f 100644 --- a/index_tests/preprocessor/skipped.cc +++ b/index_tests/preprocessor/skipped.cc @@ -17,7 +17,7 @@ void hello(); OUTPUT: { "includes": [], - "skipped_by_preprocessor": ["2:1-4:7", "6:1-10:7", "12:1-14:7"], + "skipped_ranges": ["2:1-5:1", "6:1-11:1", "12:1-15:1"], "usr2func": [], "usr2type": [], "usr2var": [] diff --git a/index_tests/templates/func_specialized_template_param.cc b/index_tests/templates/func_specialized_template_param.cc index ce0a4953..ab8af6b3 100644 --- a/index_tests/templates/func_specialized_template_param.cc +++ b/index_tests/templates/func_specialized_template_param.cc @@ -11,7 +11,7 @@ void Foo::Bar(Template&) {} OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 8412238651648388423, "detailed_name": "void Foo::Bar(Template &)", @@ -19,10 +19,10 @@ OUTPUT: "short_name": "Bar", "kind": 6, "storage": 0, - "declarations": ["5:8-5:11|15041163540773201510|2|1"], - "spell": "8:11-8:14|15041163540773201510|2|2", - "extent": "8:1-8:36|0|1|0", - "declaring_type": 15041163540773201510, + "declarations": ["5:8-5:11|15041163540773201510|2|513"], + "spell": "8:11-8:14|15041163540773201510|2|514", + "extent": "5:3-5:30|15041163540773201510|2|0", + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -31,8 +31,8 @@ OUTPUT: }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo {}", + "qual_name_offset": 7, "short_name": "Foo", "kind": 23, "declarations": [], @@ -48,8 +48,8 @@ OUTPUT: "uses": ["8:6-8:9|0|1|4"] }, { "usr": 17107291254533526269, - "detailed_name": "Template", - "qual_name_offset": 0, + "detailed_name": "class Template {}", + "qual_name_offset": 6, "short_name": "Template", "kind": 5, "declarations": [], diff --git a/index_tests/templates/implicit_variable_instantiation.cc b/index_tests/templates/implicit_variable_instantiation.cc index 302086bf..7ec48af7 100644 --- a/index_tests/templates/implicit_variable_instantiation.cc +++ b/index_tests/templates/implicit_variable_instantiation.cc @@ -18,10 +18,38 @@ namespace ns { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], + "skipped_ranges": [], + "usr2func": [{ + "usr": 11072669167287398027, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [12898699035586282159, 9008550860229740818], + "uses": [], + "callees": [] + }, { + "usr": 12688716854043726585, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [4731849186641714451, 4731849186641714451], + "uses": [], + "callees": [] + }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -37,12 +65,12 @@ OUTPUT: "uses": [] }, { "usr": 1532099849728741556, - "detailed_name": "ns::VarType", - "qual_name_offset": 0, + "detailed_name": "enum ns::VarType {\n}", + "qual_name_offset": 5, "short_name": "VarType", "kind": 10, "declarations": [], - "spell": "2:8-2:15|11072669167287398027|2|2", + "spell": "2:8-2:15|11072669167287398027|2|514", "extent": "2:3-2:18|11072669167287398027|2|0", "alias_of": 0, "bases": [], @@ -50,95 +78,54 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [4731849186641714451], - "uses": ["6:22-6:29|0|1|4", "6:44-6:51|0|1|4", "10:18-10:25|0|1|4"] + "instances": [4731849186641714451, 4731849186641714451], + "uses": ["6:22-6:29|11072669167287398027|2|4", "6:44-6:51|11072669167287398027|2|4", "10:18-10:25|11072669167287398027|2|4"] }, { - "usr": 2205716167465743256, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], + "usr": 11072669167287398027, + "detailed_name": "namespace ns {\n}", + "qual_name_offset": 10, + "short_name": "ns", + "kind": 3, + "declarations": ["1:11-1:13|0|1|1"], "alias_of": 0, "bases": [], "derived": [], - "types": [], + "types": [1532099849728741556, 12688716854043726585], "funcs": [], "vars": [], "instances": [], - "uses": ["10:33-10:34|0|1|4"] - }, { - "usr": 11072669167287398027, - "detailed_name": "ns", - "qual_name_offset": 0, - "short_name": "ns", - "kind": 3, - "declarations": [], - "spell": "1:11-1:13|0|1|2", - "extent": "1:1-15:2|0|1|0", - "alias_of": 0, - "bases": [13838176792705659279], - "derived": [], - "types": [], - "funcs": [], - "vars": [{ - "L": 12898699035586282159, - "R": -1 - }, { - "L": 9008550860229740818, - "R": -1 - }], - "instances": [], - "uses": ["1:11-1:13|0|1|4"] + "uses": [] }, { "usr": 12688716854043726585, - "detailed_name": "ns::Holder", - "qual_name_offset": 0, + "detailed_name": "struct ns::Holder {}", + "qual_name_offset": 7, "short_name": "Holder", - "kind": 5, + "kind": 23, "declarations": [], - "spell": "5:10-5:16|11072669167287398027|2|2", + "spell": "5:10-5:16|11072669167287398027|2|514", "extent": "5:3-7:4|11072669167287398027|2|0", "alias_of": 0, "bases": [], "derived": [], "types": [], "funcs": [], - "vars": [{ - "L": 4731849186641714451, - "R": -1 - }], - "instances": [], - "uses": ["10:26-10:32|0|1|4", "13:13-13:19|0|1|4", "14:14-14:20|0|1|4"] - }, { - "usr": 13838176792705659279, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], - "alias_of": 0, - "bases": [], - "derived": [11072669167287398027], - "types": [], - "funcs": [], "vars": [], "instances": [], - "uses": [] + "uses": ["10:26-10:32|11072669167287398027|2|4", "13:13-13:19|11072669167287398027|2|4", "14:14-14:20|11072669167287398027|2|4"] }], "usr2var": [{ "usr": 4731849186641714451, - "detailed_name": "const ns::VarType ns::Holder::static_var", - "qual_name_offset": 18, + "detailed_name": "static constexpr ns::VarType ns::Holder::static_var", + "qual_name_offset": 29, "short_name": "static_var", - "hover": "const ns::VarType ns::Holder::static_var = (VarType)0x0", - "declarations": ["6:30-6:40|12688716854043726585|2|1"], - "spell": "10:37-10:47|12688716854043726585|2|2", - "extent": "9:3-10:47|11072669167287398027|2|0", + "hover": "static constexpr ns::VarType ns::Holder::static_var = (ns::VarType)0", + "declarations": ["6:30-6:40|12688716854043726585|2|513"], + "spell": "10:37-10:47|12688716854043726585|2|514", + "extent": "6:5-6:55|12688716854043726585|2|0", "type": 1532099849728741556, - "uses": ["13:26-13:36|0|1|4", "14:27-14:37|0|1|4"], - "kind": 8, - "storage": 0 + "uses": ["13:26-13:36|12688716854043726585|2|12", "14:27-14:37|12688716854043726585|2|12"], + "kind": 13, + "storage": 2 }, { "usr": 9008550860229740818, "detailed_name": "int ns::Foo2", @@ -146,9 +133,9 @@ OUTPUT: "short_name": "Foo2", "hover": "int ns::Foo2 = Holder::static_var", "declarations": [], - "spell": "14:7-14:11|11072669167287398027|2|2", + "spell": "14:7-14:11|11072669167287398027|2|514", "extent": "14:3-14:37|11072669167287398027|2|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 @@ -159,9 +146,9 @@ OUTPUT: "short_name": "Foo", "hover": "int ns::Foo = Holder::static_var", "declarations": [], - "spell": "13:7-13:10|11072669167287398027|2|2", + "spell": "13:7-13:10|11072669167287398027|2|514", "extent": "13:3-13:36|11072669167287398027|2|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 diff --git a/index_tests/templates/member_ref_in_template.cc b/index_tests/templates/member_ref_in_template.cc index 5e18a280..f136e253 100644 --- a/index_tests/templates/member_ref_in_template.cc +++ b/index_tests/templates/member_ref_in_template.cc @@ -24,7 +24,7 @@ EXTRA_FLAGS: OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 6875364467121018690, "detailed_name": "void foo()", @@ -41,6 +41,20 @@ OUTPUT: "vars": [], "uses": [], "callees": [] + }, { + "usr": 8402783583255987702, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [5866801090710377175], + "uses": [], + "callees": [] }, { "usr": 8905286151237717330, "detailed_name": "void C::bar()", @@ -48,8 +62,8 @@ OUTPUT: "short_name": "bar", "kind": 6, "storage": 0, - "declarations": ["4:8-4:11|8402783583255987702|2|1"], - "declaring_type": 8402783583255987702, + "declarations": ["4:8-4:11|8402783583255987702|2|513"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -58,10 +72,10 @@ OUTPUT: }], "usr2type": [{ "usr": 8402783583255987702, - "detailed_name": "C", - "qual_name_offset": 0, + "detailed_name": "struct C {}", + "qual_name_offset": 7, "short_name": "C", - "kind": 5, + "kind": 23, "declarations": [], "spell": "2:8-2:9|0|1|2", "extent": "2:1-5:2|0|1|0", @@ -76,23 +90,6 @@ OUTPUT: }], "instances": [], "uses": [] - }, { - "usr": 14750650276757822712, - "detailed_name": "T", - "qual_name_offset": 0, - "short_name": "T", - "kind": 26, - "declarations": [], - "spell": "1:17-1:18|0|1|2", - "extent": "1:11-1:18|0|1|0", - "alias_of": 0, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["3:3-3:4|0|1|4"] }], "usr2var": [{ "usr": 5866801090710377175, @@ -100,7 +97,7 @@ OUTPUT: "qual_name_offset": 2, "short_name": "x", "declarations": [], - "spell": "3:5-3:6|8402783583255987702|2|2", + "spell": "3:5-3:6|8402783583255987702|2|514", "extent": "3:3-3:6|8402783583255987702|2|0", "type": 0, "uses": [], diff --git a/index_tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc b/index_tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc index 63b81fd9..426d5be3 100644 --- a/index_tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc +++ b/index_tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc @@ -15,26 +15,40 @@ namespace ns { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 8221803074608342407, "detailed_name": "static int ns::Foo::foo()", "qual_name_offset": 11, "short_name": "foo", - "kind": 254, - "storage": 2, + "kind": 6, + "storage": 0, "declarations": [], - "spell": "5:16-5:19|14042997404480181958|2|2", + "spell": "5:16-5:19|14042997404480181958|2|514", "extent": "5:5-7:6|14042997404480181958|2|0", - "declaring_type": 14042997404480181958, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], - "uses": ["10:21-10:24|11072669167287398027|2|32", "11:22-11:25|11072669167287398027|2|32"], + "uses": ["10:21-10:24|14042997404480181958|2|36", "11:22-11:25|14042997404480181958|2|36"], + "callees": [] + }, { + "usr": 11072669167287398027, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [15768138241775955040, 3182917058194750998], + "uses": [], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -50,50 +64,27 @@ OUTPUT: "uses": [] }, { "usr": 11072669167287398027, - "detailed_name": "ns", - "qual_name_offset": 0, + "detailed_name": "namespace ns {\n}", + "qual_name_offset": 10, "short_name": "ns", "kind": 3, - "declarations": [], - "spell": "1:11-1:13|0|1|2", - "extent": "1:1-12:2|0|1|0", - "alias_of": 0, - "bases": [13838176792705659279], - "derived": [], - "types": [], - "funcs": [], - "vars": [{ - "L": 15768138241775955040, - "R": -1 - }, { - "L": 3182917058194750998, - "R": -1 - }], - "instances": [], - "uses": ["1:11-1:13|0|1|4"] - }, { - "usr": 13838176792705659279, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], + "declarations": ["1:11-1:13|0|1|1"], "alias_of": 0, "bases": [], - "derived": [11072669167287398027], - "types": [], + "derived": [], + "types": [14042997404480181958], "funcs": [], "vars": [], "instances": [], "uses": [] }, { "usr": 14042997404480181958, - "detailed_name": "ns::Foo", - "qual_name_offset": 0, + "detailed_name": "struct ns::Foo {}", + "qual_name_offset": 7, "short_name": "Foo", - "kind": 5, + "kind": 23, "declarations": [], - "spell": "3:10-3:13|11072669167287398027|2|2", + "spell": "3:10-3:13|11072669167287398027|2|514", "extent": "3:3-8:4|11072669167287398027|2|0", "alias_of": 0, "bases": [], @@ -102,7 +93,7 @@ OUTPUT: "funcs": [8221803074608342407], "vars": [], "instances": [], - "uses": ["10:11-10:14|0|1|4", "11:11-11:14|0|1|4"] + "uses": ["10:11-10:14|11072669167287398027|2|4", "11:11-11:14|11072669167287398027|2|4"] }], "usr2var": [{ "usr": 3182917058194750998, @@ -111,9 +102,9 @@ OUTPUT: "short_name": "b", "hover": "int ns::b = Foo::foo()", "declarations": [], - "spell": "11:7-11:8|11072669167287398027|2|2", + "spell": "11:7-11:8|11072669167287398027|2|514", "extent": "11:3-11:35|11072669167287398027|2|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 @@ -124,9 +115,9 @@ OUTPUT: "short_name": "a", "hover": "int ns::a = Foo::foo()", "declarations": [], - "spell": "10:7-10:8|11072669167287398027|2|2", + "spell": "10:7-10:8|11072669167287398027|2|514", "extent": "10:3-10:33|11072669167287398027|2|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 diff --git a/index_tests/templates/namespace_template_type_usage_folded_into_one.cc b/index_tests/templates/namespace_template_type_usage_folded_into_one.cc index 519372a4..fada88f9 100644 --- a/index_tests/templates/namespace_template_type_usage_folded_into_one.cc +++ b/index_tests/templates/namespace_template_type_usage_folded_into_one.cc @@ -10,54 +10,45 @@ namespace ns { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], - "usr2type": [{ + "skipped_ranges": [], + "usr2func": [{ "usr": 11072669167287398027, - "detailed_name": "ns", - "qual_name_offset": 0, - "short_name": "ns", - "kind": 3, - "declarations": [], - "spell": "1:11-1:13|0|1|2", - "extent": "1:1-7:2|0|1|0", - "alias_of": 0, - "bases": [13838176792705659279], - "derived": [], - "types": [], - "funcs": [], - "vars": [{ - "L": 15768138241775955040, - "R": -1 - }, { - "L": 3182917058194750998, - "R": -1 - }], - "instances": [], - "uses": ["1:11-1:13|0|1|4"] - }, { - "usr": 13838176792705659279, "detailed_name": "", "qual_name_offset": 0, "short_name": "", "kind": 0, + "storage": 0, "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [15768138241775955040, 3182917058194750998], + "uses": [], + "callees": [] + }], + "usr2type": [{ + "usr": 11072669167287398027, + "detailed_name": "namespace ns {\n}", + "qual_name_offset": 10, + "short_name": "ns", + "kind": 3, + "declarations": ["1:11-1:13|0|1|1"], "alias_of": 0, "bases": [], - "derived": [11072669167287398027], - "types": [], + "derived": [], + "types": [14042997404480181958], "funcs": [], "vars": [], "instances": [], "uses": [] }, { "usr": 14042997404480181958, - "detailed_name": "ns::Foo", - "qual_name_offset": 0, + "detailed_name": "class ns::Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], - "spell": "3:9-3:12|11072669167287398027|2|2", + "spell": "3:9-3:12|11072669167287398027|2|514", "extent": "3:3-3:15|11072669167287398027|2|0", "alias_of": 0, "bases": [], @@ -66,15 +57,15 @@ OUTPUT: "funcs": [], "vars": [], "instances": [15768138241775955040, 3182917058194750998], - "uses": ["5:3-5:6|0|1|4", "6:3-6:6|0|1|4"] + "uses": ["5:3-5:6|11072669167287398027|2|4", "6:3-6:6|11072669167287398027|2|4"] }], "usr2var": [{ "usr": 3182917058194750998, - "detailed_name": "Foo ns::b", - "qual_name_offset": 10, + "detailed_name": "Foo b", + "qual_name_offset": 4, "short_name": "b", "declarations": [], - "spell": "6:13-6:14|11072669167287398027|2|2", + "spell": "6:13-6:14|11072669167287398027|2|514", "extent": "6:3-6:14|11072669167287398027|2|0", "type": 14042997404480181958, "uses": [], @@ -86,7 +77,7 @@ OUTPUT: "qual_name_offset": 9, "short_name": "a", "declarations": [], - "spell": "5:12-5:13|11072669167287398027|2|2", + "spell": "5:12-5:13|11072669167287398027|2|514", "extent": "5:3-5:13|11072669167287398027|2|0", "type": 14042997404480181958, "uses": [], diff --git a/index_tests/templates/specialization.cc b/index_tests/templates/specialization.cc index 3e4d59f7..deca63d9 100644 --- a/index_tests/templates/specialization.cc +++ b/index_tests/templates/specialization.cc @@ -46,21 +46,49 @@ void foo(float Value); OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ - "usr": 6113470698424012876, - "detailed_name": "void vector >::clear()", - "qual_name_offset": 31, - "short_name": "clear", - "kind": 6, + "usr": 3861597222587452538, + "detailed_name": "template<> void foo(float Value)", + "qual_name_offset": 16, + "short_name": "foo", + "kind": 12, "storage": 0, - "declarations": ["27:8-27:13|1663022413889915338|2|1"], - "declaring_type": 1663022413889915338, + "declarations": ["43:6-43:9|0|1|1"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], "uses": [], "callees": [] + }, { + "usr": 6113470698424012876, + "detailed_name": "void vector >::clear()", + "qual_name_offset": 5, + "short_name": "clear", + "kind": 6, + "storage": 0, + "declarations": ["27:8-27:13|1663022413889915338|2|513"], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [], + "uses": [], + "callees": [] + }, { + "usr": 9201299975592934124, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [15477793821005285152, 4917621020431490070], + "uses": [], + "callees": [] }, { "usr": 17498190318698490707, "detailed_name": "void foo(T Value)", @@ -68,13 +96,13 @@ OUTPUT: "short_name": "foo", "kind": 12, "storage": 0, - "declarations": ["43:6-43:9|0|1|1"], + "declarations": [], "spell": "39:6-39:9|0|1|2", "extent": "39:1-39:21|0|1|0", "declaring_type": 0, "bases": [], "derived": [], - "vars": [17826688417349629938], + "vars": [], "uses": [], "callees": [] }, { @@ -84,8 +112,8 @@ OUTPUT: "short_name": "clear", "kind": 6, "storage": 0, - "declarations": ["13:8-13:13|7440942986741176606|2|1"], - "declaring_type": 7440942986741176606, + "declarations": ["13:8-13:13|7440942986741176606|2|513"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -93,7 +121,7 @@ OUTPUT: "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -107,27 +135,10 @@ OUTPUT: "vars": [], "instances": [13914496963221806870], "uses": [] - }, { - "usr": 218068462278884837, - "detailed_name": "function", - "qual_name_offset": 0, - "short_name": "function", - "kind": 5, - "declarations": [], - "spell": "5:7-5:15|0|1|2", - "extent": "4:1-5:30|0|1|0", - "alias_of": 0, - "bases": [15019211479263750068], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [2933643612409209903], - "uses": ["7:1-7:9|0|1|4"] }, { "usr": 1663022413889915338, - "detailed_name": "vector", - "qual_name_offset": 0, + "detailed_name": "template<> class vector> {}", + "qual_name_offset": 17, "short_name": "vector", "kind": 5, "declarations": [], @@ -139,12 +150,12 @@ OUTPUT: "types": [], "funcs": [6113470698424012876], "vars": [], - "instances": [], + "instances": [15931696253641284761], "uses": [] }, { "usr": 5760043510674081814, - "detailed_name": "Z1", - "qual_name_offset": 0, + "detailed_name": "struct Z1 {}", + "qual_name_offset": 7, "short_name": "Z1", "kind": 23, "declarations": [], @@ -158,61 +169,27 @@ OUTPUT: "vars": [], "instances": [], "uses": ["32:8-32:10|0|1|4"] - }, { - "usr": 7143192229126273961, - "detailed_name": "Args", - "qual_name_offset": 0, - "short_name": "Args", - "kind": 26, - "declarations": [], - "spell": "4:34-4:38|0|1|2", - "extent": "4:22-4:38|0|1|0", - "alias_of": 0, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["5:18-5:22|0|1|4"] }, { "usr": 7440942986741176606, - "detailed_name": "vector", - "qual_name_offset": 0, + "detailed_name": "class vector {}", + "qual_name_offset": 6, "short_name": "vector", "kind": 5, - "declarations": ["17:7-17:13|0|1|4", "26:7-26:13|0|1|4"], + "declarations": [], "spell": "12:7-12:13|0|1|2", "extent": "12:1-14:2|0|1|0", "alias_of": 0, "bases": [], - "derived": [16155717907537731864, 1663022413889915338], + "derived": [1663022413889915338], "types": [], "funcs": [18107614608385228556], "vars": [], - "instances": [5792869548777559988, 3566687051827176322, 15931696253641284761], - "uses": ["30:1-30:7|0|1|4", "31:1-31:7|0|1|4", "32:1-32:7|0|1|4", "33:1-33:7|0|1|4"] - }, { - "usr": 8880262253425334092, - "detailed_name": "T", - "qual_name_offset": 0, - "short_name": "T", - "kind": 26, - "declarations": [], - "spell": "16:19-16:20|0|1|2", - "extent": "16:10-16:20|0|1|0", - "alias_of": 0, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["17:14-17:15|0|1|4"] + "instances": [5792869548777559988, 86949563628772958, 3566687051827176322], + "uses": ["17:7-17:13|0|1|4", "26:7-26:13|0|1|4", "30:1-30:7|0|1|4", "31:1-31:7|0|1|4", "32:1-32:7|0|1|4", "33:1-33:7|0|1|4"] }, { "usr": 9201299975592934124, - "detailed_name": "Enum", - "qual_name_offset": 0, + "detailed_name": "enum Enum {\n}", + "qual_name_offset": 5, "short_name": "Enum", "kind": 10, "declarations": [], @@ -226,30 +203,13 @@ OUTPUT: "vars": [], "instances": [], "uses": [] - }, { - "usr": 9673599782548740467, - "detailed_name": "T", - "qual_name_offset": 0, - "short_name": "T", - "kind": 26, - "declarations": [], - "spell": "4:19-4:20|0|1|2", - "extent": "4:10-4:20|0|1|0", - "alias_of": 0, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["5:16-5:17|0|1|4"] }, { "usr": 10124869160135436852, - "detailed_name": "Z2", - "qual_name_offset": 0, + "detailed_name": "struct Z2 {}", + "qual_name_offset": 7, "short_name": "Z2", "kind": 23, - "declarations": ["26:14-26:16|0|1|4"], + "declarations": [], "spell": "23:8-23:10|0|1|2", "extent": "23:1-23:13|0|1|0", "alias_of": 0, @@ -259,48 +219,29 @@ OUTPUT: "funcs": [], "vars": [], "instances": [], - "uses": ["33:8-33:10|0|1|4"] - }, { - "usr": 14111105212951082474, - "detailed_name": "T", - "qual_name_offset": 0, - "short_name": "T", - "kind": 26, - "declarations": [], - "spell": "38:20-38:21|17498190318698490707|3|2", - "extent": "38:11-38:21|17498190318698490707|3|0", - "alias_of": 0, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["39:10-39:11|0|1|4"] + "uses": ["26:14-26:16|0|1|4", "33:8-33:10|0|1|4"] }, { "usr": 15019211479263750068, - "detailed_name": "function", - "qual_name_offset": 0, + "detailed_name": "class function", + "qual_name_offset": 6, "short_name": "function", "kind": 5, - "declarations": ["2:7-2:15|0|1|1", "5:7-5:15|0|1|4"], - "spell": "2:7-2:15|0|1|2", - "extent": "1:1-2:15|0|1|0", + "declarations": ["2:7-2:15|0|1|1"], "alias_of": 0, "bases": [], - "derived": [218068462278884837], + "derived": [], "types": [], "funcs": [], "vars": [], - "instances": [], - "uses": ["7:1-7:9|0|1|4"] + "instances": [2933643612409209903], + "uses": ["5:7-5:15|0|1|4", "7:1-7:9|0|1|4"] }, { "usr": 15695704394170757108, - "detailed_name": "allocator", - "qual_name_offset": 0, + "detailed_name": "class allocator", + "qual_name_offset": 6, "short_name": "allocator", "kind": 5, - "declarations": ["9:28-9:37|0|1|1", "11:39-11:48|0|1|4"], + "declarations": ["9:28-9:37|0|1|1"], "alias_of": 0, "bases": [], "derived": [], @@ -308,24 +249,7 @@ OUTPUT: "funcs": [], "vars": [], "instances": [], - "uses": [] - }, { - "usr": 16155717907537731864, - "detailed_name": "vector", - "qual_name_offset": 0, - "short_name": "vector", - "kind": 5, - "declarations": [], - "spell": "17:7-17:13|0|1|2", - "extent": "16:1-17:20|0|1|0", - "alias_of": 0, - "bases": [7440942986741176606], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [86949563628772958], - "uses": ["31:1-31:7|0|1|4"] + "uses": ["11:39-11:48|0|1|4"] }], "usr2var": [{ "usr": 86949563628772958, @@ -335,19 +259,19 @@ OUTPUT: "declarations": [], "spell": "31:14-31:17|0|1|2", "extent": "31:1-31:17|0|1|0", - "type": 16155717907537731864, + "type": 7440942986741176606, "uses": [], "kind": 13, "storage": 0 }, { "usr": 2933643612409209903, "detailed_name": "function f", - "qual_name_offset": 21, + "qual_name_offset": 0, "short_name": "f", "declarations": [], "spell": "7:21-7:22|0|1|2", "extent": "7:1-7:22|0|1|0", - "type": 218068462278884837, + "type": 15019211479263750068, "uses": [], "kind": 13, "storage": 0 @@ -365,14 +289,14 @@ OUTPUT: "storage": 0 }, { "usr": 4917621020431490070, - "detailed_name": "Enum::Enum1", + "detailed_name": "Enum1", "qual_name_offset": 0, "short_name": "Enum1", - "hover": "Enum::Enum1 = 1", + "hover": "Enum1 = 1", "declarations": [], - "spell": "36:10-36:15|9201299975592934124|2|2", + "spell": "36:10-36:15|9201299975592934124|2|514", "extent": "36:10-36:15|9201299975592934124|2|0", - "type": 9201299975592934124, + "type": 0, "uses": [], "kind": 22, "storage": 0 @@ -390,28 +314,28 @@ OUTPUT: "storage": 0 }, { "usr": 13914496963221806870, - "detailed_name": "const int kOnst", - "qual_name_offset": 10, + "detailed_name": "static const int kOnst", + "qual_name_offset": 17, "short_name": "kOnst", - "hover": "const int kOnst = 7", + "hover": "static const int kOnst = 7", "declarations": [], "spell": "41:18-41:23|0|1|2", "extent": "41:1-41:27|0|1|0", - "type": 17, - "uses": ["43:27-43:32|0|1|4"], + "type": 53, + "uses": ["43:27-43:32|0|1|12"], "kind": 13, "storage": 2 }, { "usr": 15477793821005285152, - "detailed_name": "Enum::Enum0", + "detailed_name": "Enum0", "qual_name_offset": 0, "short_name": "Enum0", - "hover": "Enum::Enum0 = 0", + "hover": "Enum0 = 0", "declarations": [], - "spell": "36:3-36:8|9201299975592934124|2|2", + "spell": "36:3-36:8|9201299975592934124|2|514", "extent": "36:3-36:8|9201299975592934124|2|0", - "type": 9201299975592934124, - "uses": ["43:20-43:25|0|1|4"], + "type": 0, + "uses": ["43:20-43:25|9201299975592934124|2|4"], "kind": 22, "storage": 0 }, { @@ -422,7 +346,7 @@ OUTPUT: "declarations": [], "spell": "33:12-33:15|0|1|2", "extent": "33:1-33:15|0|1|0", - "type": 7440942986741176606, + "type": 1663022413889915338, "uses": [], "kind": 13, "storage": 0 @@ -432,7 +356,7 @@ OUTPUT: "qual_name_offset": 2, "short_name": "Value", "declarations": [], - "spell": "39:12-39:17|17498190318698490707|3|2", + "spell": "39:12-39:17|17498190318698490707|3|514", "extent": "39:10-39:17|17498190318698490707|3|0", "type": 0, "uses": [], diff --git a/index_tests/templates/specialized_func_definition.cc b/index_tests/templates/specialized_func_definition.cc index c9eaf9fb..9e0fe0cb 100644 --- a/index_tests/templates/specialized_func_definition.cc +++ b/index_tests/templates/specialized_func_definition.cc @@ -21,18 +21,34 @@ EXTRA_FLAGS: OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ - "usr": 11994188353303124840, - "detailed_name": "template void Template::Foo()", - "qual_name_offset": 24, + "usr": 6995843774014807426, + "detailed_name": "void Template::Foo()", + "qual_name_offset": 5, "short_name": "Foo", "kind": 6, "storage": 0, - "declarations": ["3:8-3:11|17107291254533526269|2|1", "10:22-10:25|0|1|1"], - "spell": "7:19-7:22|17107291254533526269|2|2", - "extent": "6:1-7:24|0|1|0", - "declaring_type": 17107291254533526269, + "declarations": [], + "spell": "10:22-10:25|17649312483543982122|2|514", + "extent": "3:3-3:13|17649312483543982122|2|0", + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [], + "uses": [], + "callees": [] + }, { + "usr": 11994188353303124840, + "detailed_name": "void Template::Foo()", + "qual_name_offset": 5, + "short_name": "Foo", + "kind": 6, + "storage": 0, + "declarations": ["3:8-3:11|17107291254533526269|2|513"], + "spell": "7:19-7:22|17107291254533526269|2|514", + "extent": "3:3-3:13|17107291254533526269|2|0", + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -41,8 +57,8 @@ OUTPUT: }], "usr2type": [{ "usr": 17107291254533526269, - "detailed_name": "Template", - "qual_name_offset": 0, + "detailed_name": "class Template {}", + "qual_name_offset": 6, "short_name": "Template", "kind": 5, "declarations": [], @@ -56,6 +72,21 @@ OUTPUT: "vars": [], "instances": [], "uses": ["7:6-7:14|0|1|4", "10:6-10:14|0|1|4"] + }, { + "usr": 17649312483543982122, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "declarations": [], + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [6995843774014807426], + "vars": [], + "instances": [], + "uses": [] }], "usr2var": [] } diff --git a/index_tests/templates/template_class_func_usage_folded_into_one.cc b/index_tests/templates/template_class_func_usage_folded_into_one.cc index 0a109c29..ea9f0bf0 100644 --- a/index_tests/templates/template_class_func_usage_folded_into_one.cc +++ b/index_tests/templates/template_class_func_usage_folded_into_one.cc @@ -12,26 +12,26 @@ int b = Foo::foo(); OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 8340731781048851399, "detailed_name": "static int Foo::foo()", "qual_name_offset": 11, "short_name": "foo", - "kind": 254, - "storage": 2, + "kind": 6, + "storage": 0, "declarations": [], - "spell": "3:14-3:17|10528472276654770367|2|2", + "spell": "3:14-3:17|10528472276654770367|2|514", "extent": "3:3-5:4|10528472276654770367|2|0", - "declaring_type": 10528472276654770367, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], - "uses": ["8:19-8:22|0|1|32", "9:20-9:23|0|1|32"], + "uses": ["8:19-8:22|10528472276654770367|2|36", "9:20-9:23|10528472276654770367|2|36"], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -47,10 +47,10 @@ OUTPUT: "uses": [] }, { "usr": 10528472276654770367, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo {}", + "qual_name_offset": 7, "short_name": "Foo", - "kind": 5, + "kind": 23, "declarations": [], "spell": "2:8-2:11|0|1|2", "extent": "2:1-6:2|0|1|0", @@ -72,7 +72,7 @@ OUTPUT: "declarations": [], "spell": "9:5-9:6|0|1|2", "extent": "9:1-9:25|0|1|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 @@ -85,7 +85,7 @@ OUTPUT: "declarations": [], "spell": "8:5-8:6|0|1|2", "extent": "8:1-8:24|0|1|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 diff --git a/index_tests/templates/template_class_template_func_usage_folded_into_one.cc b/index_tests/templates/template_class_template_func_usage_folded_into_one.cc index 034a54ed..52533cdd 100644 --- a/index_tests/templates/template_class_template_func_usage_folded_into_one.cc +++ b/index_tests/templates/template_class_template_func_usage_folded_into_one.cc @@ -13,26 +13,26 @@ int b = Foo::foo(); OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 9034026360701857235, "detailed_name": "static int Foo::foo()", "qual_name_offset": 11, "short_name": "foo", - "kind": 254, - "storage": 2, + "kind": 6, + "storage": 0, "declarations": [], - "spell": "4:14-4:17|10528472276654770367|2|2", + "spell": "4:14-4:17|10528472276654770367|2|514", "extent": "4:3-6:4|10528472276654770367|2|0", - "declaring_type": 10528472276654770367, + "declaring_type": 0, "bases": [], "derived": [], "vars": [], - "uses": ["9:19-9:22|0|1|32", "10:20-10:23|0|1|32"], + "uses": ["9:19-9:22|10528472276654770367|2|36", "10:20-10:23|10528472276654770367|2|36"], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -48,10 +48,10 @@ OUTPUT: "uses": [] }, { "usr": 10528472276654770367, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo {}", + "qual_name_offset": 7, "short_name": "Foo", - "kind": 5, + "kind": 23, "declarations": [], "spell": "2:8-2:11|0|1|2", "extent": "2:1-7:2|0|1|0", @@ -73,7 +73,7 @@ OUTPUT: "declarations": [], "spell": "10:5-10:6|0|1|2", "extent": "10:1-10:33|0|1|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 @@ -86,7 +86,7 @@ OUTPUT: "declarations": [], "spell": "9:5-9:6|0|1|2", "extent": "9:1-9:31|0|1|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 diff --git a/index_tests/templates/template_class_type_usage_folded_into_one.cc b/index_tests/templates/template_class_type_usage_folded_into_one.cc index 15989f19..ddc6495e 100644 --- a/index_tests/templates/template_class_type_usage_folded_into_one.cc +++ b/index_tests/templates/template_class_type_usage_folded_into_one.cc @@ -31,12 +31,12 @@ VarDecl b OUTPUT: { "includes": [], - "skipped_by_preprocessor": ["12:1-28:7"], + "skipped_ranges": ["12:1-29:1"], "usr2func": [], "usr2type": [{ "usr": 6697181287623958829, - "detailed_name": "A", - "qual_name_offset": 0, + "detailed_name": "enum A {\n}", + "qual_name_offset": 5, "short_name": "A", "kind": 10, "declarations": [], @@ -52,25 +52,25 @@ OUTPUT: "uses": ["9:5-9:6|0|1|4"] }, { "usr": 10528472276654770367, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo {}", + "qual_name_offset": 7, "short_name": "Foo", - "kind": 5, + "kind": 23, "declarations": [], "spell": "5:8-5:11|0|1|2", "extent": "5:1-7:2|0|1|0", "alias_of": 0, "bases": [], "derived": [], - "types": [], + "types": [13938528237873543349], "funcs": [], "vars": [], "instances": [], "uses": ["9:1-9:4|0|1|4", "10:1-10:4|0|1|4"] }, { "usr": 13892793056005362145, - "detailed_name": "B", - "qual_name_offset": 0, + "detailed_name": "enum B {\n}", + "qual_name_offset": 5, "short_name": "B", "kind": 10, "declarations": [], @@ -86,12 +86,12 @@ OUTPUT: "uses": ["10:5-10:6|0|1|4"] }, { "usr": 13938528237873543349, - "detailed_name": "Foo::Inner", - "qual_name_offset": 0, + "detailed_name": "struct Foo::Inner {}", + "qual_name_offset": 7, "short_name": "Inner", "kind": 23, "declarations": [], - "spell": "6:10-6:15|10528472276654770367|2|2", + "spell": "6:10-6:15|10528472276654770367|2|514", "extent": "6:3-6:18|10528472276654770367|2|0", "alias_of": 0, "bases": [], @@ -100,7 +100,7 @@ OUTPUT: "funcs": [], "vars": [], "instances": [16721564935990383768, 12028309045033782423], - "uses": ["9:9-9:14|0|1|4", "10:9-10:14|0|1|4"] + "uses": ["9:9-9:14|10528472276654770367|2|4", "10:9-10:14|10528472276654770367|2|4"] }], "usr2var": [{ "usr": 12028309045033782423, diff --git a/index_tests/templates/template_class_var_usage_folded_into_one.cc b/index_tests/templates/template_class_var_usage_folded_into_one.cc index ab398ea8..e6b7b4a6 100644 --- a/index_tests/templates/template_class_var_usage_folded_into_one.cc +++ b/index_tests/templates/template_class_var_usage_folded_into_one.cc @@ -10,10 +10,24 @@ int b = Foo::var; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], + "skipped_ranges": [], + "usr2func": [{ + "usr": 10528472276654770367, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [13545144895171991916], + "uses": [], + "callees": [] + }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -29,10 +43,10 @@ OUTPUT: "uses": [] }, { "usr": 10528472276654770367, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo {}", + "qual_name_offset": 7, "short_name": "Foo", - "kind": 5, + "kind": 23, "declarations": [], "spell": "2:8-2:11|0|1|2", "extent": "2:1-4:2|0|1|0", @@ -54,20 +68,20 @@ OUTPUT: "declarations": [], "spell": "7:5-7:6|0|1|2", "extent": "7:1-7:23|0|1|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 }, { "usr": 13545144895171991916, - "detailed_name": "const int Foo::var", - "qual_name_offset": 10, + "detailed_name": "static constexpr int Foo::var", + "qual_name_offset": 21, "short_name": "var", - "hover": "const int Foo::var = 3", - "declarations": ["3:24-3:27|10528472276654770367|2|1"], - "type": 17, - "uses": ["6:19-6:22|0|1|4", "7:20-7:23|0|1|4"], - "kind": 8, + "hover": "static constexpr int Foo::var = 3", + "declarations": ["3:24-3:27|10528472276654770367|2|513"], + "type": 53, + "uses": ["6:19-6:22|10528472276654770367|2|12", "7:20-7:23|10528472276654770367|2|12"], + "kind": 13, "storage": 2 }, { "usr": 16721564935990383768, @@ -78,7 +92,7 @@ OUTPUT: "declarations": [], "spell": "6:5-6:6|0|1|2", "extent": "6:1-6:22|0|1|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 diff --git a/index_tests/templates/template_func_usage_folded_into_one.cc b/index_tests/templates/template_func_usage_folded_into_one.cc index 5e772268..aa6b9d0b 100644 --- a/index_tests/templates/template_func_usage_folded_into_one.cc +++ b/index_tests/templates/template_func_usage_folded_into_one.cc @@ -13,14 +13,14 @@ int b = foo(); OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 326583651986177228, "detailed_name": "static int foo()", "qual_name_offset": 11, "short_name": "foo", "kind": 12, - "storage": 2, + "storage": 0, "declarations": [], "spell": "2:12-2:15|0|1|2", "extent": "2:1-4:2|0|1|0", @@ -28,11 +28,11 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["6:9-6:12|0|1|32", "7:9-7:12|0|1|32"], + "uses": ["6:9-6:12|0|1|36", "7:9-7:12|0|1|36"], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -56,7 +56,7 @@ OUTPUT: "declarations": [], "spell": "7:5-7:6|0|1|2", "extent": "7:1-7:20|0|1|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 @@ -69,7 +69,7 @@ OUTPUT: "declarations": [], "spell": "6:5-6:6|0|1|2", "extent": "6:1-6:19|0|1|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 diff --git a/index_tests/templates/template_type_usage_folded_into_one.cc b/index_tests/templates/template_type_usage_folded_into_one.cc index 5eecc004..c4dbcd5b 100644 --- a/index_tests/templates/template_type_usage_folded_into_one.cc +++ b/index_tests/templates/template_type_usage_folded_into_one.cc @@ -8,12 +8,12 @@ Foo b; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [{ "usr": 10528472276654770367, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], @@ -31,7 +31,7 @@ OUTPUT: "usr2var": [{ "usr": 12028309045033782423, "detailed_name": "Foo b", - "qual_name_offset": 10, + "qual_name_offset": 4, "short_name": "b", "declarations": [], "spell": "5:11-5:12|0|1|2", diff --git a/index_tests/templates/template_var_usage_folded_into_one.cc b/index_tests/templates/template_var_usage_folded_into_one.cc index 61ee17ee..f64125be 100644 --- a/index_tests/templates/template_var_usage_folded_into_one.cc +++ b/index_tests/templates/template_var_usage_folded_into_one.cc @@ -34,12 +34,12 @@ EXTRA_FLAGS: OUTPUT: { "includes": [], - "skipped_by_preprocessor": ["12:1-28:7"], + "skipped_ranges": ["12:1-29:1"], "usr2func": [], "usr2type": [{ "usr": 6697181287623958829, - "detailed_name": "A", - "qual_name_offset": 0, + "detailed_name": "enum A {\n}", + "qual_name_offset": 5, "short_name": "A", "kind": 10, "declarations": [], @@ -53,25 +53,10 @@ OUTPUT: "vars": [], "instances": [16721564935990383768], "uses": ["7:1-7:2|0|1|4", "7:11-7:12|0|1|4"] - }, { - "usr": 11919899838872947844, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], - "alias_of": 0, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["5:1-5:2|0|1|4", "5:9-5:10|0|1|4"] }, { "usr": 13892793056005362145, - "detailed_name": "B", - "qual_name_offset": 0, + "detailed_name": "enum B {\n}", + "qual_name_offset": 5, "short_name": "B", "kind": 10, "declarations": [], @@ -96,7 +81,7 @@ OUTPUT: "spell": "5:3-5:6|0|1|2", "extent": "5:1-5:12|0|1|0", "type": 0, - "uses": ["7:7-7:10|0|1|4", "8:7-8:10|0|1|4"], + "uses": ["7:7-7:10|0|1|12", "8:7-8:10|0|1|12"], "kind": 13, "storage": 0 }, { diff --git a/index_tests/types/anonymous_struct.cc b/index_tests/types/anonymous_struct.cc index b52a6ff7..56f38ebf 100644 --- a/index_tests/types/anonymous_struct.cc +++ b/index_tests/types/anonymous_struct.cc @@ -7,10 +7,38 @@ union vector3 { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], + "skipped_ranges": [], + "usr2func": [{ + "usr": 1428566502523368801, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [3348817847649945564, 4821094820988543895, 15292551660437765731], + "uses": [], + "callees": [] + }, { + "usr": 17937907487590875128, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [1963212417280098348], + "uses": [], + "callees": [] + }], "usr2type": [{ - "usr": 21, + "usr": 82, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -22,16 +50,16 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [3348817847649945564, 4821094820988543895, 15292551660437765731, 1963212417280098348], + "instances": [3348817847649945564, 4821094820988543895, 15292551660437765731], "uses": [] }, { "usr": 1428566502523368801, - "detailed_name": "vector3::(anon struct)", + "detailed_name": "struct {}", "qual_name_offset": 0, - "short_name": "(anon struct)", + "short_name": "", "kind": 23, "declarations": [], - "spell": "2:3-2:9|17937907487590875128|2|2", + "spell": "2:3-2:9|17937907487590875128|2|514", "extent": "2:3-2:28|17937907487590875128|2|0", "alias_of": 0, "bases": [], @@ -52,27 +80,21 @@ OUTPUT: "uses": [] }, { "usr": 17937907487590875128, - "detailed_name": "vector3", - "qual_name_offset": 0, + "detailed_name": "union vector3 {}", + "qual_name_offset": 6, "short_name": "vector3", - "kind": 23, + "kind": 5, "declarations": [], "spell": "1:7-1:14|0|1|2", "extent": "1:1-4:2|0|1|0", "alias_of": 0, "bases": [], "derived": [], - "types": [], + "types": [1428566502523368801], "funcs": [], "vars": [{ - "L": 3348817847649945564, - "R": -1 - }, { - "L": 4821094820988543895, - "R": -1 - }, { - "L": 15292551660437765731, - "R": -1 + "L": 12549098950381705776, + "R": 0 }, { "L": 1963212417280098348, "R": 0 @@ -82,14 +104,13 @@ OUTPUT: }], "usr2var": [{ "usr": 1963212417280098348, - "detailed_name": "float [3] vector3::v", - "qual_name_offset": 10, + "detailed_name": "float vector3::v[3]", + "qual_name_offset": 6, "short_name": "v", - "hover": "float [3] vector3::v[3]", "declarations": [], - "spell": "3:9-3:10|17937907487590875128|2|2", + "spell": "3:9-3:10|17937907487590875128|2|514", "extent": "3:3-3:13|17937907487590875128|2|0", - "type": 21, + "type": 0, "uses": [], "kind": 8, "storage": 0 @@ -99,9 +120,9 @@ OUTPUT: "qual_name_offset": 6, "short_name": "x", "declarations": [], - "spell": "2:18-2:19|1428566502523368801|2|2", + "spell": "2:18-2:19|1428566502523368801|2|514", "extent": "2:12-2:19|1428566502523368801|2|0", - "type": 21, + "type": 82, "uses": [], "kind": 8, "storage": 0 @@ -111,9 +132,9 @@ OUTPUT: "qual_name_offset": 6, "short_name": "y", "declarations": [], - "spell": "2:21-2:22|1428566502523368801|2|2", + "spell": "2:21-2:22|1428566502523368801|2|514", "extent": "2:12-2:22|1428566502523368801|2|0", - "type": 21, + "type": 82, "uses": [], "kind": 8, "storage": 0 @@ -123,9 +144,9 @@ OUTPUT: "qual_name_offset": 6, "short_name": "z", "declarations": [], - "spell": "2:24-2:25|1428566502523368801|2|2", + "spell": "2:24-2:25|1428566502523368801|2|514", "extent": "2:12-2:25|1428566502523368801|2|0", - "type": 21, + "type": 82, "uses": [], "kind": 8, "storage": 0 diff --git a/index_tests/types/typedefs.cc b/index_tests/types/typedefs.cc index 45abe03a..96407a12 100644 --- a/index_tests/types/typedefs.cc +++ b/index_tests/types/typedefs.cc @@ -5,14 +5,14 @@ static func g; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 8105378401105136463, "detailed_name": "static int g(const int *, const int *)", "qual_name_offset": 11, "short_name": "g", "kind": 12, - "storage": 2, + "storage": 0, "declarations": ["2:13-2:14|0|1|1"], "declaring_type": 0, "bases": [], @@ -23,29 +23,13 @@ OUTPUT: }], "usr2type": [{ "usr": 10383876566159302459, - "detailed_name": "func", - "qual_name_offset": 0, + "detailed_name": "typedef int (func)(const int *, const int *)", + "qual_name_offset": 12, "short_name": "func", "kind": 252, - "hover": "typedef int (func)(const int *a, const int *b)", "declarations": [], "spell": "1:14-1:18|0|1|2", "extent": "1:1-1:47|0|1|0", - "alias_of": 13838176792705659279, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["1:14-1:18|0|1|4", "2:8-2:12|0|1|4"] - }, { - "usr": 13838176792705659279, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], "alias_of": 0, "bases": [], "derived": [], @@ -53,7 +37,7 @@ OUTPUT: "funcs": [], "vars": [], "instances": [], - "uses": [] + "uses": ["2:8-2:12|0|1|4"] }], "usr2var": [] } diff --git a/index_tests/unions/union_decl.cc b/index_tests/unions/union_decl.cc index 87949e04..3745475b 100644 --- a/index_tests/unions/union_decl.cc +++ b/index_tests/unions/union_decl.cc @@ -7,10 +7,24 @@ union Foo { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], + "skipped_ranges": [], + "usr2func": [{ + "usr": 8501689086387244262, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [9529311430721959843, 8804696910588009104], + "uses": [], + "callees": [] + }], "usr2type": [{ - "usr": 3, + "usr": 37, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -25,7 +39,7 @@ OUTPUT: "instances": [8804696910588009104], "uses": [] }, { - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -41,10 +55,10 @@ OUTPUT: "uses": [] }, { "usr": 8501689086387244262, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "union Foo {}", + "qual_name_offset": 6, "short_name": "Foo", - "kind": 23, + "kind": 5, "declarations": [], "spell": "1:7-1:10|0|1|2", "extent": "1:1-4:2|0|1|0", @@ -65,13 +79,13 @@ OUTPUT: }], "usr2var": [{ "usr": 8804696910588009104, - "detailed_name": "bool Foo::b", - "qual_name_offset": 5, + "detailed_name": "Foo::bool b", + "qual_name_offset": 0, "short_name": "b", "declarations": [], - "spell": "3:8-3:9|8501689086387244262|2|2", + "spell": "3:8-3:9|8501689086387244262|2|514", "extent": "3:3-3:9|8501689086387244262|2|0", - "type": 3, + "type": 37, "uses": [], "kind": 8, "storage": 0 @@ -81,9 +95,9 @@ OUTPUT: "qual_name_offset": 4, "short_name": "a", "declarations": [], - "spell": "2:7-2:8|8501689086387244262|2|2", + "spell": "2:7-2:8|8501689086387244262|2|514", "extent": "2:3-2:8|8501689086387244262|2|0", - "type": 17, + "type": 53, "uses": [], "kind": 8, "storage": 0 diff --git a/index_tests/unions/union_usage.cc b/index_tests/unions/union_usage.cc index c856ca05..4b36fa87 100644 --- a/index_tests/unions/union_usage.cc +++ b/index_tests/unions/union_usage.cc @@ -15,8 +15,22 @@ void act(Foo*) { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ + "usr": 8501689086387244262, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [9529311430721959843, 8804696910588009104], + "uses": [], + "callees": [] + }, { "usr": 13982179977217945200, "detailed_name": "void act(Foo *)", "qual_name_offset": 5, @@ -34,7 +48,7 @@ OUTPUT: "callees": [] }], "usr2type": [{ - "usr": 3, + "usr": 37, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -49,7 +63,7 @@ OUTPUT: "instances": [8804696910588009104], "uses": [] }, { - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -65,10 +79,10 @@ OUTPUT: "uses": [] }, { "usr": 8501689086387244262, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "union Foo {}", + "qual_name_offset": 6, "short_name": "Foo", - "kind": 23, + "kind": 5, "declarations": [], "spell": "1:7-1:10|0|1|2", "extent": "1:1-4:2|0|1|0", @@ -96,33 +110,31 @@ OUTPUT: "spell": "6:5-6:6|0|1|2", "extent": "6:1-6:6|0|1|0", "type": 8501689086387244262, - "uses": ["9:3-9:4|13982179977217945200|3|4"], + "uses": ["9:3-9:4|0|1|4"], "kind": 13, "storage": 0 }, { "usr": 8804696910588009104, - "detailed_name": "bool Foo::b", - "qual_name_offset": 5, + "detailed_name": "Foo::bool b : 3", + "qual_name_offset": 0, "short_name": "b", - "hover": "bool Foo::b : 3", "declarations": [], - "spell": "3:8-3:9|8501689086387244262|2|2", + "spell": "3:8-3:9|8501689086387244262|2|514", "extent": "3:3-3:13|8501689086387244262|2|0", - "type": 3, + "type": 37, "uses": [], "kind": 8, "storage": 0 }, { "usr": 9529311430721959843, - "detailed_name": "int Foo::a", + "detailed_name": "int Foo::a : 5", "qual_name_offset": 4, "short_name": "a", - "hover": "int Foo::a : 5", "declarations": [], - "spell": "2:7-2:8|8501689086387244262|2|2", + "spell": "2:7-2:8|8501689086387244262|2|514", "extent": "2:3-2:12|8501689086387244262|2|0", - "type": 17, - "uses": ["9:5-9:6|13982179977217945200|3|4"], + "type": 53, + "uses": ["9:5-9:6|8501689086387244262|2|20"], "kind": 8, "storage": 0 }] diff --git a/index_tests/usage/func_called_from_constructor.cc b/index_tests/usage/func_called_from_constructor.cc index 8213dac8..d109e087 100644 --- a/index_tests/usage/func_called_from_constructor.cc +++ b/index_tests/usage/func_called_from_constructor.cc @@ -12,7 +12,7 @@ Foo::Foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 468307235068920063, "detailed_name": "void called()", @@ -27,7 +27,7 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["8:3-8:9|3385168158331140247|3|32"], + "uses": ["8:3-8:9|0|1|8228"], "callees": [] }, { "usr": 3385168158331140247, @@ -36,23 +36,23 @@ OUTPUT: "short_name": "Foo", "kind": 9, "storage": 0, - "declarations": ["4:3-4:6|15041163540773201510|2|1"], - "spell": "7:6-7:9|15041163540773201510|2|2", - "extent": "7:1-9:2|0|1|0", - "declaring_type": 15041163540773201510, + "declarations": ["4:3-4:6|15041163540773201510|2|513"], + "spell": "7:6-7:9|15041163540773201510|2|514", + "extent": "4:3-4:8|15041163540773201510|2|0", + "declaring_type": 0, "bases": [], "derived": [], "vars": [], "uses": [], - "callees": ["8:3-8:9|468307235068920063|3|32"] + "callees": [] }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo {}", + "qual_name_offset": 7, "short_name": "Foo", "kind": 23, - "declarations": ["4:3-4:6|0|1|4", "7:6-7:9|0|1|4"], + "declarations": [], "spell": "3:8-3:11|0|1|2", "extent": "3:1-5:2|0|1|0", "alias_of": 0, @@ -62,7 +62,7 @@ OUTPUT: "funcs": [3385168158331140247], "vars": [], "instances": [], - "uses": ["4:3-4:6|15041163540773201510|2|4", "7:6-7:9|0|1|4", "7:1-7:4|0|1|4"] + "uses": ["4:3-4:6|0|1|4", "7:1-7:4|0|1|4", "7:6-7:9|0|1|4"] }], "usr2var": [] } diff --git a/index_tests/usage/func_called_from_macro_argument.cc b/index_tests/usage/func_called_from_macro_argument.cc index 819b679e..45e3af74 100644 --- a/index_tests/usage/func_called_from_macro_argument.cc +++ b/index_tests/usage/func_called_from_macro_argument.cc @@ -10,7 +10,7 @@ void caller() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 3787803219955606747, "detailed_name": "bool called(bool a, bool b)", @@ -23,7 +23,7 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["6:14-6:20|11404881820527069090|3|32"], + "uses": ["6:14-6:20|0|1|8228"], "callees": [] }, { "usr": 11404881820527069090, @@ -40,20 +40,20 @@ OUTPUT: "derived": [], "vars": [], "uses": [], - "callees": ["6:14-6:20|3787803219955606747|3|32"] + "callees": [] }], "usr2type": [], "usr2var": [{ - "usr": 1290746656694198202, + "usr": 16326993795872073150, "detailed_name": "MACRO_CALL", "qual_name_offset": 0, "short_name": "MACRO_CALL", - "hover": "#define MACRO_CALL(e) e", + "hover": "#define MACRO_CALL", "declarations": [], "spell": "1:9-1:19|0|1|2", - "extent": "1:9-1:24|0|1|0", + "extent": "1:9-1:19|0|1|2", "type": 0, - "uses": ["6:3-6:13|0|1|4"], + "uses": ["6:3-6:33|0|1|4"], "kind": 255, "storage": 0 }] diff --git a/index_tests/usage/func_called_from_template.cc b/index_tests/usage/func_called_from_template.cc index c1f3a38b..9ca6b37a 100644 --- a/index_tests/usage/func_called_from_template.cc +++ b/index_tests/usage/func_called_from_template.cc @@ -15,7 +15,7 @@ void foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 468307235068920063, "detailed_name": "void called()", @@ -28,7 +28,7 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["5:3-5:9|10177235824697315808|3|32"], + "uses": ["5:3-5:9|0|1|8228"], "callees": [] }, { "usr": 4259594751088586730, @@ -45,7 +45,7 @@ OUTPUT: "derived": [], "vars": [], "uses": [], - "callees": ["9:3-9:9|10177235824697315808|3|32"] + "callees": [] }, { "usr": 10177235824697315808, "detailed_name": "void caller()", @@ -60,8 +60,8 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["9:3-9:9|4259594751088586730|3|32"], - "callees": ["5:3-5:9|468307235068920063|3|32"] + "uses": ["9:3-9:9|0|1|8228"], + "callees": [] }], "usr2type": [], "usr2var": [] diff --git a/index_tests/usage/func_called_implicit_ctor.cc b/index_tests/usage/func_called_implicit_ctor.cc index a3a1b1c8..f4a07519 100644 --- a/index_tests/usage/func_called_implicit_ctor.cc +++ b/index_tests/usage/func_called_implicit_ctor.cc @@ -12,7 +12,7 @@ Wrapper caller() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 468307235068920063, "detailed_name": "int called()", @@ -27,7 +27,7 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["8:10-8:16|11404881820527069090|3|32"], + "uses": ["8:10-8:16|0|1|8228"], "callees": [] }, { "usr": 10544127002917214589, @@ -36,12 +36,12 @@ OUTPUT: "short_name": "Wrapper", "kind": 9, "storage": 0, - "declarations": ["2:3-2:10|13611487872560323389|2|1"], - "declaring_type": 13611487872560323389, + "declarations": ["2:3-2:10|13611487872560323389|2|513"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], - "uses": ["8:10-8:18|11404881820527069090|3|288"], + "uses": ["8:10-8:16|13611487872560323389|2|8228"], "callees": [] }, { "usr": 11404881820527069090, @@ -58,15 +58,15 @@ OUTPUT: "derived": [], "vars": [], "uses": [], - "callees": ["8:10-8:18|10544127002917214589|3|288", "8:10-8:16|468307235068920063|3|32"] + "callees": [] }], "usr2type": [{ "usr": 13611487872560323389, - "detailed_name": "Wrapper", - "qual_name_offset": 0, + "detailed_name": "struct Wrapper {}", + "qual_name_offset": 7, "short_name": "Wrapper", "kind": 23, - "declarations": ["2:3-2:10|0|1|4"], + "declarations": [], "spell": "1:8-1:15|0|1|2", "extent": "1:1-3:2|0|1|0", "alias_of": 0, @@ -76,7 +76,7 @@ OUTPUT: "funcs": [10544127002917214589], "vars": [], "instances": [], - "uses": ["2:3-2:10|13611487872560323389|2|4", "7:1-7:8|0|1|4"] + "uses": ["2:3-2:10|0|1|4", "7:1-7:8|0|1|4"] }], "usr2var": [] } diff --git a/index_tests/usage/func_usage_addr_func.cc b/index_tests/usage/func_usage_addr_func.cc index 19080a4c..68dd2c21 100644 --- a/index_tests/usage/func_usage_addr_func.cc +++ b/index_tests/usage/func_usage_addr_func.cc @@ -11,7 +11,7 @@ void user() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 5264867802674151787, "detailed_name": "void used()", @@ -26,7 +26,7 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["6:18-6:22|9376923949268137283|3|32", "7:12-7:16|9376923949268137283|3|32"], + "uses": ["6:18-6:22|0|1|132", "7:12-7:16|0|1|132"], "callees": [] }, { "usr": 9376923949268137283, @@ -41,9 +41,9 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [16088407831770615719], + "vars": [], "uses": [], - "callees": ["6:18-6:22|5264867802674151787|3|32", "6:18-6:22|5264867802674151787|3|32", "7:3-7:10|12924914488846929470|3|32", "7:12-7:16|5264867802674151787|3|32"] + "callees": [] }, { "usr": 12924914488846929470, "detailed_name": "void consume(void (*)())", @@ -58,15 +58,16 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["7:3-7:10|9376923949268137283|3|32"], + "uses": ["7:3-7:10|0|1|8228"], "callees": [] }], "usr2type": [], "usr2var": [{ "usr": 16088407831770615719, - "detailed_name": "void (*)() x", - "qual_name_offset": 11, + "detailed_name": "void (*x)()", + "qual_name_offset": 7, "short_name": "x", + "hover": "void (*x)() = &used", "declarations": [], "spell": "6:10-6:11|9376923949268137283|3|2", "extent": "6:3-6:22|9376923949268137283|3|0", diff --git a/index_tests/usage/func_usage_addr_method.cc b/index_tests/usage/func_usage_addr_method.cc index 7a33f6cb..9c435a9a 100644 --- a/index_tests/usage/func_usage_addr_method.cc +++ b/index_tests/usage/func_usage_addr_method.cc @@ -11,7 +11,7 @@ void user() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 9376923949268137283, "detailed_name": "void user()", @@ -25,9 +25,9 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [4636142131003982569], + "vars": [], "uses": [], - "callees": ["6:18-6:22|18417145003926999463|3|32", "6:18-6:22|18417145003926999463|3|32"] + "callees": [] }, { "usr": 18417145003926999463, "detailed_name": "void Foo::Used()", @@ -35,18 +35,18 @@ OUTPUT: "short_name": "Used", "kind": 6, "storage": 0, - "declarations": ["2:8-2:12|15041163540773201510|2|1"], - "declaring_type": 15041163540773201510, + "declarations": ["2:8-2:12|15041163540773201510|2|513"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], - "uses": ["6:18-6:22|9376923949268137283|3|32"], + "uses": ["6:18-6:22|15041163540773201510|2|132"], "callees": [] }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo {}", + "qual_name_offset": 7, "short_name": "Foo", "kind": 23, "declarations": [], @@ -63,10 +63,10 @@ OUTPUT: }], "usr2var": [{ "usr": 4636142131003982569, - "detailed_name": "void (Foo::*)() x", - "qual_name_offset": 16, + "detailed_name": "auto x", + "qual_name_offset": 5, "short_name": "x", - "hover": "void (Foo::*)() x = &Foo::Used", + "hover": "auto x = &Foo::Used", "declarations": [], "spell": "6:8-6:9|9376923949268137283|3|2", "extent": "6:3-6:22|9376923949268137283|3|0", diff --git a/index_tests/usage/func_usage_call_func.cc b/index_tests/usage/func_usage_call_func.cc index 6c2db9e6..b2c0e896 100644 --- a/index_tests/usage/func_usage_call_func.cc +++ b/index_tests/usage/func_usage_call_func.cc @@ -7,7 +7,7 @@ void caller() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 468307235068920063, "detailed_name": "void called()", @@ -22,7 +22,7 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["3:3-3:9|11404881820527069090|3|32"], + "uses": ["3:3-3:9|0|1|8228"], "callees": [] }, { "usr": 11404881820527069090, @@ -39,7 +39,7 @@ OUTPUT: "derived": [], "vars": [], "uses": [], - "callees": ["3:3-3:9|468307235068920063|3|32"] + "callees": [] }], "usr2type": [], "usr2var": [] diff --git a/index_tests/usage/func_usage_call_method.cc b/index_tests/usage/func_usage_call_method.cc index 842c3ec8..db90d666 100644 --- a/index_tests/usage/func_usage_call_method.cc +++ b/index_tests/usage/func_usage_call_method.cc @@ -11,7 +11,7 @@ void user() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 9376923949268137283, "detailed_name": "void user()", @@ -25,9 +25,9 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [14045150712868309451], + "vars": [], "uses": [], - "callees": ["7:6-7:10|18417145003926999463|3|32"] + "callees": [] }, { "usr": 18417145003926999463, "detailed_name": "void Foo::Used()", @@ -35,18 +35,18 @@ OUTPUT: "short_name": "Used", "kind": 6, "storage": 0, - "declarations": ["2:8-2:12|15041163540773201510|2|1"], - "declaring_type": 15041163540773201510, + "declarations": ["2:8-2:12|15041163540773201510|2|513"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], - "uses": ["7:6-7:10|9376923949268137283|3|32"], + "uses": ["7:6-7:10|15041163540773201510|2|8228"], "callees": [] }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo {}", + "qual_name_offset": 7, "short_name": "Foo", "kind": 23, "declarations": [], @@ -71,7 +71,7 @@ OUTPUT: "spell": "6:8-6:9|9376923949268137283|3|2", "extent": "6:3-6:19|9376923949268137283|3|0", "type": 15041163540773201510, - "uses": ["7:3-7:4|9376923949268137283|3|4"], + "uses": ["7:3-7:4|9376923949268137283|3|12"], "kind": 13, "storage": 0 }] diff --git a/index_tests/usage/func_usage_class_inline_var_def.cc b/index_tests/usage/func_usage_class_inline_var_def.cc index 291322b4..45c77afc 100644 --- a/index_tests/usage/func_usage_class_inline_var_def.cc +++ b/index_tests/usage/func_usage_class_inline_var_def.cc @@ -10,14 +10,14 @@ class Foo { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 9630503130605430498, "detailed_name": "static int helper()", "qual_name_offset": 11, "short_name": "helper", "kind": 12, - "storage": 2, + "storage": 0, "declarations": [], "spell": "1:12-1:18|0|1|2", "extent": "1:1-3:2|0|1|0", @@ -25,11 +25,25 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["6:11-6:17|15041163540773201510|2|32"], + "uses": ["6:11-6:17|0|1|36"], + "callees": [] + }, { + "usr": 15041163540773201510, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [4220150017963593039], + "uses": [], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -45,8 +59,8 @@ OUTPUT: "uses": [] }, { "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], @@ -71,9 +85,9 @@ OUTPUT: "short_name": "x", "hover": "int Foo::x = helper()", "declarations": [], - "spell": "6:7-6:8|15041163540773201510|2|2", + "spell": "6:7-6:8|15041163540773201510|2|514", "extent": "6:3-6:19|15041163540773201510|2|0", - "type": 17, + "type": 53, "uses": [], "kind": 8, "storage": 0 diff --git a/index_tests/usage/func_usage_forward_decl_func.cc b/index_tests/usage/func_usage_forward_decl_func.cc index f082dc33..bf7c7c5a 100644 --- a/index_tests/usage/func_usage_forward_decl_func.cc +++ b/index_tests/usage/func_usage_forward_decl_func.cc @@ -7,7 +7,7 @@ void usage() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", @@ -20,7 +20,7 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["4:3-4:6|6767773193109753523|3|32"], + "uses": ["4:3-4:6|0|1|8228"], "callees": [] }, { "usr": 6767773193109753523, @@ -37,7 +37,7 @@ OUTPUT: "derived": [], "vars": [], "uses": [], - "callees": ["4:3-4:6|4259594751088586730|3|32"] + "callees": [] }], "usr2type": [], "usr2var": [] diff --git a/index_tests/usage/func_usage_forward_decl_method.cc b/index_tests/usage/func_usage_forward_decl_method.cc index ae5bf98a..b00ff4fa 100644 --- a/index_tests/usage/func_usage_forward_decl_method.cc +++ b/index_tests/usage/func_usage_forward_decl_method.cc @@ -10,7 +10,7 @@ void usage() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 6767773193109753523, "detailed_name": "void usage()", @@ -24,9 +24,9 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [16229832321010999607], + "vars": [], "uses": [], - "callees": ["7:6-7:9|17922201480358737771|3|32"] + "callees": [] }, { "usr": 17922201480358737771, "detailed_name": "void Foo::foo()", @@ -34,18 +34,18 @@ OUTPUT: "short_name": "foo", "kind": 6, "storage": 0, - "declarations": ["2:8-2:11|15041163540773201510|2|1"], - "declaring_type": 15041163540773201510, + "declarations": ["2:8-2:11|15041163540773201510|2|513"], + "declaring_type": 0, "bases": [], "derived": [], "vars": [], - "uses": ["7:6-7:9|6767773193109753523|3|32"], + "uses": ["7:6-7:9|15041163540773201510|2|8228"], "callees": [] }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo {}", + "qual_name_offset": 7, "short_name": "Foo", "kind": 23, "declarations": [], @@ -70,7 +70,7 @@ OUTPUT: "spell": "6:8-6:9|6767773193109753523|3|2", "extent": "6:3-6:19|6767773193109753523|3|0", "type": 15041163540773201510, - "uses": ["7:3-7:4|6767773193109753523|3|4"], + "uses": ["7:3-7:4|6767773193109753523|3|12"], "kind": 13, "storage": 0 }] diff --git a/index_tests/usage/func_usage_template_func.cc b/index_tests/usage/func_usage_template_func.cc index 48dcdfbd..9be1e81a 100644 --- a/index_tests/usage/func_usage_template_func.cc +++ b/index_tests/usage/func_usage_template_func.cc @@ -10,7 +10,7 @@ void foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", @@ -26,7 +26,7 @@ OUTPUT: "derived": [], "vars": [], "uses": [], - "callees": ["5:3-5:9|10585861037135727329|3|32", "6:3-6:9|10585861037135727329|3|32"] + "callees": [] }, { "usr": 10585861037135727329, "detailed_name": "void accept(T)", @@ -39,27 +39,10 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["5:3-5:9|4259594751088586730|3|32", "6:3-6:9|4259594751088586730|3|32"], + "uses": ["5:3-5:9|0|1|8228", "6:3-6:9|0|1|8228"], "callees": [] }], - "usr2type": [{ - "usr": 13420564603121289209, - "detailed_name": "T", - "qual_name_offset": 0, - "short_name": "T", - "kind": 26, - "declarations": [], - "spell": "1:19-1:20|10585861037135727329|3|2", - "extent": "1:10-1:20|10585861037135727329|3|0", - "alias_of": 0, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": ["2:13-2:14|0|1|4"] - }], + "usr2type": [], "usr2var": [] } */ diff --git a/index_tests/usage/type_usage_as_template_parameter.cc b/index_tests/usage/type_usage_as_template_parameter.cc index bc6eb0aa..56da2161 100644 --- a/index_tests/usage/type_usage_as_template_parameter.cc +++ b/index_tests/usage/type_usage_as_template_parameter.cc @@ -14,7 +14,7 @@ unique_ptr* return_type() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 16359708726068806331, "detailed_name": "unique_ptr *return_type()", @@ -28,14 +28,14 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [3364438781074774169], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ "usr": 3286534761799572592, - "detailed_name": "unique_ptr", - "qual_name_offset": 0, + "detailed_name": "class unique_ptr {}", + "qual_name_offset": 6, "short_name": "unique_ptr", "kind": 5, "declarations": [], @@ -51,8 +51,8 @@ OUTPUT: "uses": ["6:8-6:18|0|1|4", "7:8-7:18|0|1|4", "9:1-9:11|0|1|4", "10:3-10:13|0|1|4"] }, { "usr": 4750332761459066907, - "detailed_name": "S", - "qual_name_offset": 0, + "detailed_name": "struct S {}", + "qual_name_offset": 7, "short_name": "S", "kind": 23, "declarations": [], @@ -81,8 +81,8 @@ OUTPUT: "storage": 0 }, { "usr": 12857919739649552168, - "detailed_name": "unique_ptr f0", - "qual_name_offset": 17, + "detailed_name": "static unique_ptr f0", + "qual_name_offset": 24, "short_name": "f0", "declarations": [], "spell": "6:25-6:27|0|1|2", @@ -93,8 +93,8 @@ OUTPUT: "storage": 2 }, { "usr": 18075066956054788088, - "detailed_name": "unique_ptr f1", - "qual_name_offset": 14, + "detailed_name": "static unique_ptr f1", + "qual_name_offset": 21, "short_name": "f1", "declarations": [], "spell": "7:22-7:24|0|1|2", diff --git a/index_tests/usage/type_usage_as_template_parameter_complex.cc b/index_tests/usage/type_usage_as_template_parameter_complex.cc index 0236115c..615d36a2 100644 --- a/index_tests/usage/type_usage_as_template_parameter_complex.cc +++ b/index_tests/usage/type_usage_as_template_parameter_complex.cc @@ -82,7 +82,7 @@ unique_ptr* Foo::foo() { return nullptr; } OUTPUT: { "includes": [], - "skipped_by_preprocessor": ["7:1-14:7", "17:1-32:7", "35:1-39:7", "42:1-52:7", "57:1-63:7", "68:1-78:7"], + "skipped_ranges": ["7:1-15:1", "17:1-33:1", "35:1-40:1", "42:1-53:1", "57:1-64:1", "68:1-79:1"], "usr2func": [{ "usr": 1246637699196435450, "detailed_name": "unique_ptr, S2> *as_return_type(unique_ptr *)", @@ -122,10 +122,10 @@ OUTPUT: "short_name": "foo", "kind": 6, "storage": 0, - "declarations": ["65:23-65:26|15041163540773201510|2|1"], - "spell": "79:26-79:29|15041163540773201510|2|2", - "extent": "79:1-79:51|0|1|0", - "declaring_type": 15041163540773201510, + "declarations": ["65:23-65:26|15041163540773201510|2|513"], + "spell": "79:26-79:29|15041163540773201510|2|514", + "extent": "65:3-65:28|15041163540773201510|2|0", + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -144,14 +144,14 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [500112618220246], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ "usr": 4310164820010458371, - "detailed_name": "S1", - "qual_name_offset": 0, + "detailed_name": "struct S1", + "qual_name_offset": 7, "short_name": "S1", "kind": 23, "declarations": ["4:8-4:10|0|1|1"], @@ -165,8 +165,8 @@ OUTPUT: "uses": ["15:30-15:32|0|1|4", "33:23-33:25|0|1|4", "33:63-33:65|0|1|4", "54:25-54:27|0|1|4", "65:14-65:16|0|1|4", "79:12-79:14|0|1|4"] }, { "usr": 12728490517004312484, - "detailed_name": "S2", - "qual_name_offset": 0, + "detailed_name": "struct S2", + "qual_name_offset": 7, "short_name": "S2", "kind": 23, "declarations": ["5:8-5:10|0|1|1"], @@ -180,8 +180,8 @@ OUTPUT: "uses": ["15:34-15:36|0|1|4", "15:39-15:41|0|1|4", "33:27-33:29|0|1|4", "33:32-33:34|0|1|4", "33:67-33:69|0|1|4", "54:29-54:31|0|1|4", "54:34-54:36|0|1|4", "65:18-65:20|0|1|4", "79:16-79:18|0|1|4"] }, { "usr": 14209198335088845323, - "detailed_name": "unique_ptr", - "qual_name_offset": 0, + "detailed_name": "class unique_ptr", + "qual_name_offset": 6, "short_name": "unique_ptr", "kind": 5, "declarations": ["2:7-2:17|0|1|1"], @@ -195,8 +195,8 @@ OUTPUT: "uses": ["15:8-15:18|0|1|4", "15:19-15:29|0|1|4", "33:1-33:11|0|1|4", "33:12-33:22|0|1|4", "33:52-33:62|0|1|4", "54:3-54:13|0|1|4", "54:14-54:24|0|1|4", "65:3-65:13|0|1|4", "79:1-79:11|0|1|4"] }, { "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], @@ -225,8 +225,8 @@ OUTPUT: "storage": 0 }, { "usr": 2933643612409209903, - "detailed_name": "unique_ptr, S2> f", - "qual_name_offset": 35, + "detailed_name": "extern unique_ptr, S2> f", + "qual_name_offset": 42, "short_name": "f", "declarations": ["15:43-15:44|0|1|1"], "type": 14209198335088845323, diff --git a/index_tests/usage/type_usage_as_template_parameter_simple.cc b/index_tests/usage/type_usage_as_template_parameter_simple.cc index 7487a11e..75aed976 100644 --- a/index_tests/usage/type_usage_as_template_parameter_simple.cc +++ b/index_tests/usage/type_usage_as_template_parameter_simple.cc @@ -9,12 +9,12 @@ static unique_ptr foo; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [{ "usr": 3286534761799572592, - "detailed_name": "unique_ptr", - "qual_name_offset": 0, + "detailed_name": "class unique_ptr {}", + "qual_name_offset": 6, "short_name": "unique_ptr", "kind": 5, "declarations": [], @@ -30,8 +30,8 @@ OUTPUT: "uses": ["6:8-6:18|0|1|4"] }, { "usr": 4750332761459066907, - "detailed_name": "S", - "qual_name_offset": 0, + "detailed_name": "struct S", + "qual_name_offset": 7, "short_name": "S", "kind": 23, "declarations": ["4:8-4:9|0|1|1"], @@ -46,8 +46,8 @@ OUTPUT: }], "usr2var": [{ "usr": 3398408600781120939, - "detailed_name": "unique_ptr foo", - "qual_name_offset": 14, + "detailed_name": "static unique_ptr foo", + "qual_name_offset": 21, "short_name": "foo", "declarations": [], "spell": "6:22-6:25|0|1|2", diff --git a/index_tests/usage/type_usage_declare_extern.cc b/index_tests/usage/type_usage_declare_extern.cc index 813461cb..f03978d7 100644 --- a/index_tests/usage/type_usage_declare_extern.cc +++ b/index_tests/usage/type_usage_declare_extern.cc @@ -5,12 +5,12 @@ extern T t; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [{ "usr": 5673439900521455039, - "detailed_name": "T", - "qual_name_offset": 0, + "detailed_name": "struct T {}", + "qual_name_offset": 7, "short_name": "T", "kind": 23, "declarations": [], @@ -27,8 +27,8 @@ OUTPUT: }], "usr2var": [{ "usr": 1346710425945444872, - "detailed_name": "T t", - "qual_name_offset": 2, + "detailed_name": "extern T t", + "qual_name_offset": 0, "short_name": "t", "declarations": ["3:10-3:11|0|1|1"], "type": 5673439900521455039, diff --git a/index_tests/usage/type_usage_declare_field.cc b/index_tests/usage/type_usage_declare_field.cc index e2401832..87e2514d 100644 --- a/index_tests/usage/type_usage_declare_field.cc +++ b/index_tests/usage/type_usage_declare_field.cc @@ -10,12 +10,26 @@ struct Foo { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], + "skipped_ranges": [], + "usr2func": [{ + "usr": 15041163540773201510, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [14314859014962085433, 14727441168849658842], + "uses": [], + "callees": [] + }], "usr2type": [{ "usr": 8508299082070213750, - "detailed_name": "ImplementedType", - "qual_name_offset": 0, + "detailed_name": "struct ImplementedType {}", + "qual_name_offset": 7, "short_name": "ImplementedType", "kind": 23, "declarations": [], @@ -31,8 +45,8 @@ OUTPUT: "uses": ["6:3-6:18|0|1|4"] }, { "usr": 13749354388332789217, - "detailed_name": "ForwardType", - "qual_name_offset": 0, + "detailed_name": "struct ForwardType", + "qual_name_offset": 7, "short_name": "ForwardType", "kind": 23, "declarations": ["1:8-1:19|0|1|1"], @@ -46,8 +60,8 @@ OUTPUT: "uses": ["5:3-5:14|0|1|4"] }, { "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo {}", + "qual_name_offset": 7, "short_name": "Foo", "kind": 23, "declarations": [], @@ -70,11 +84,11 @@ OUTPUT: }], "usr2var": [{ "usr": 14314859014962085433, - "detailed_name": "ForwardType *Foo::a", - "qual_name_offset": 13, + "detailed_name": "ForwFoo::ardType *a", + "qual_name_offset": 0, "short_name": "a", "declarations": [], - "spell": "5:16-5:17|15041163540773201510|2|2", + "spell": "5:16-5:17|15041163540773201510|2|514", "extent": "5:3-5:17|15041163540773201510|2|0", "type": 13749354388332789217, "uses": [], @@ -86,7 +100,7 @@ OUTPUT: "qual_name_offset": 16, "short_name": "b", "declarations": [], - "spell": "6:19-6:20|15041163540773201510|2|2", + "spell": "6:19-6:20|15041163540773201510|2|514", "extent": "6:3-6:20|15041163540773201510|2|0", "type": 8508299082070213750, "uses": [], diff --git a/index_tests/usage/type_usage_declare_local.cc b/index_tests/usage/type_usage_declare_local.cc index 1a9218ed..b4462a95 100644 --- a/index_tests/usage/type_usage_declare_local.cc +++ b/index_tests/usage/type_usage_declare_local.cc @@ -10,7 +10,7 @@ void Foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4654328188330986029, "detailed_name": "void Foo()", @@ -24,14 +24,14 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [16374832544037266261, 2580122838476012357], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ "usr": 8508299082070213750, - "detailed_name": "ImplementedType", - "qual_name_offset": 0, + "detailed_name": "struct ImplementedType {}", + "qual_name_offset": 7, "short_name": "ImplementedType", "kind": 23, "declarations": [], @@ -47,8 +47,8 @@ OUTPUT: "uses": ["6:3-6:18|0|1|4"] }, { "usr": 13749354388332789217, - "detailed_name": "ForwardType", - "qual_name_offset": 0, + "detailed_name": "struct ForwardType", + "qual_name_offset": 7, "short_name": "ForwardType", "kind": 23, "declarations": ["1:8-1:19|0|1|1"], @@ -76,7 +76,7 @@ OUTPUT: }, { "usr": 16374832544037266261, "detailed_name": "ForwardType *a", - "qual_name_offset": 13, + "qual_name_offset": 0, "short_name": "a", "declarations": [], "spell": "5:16-5:17|4654328188330986029|3|2", diff --git a/index_tests/usage/type_usage_declare_param.cc b/index_tests/usage/type_usage_declare_param.cc index 3de9198f..7ccd5eef 100644 --- a/index_tests/usage/type_usage_declare_param.cc +++ b/index_tests/usage/type_usage_declare_param.cc @@ -7,7 +7,7 @@ void foo(ForwardType* f, ImplementedType a) {} OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 1699390678058422036, "detailed_name": "void foo(ForwardType *f, ImplementedType a)", @@ -21,14 +21,14 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [13058491096576226774, 11055777568039014776], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ "usr": 8508299082070213750, - "detailed_name": "ImplementedType", - "qual_name_offset": 0, + "detailed_name": "struct ImplementedType {}", + "qual_name_offset": 7, "short_name": "ImplementedType", "kind": 23, "declarations": [], @@ -44,8 +44,8 @@ OUTPUT: "uses": ["4:26-4:41|0|1|4"] }, { "usr": 13749354388332789217, - "detailed_name": "ForwardType", - "qual_name_offset": 0, + "detailed_name": "struct ForwardType", + "qual_name_offset": 7, "short_name": "ForwardType", "kind": 23, "declarations": ["1:8-1:19|0|1|1"], @@ -64,7 +64,7 @@ OUTPUT: "qual_name_offset": 16, "short_name": "a", "declarations": [], - "spell": "4:42-4:43|1699390678058422036|3|2", + "spell": "4:42-4:43|1699390678058422036|3|514", "extent": "4:26-4:43|1699390678058422036|3|0", "type": 8508299082070213750, "uses": [], @@ -76,7 +76,7 @@ OUTPUT: "qual_name_offset": 13, "short_name": "f", "declarations": [], - "spell": "4:23-4:24|1699390678058422036|3|2", + "spell": "4:23-4:24|1699390678058422036|3|514", "extent": "4:10-4:24|1699390678058422036|3|0", "type": 13749354388332789217, "uses": [], diff --git a/index_tests/usage/type_usage_declare_param_prototype.cc b/index_tests/usage/type_usage_declare_param_prototype.cc index e96b6418..36e88a1a 100644 --- a/index_tests/usage/type_usage_declare_param_prototype.cc +++ b/index_tests/usage/type_usage_declare_param_prototype.cc @@ -12,7 +12,7 @@ void foo(Foo* f, Foo*) {} OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 8908726657907936744, "detailed_name": "void foo(Foo *f, Foo *)", @@ -22,18 +22,18 @@ OUTPUT: "storage": 0, "declarations": ["3:6-3:9|0|1|1"], "spell": "4:6-4:9|0|1|2", - "extent": "4:1-4:26|0|1|0", + "extent": "3:1-3:23|0|1|0", "declaring_type": 0, "bases": [], "derived": [], - "vars": [13823260660189154978], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo", + "qual_name_offset": 7, "short_name": "Foo", "kind": 23, "declarations": ["1:8-1:11|0|1|1"], @@ -52,7 +52,7 @@ OUTPUT: "qual_name_offset": 5, "short_name": "f", "declarations": [], - "spell": "4:15-4:16|8908726657907936744|3|2", + "spell": "4:15-4:16|8908726657907936744|3|514", "extent": "4:10-4:16|8908726657907936744|3|0", "type": 15041163540773201510, "uses": [], diff --git a/index_tests/usage/type_usage_declare_param_unnamed.cc b/index_tests/usage/type_usage_declare_param_unnamed.cc index cc06d8a6..f9e6096d 100644 --- a/index_tests/usage/type_usage_declare_param_unnamed.cc +++ b/index_tests/usage/type_usage_declare_param_unnamed.cc @@ -4,7 +4,7 @@ void foo(ForwardType*) {} OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 15327735280790448926, "detailed_name": "void foo(ForwardType *)", @@ -24,8 +24,8 @@ OUTPUT: }], "usr2type": [{ "usr": 13749354388332789217, - "detailed_name": "ForwardType", - "qual_name_offset": 0, + "detailed_name": "struct ForwardType", + "qual_name_offset": 7, "short_name": "ForwardType", "kind": 23, "declarations": ["1:8-1:19|0|1|1"], diff --git a/index_tests/usage/type_usage_declare_qualifiers.cc b/index_tests/usage/type_usage_declare_qualifiers.cc index 22c1bf59..df3b9b42 100644 --- a/index_tests/usage/type_usage_declare_qualifiers.cc +++ b/index_tests/usage/type_usage_declare_qualifiers.cc @@ -10,7 +10,7 @@ void foo(Type& a0, const Type& a1) { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 16858540520096802573, "detailed_name": "void foo(Type &a0, const Type &a1)", @@ -24,14 +24,14 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [7997456978847868736, 17228576662112939520, 15429032129697337561, 6081981442495435784, 5004072032239834773, 14939253431683105646], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ "usr": 13487927231218873822, - "detailed_name": "Type", - "qual_name_offset": 0, + "detailed_name": "struct Type {}", + "qual_name_offset": 7, "short_name": "Type", "kind": 23, "declarations": [], @@ -76,7 +76,7 @@ OUTPUT: "qual_name_offset": 6, "short_name": "a0", "declarations": [], - "spell": "3:16-3:18|16858540520096802573|3|2", + "spell": "3:16-3:18|16858540520096802573|3|514", "extent": "3:10-3:18|16858540520096802573|3|0", "type": 13487927231218873822, "uses": [], @@ -113,7 +113,7 @@ OUTPUT: "qual_name_offset": 12, "short_name": "a1", "declarations": [], - "spell": "3:32-3:34|16858540520096802573|3|2", + "spell": "3:32-3:34|16858540520096802573|3|514", "extent": "3:20-3:34|16858540520096802573|3|0", "type": 13487927231218873822, "uses": [], diff --git a/index_tests/usage/type_usage_declare_static.cc b/index_tests/usage/type_usage_declare_static.cc index d344aa6a..55225b5e 100644 --- a/index_tests/usage/type_usage_declare_static.cc +++ b/index_tests/usage/type_usage_declare_static.cc @@ -4,12 +4,12 @@ static Type t; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [{ "usr": 13487927231218873822, - "detailed_name": "Type", - "qual_name_offset": 0, + "detailed_name": "struct Type {}", + "qual_name_offset": 7, "short_name": "Type", "kind": 23, "declarations": [], @@ -26,8 +26,8 @@ OUTPUT: }], "usr2var": [{ "usr": 6601831367240627080, - "detailed_name": "Type t", - "qual_name_offset": 5, + "detailed_name": "static Type t", + "qual_name_offset": 0, "short_name": "t", "declarations": [], "spell": "2:13-2:14|0|1|2", diff --git a/index_tests/usage/type_usage_on_return_type.cc b/index_tests/usage/type_usage_on_return_type.cc index 736caf8a..3669d942 100644 --- a/index_tests/usage/type_usage_on_return_type.cc +++ b/index_tests/usage/type_usage_on_return_type.cc @@ -21,7 +21,7 @@ static Type* bar() { return nullptr; } OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4240751906910175539, "detailed_name": "void Foo::Empty()", @@ -29,10 +29,10 @@ OUTPUT: "short_name": "Empty", "kind": 6, "storage": 0, - "declarations": ["9:8-9:13|15041163540773201510|2|1"], - "spell": "13:11-13:16|15041163540773201510|2|2", - "extent": "13:1-13:21|0|1|0", - "declaring_type": 15041163540773201510, + "declarations": ["9:8-9:13|15041163540773201510|2|513"], + "spell": "13:11-13:16|15041163540773201510|2|514", + "extent": "9:3-9:15|15041163540773201510|2|0", + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -47,7 +47,7 @@ OUTPUT: "storage": 0, "declarations": ["3:7-3:10|0|1|1", "4:7-4:10|0|1|1"], "spell": "5:7-5:10|0|1|2", - "extent": "5:1-5:32|0|1|0", + "extent": "3:1-3:12|0|1|0", "declaring_type": 0, "bases": [], "derived": [], @@ -60,7 +60,7 @@ OUTPUT: "qual_name_offset": 19, "short_name": "external", "kind": 12, - "storage": 1, + "storage": 0, "declarations": ["15:20-15:28|0|1|1"], "declaring_type": 0, "bases": [], @@ -75,10 +75,10 @@ OUTPUT: "short_name": "Get", "kind": 6, "storage": 0, - "declarations": ["8:9-8:12|15041163540773201510|2|1"], - "spell": "12:12-12:15|15041163540773201510|2|2", - "extent": "12:1-12:40|0|1|0", - "declaring_type": 15041163540773201510, + "declarations": ["8:9-8:12|15041163540773201510|2|513"], + "spell": "12:12-12:15|15041163540773201510|2|514", + "extent": "8:3-8:17|15041163540773201510|2|0", + "declaring_type": 0, "bases": [], "derived": [], "vars": [], @@ -90,10 +90,10 @@ OUTPUT: "qual_name_offset": 13, "short_name": "bar", "kind": 12, - "storage": 2, + "storage": 0, "declarations": ["17:14-17:17|0|1|1"], "spell": "18:14-18:17|0|1|2", - "extent": "18:1-18:39|0|1|0", + "extent": "17:1-17:19|0|1|0", "declaring_type": 0, "bases": [], "derived": [], @@ -103,8 +103,8 @@ OUTPUT: }], "usr2type": [{ "usr": 13487927231218873822, - "detailed_name": "Type", - "qual_name_offset": 0, + "detailed_name": "struct Type", + "qual_name_offset": 7, "short_name": "Type", "kind": 23, "declarations": ["1:8-1:12|0|1|1"], @@ -118,8 +118,8 @@ OUTPUT: "uses": ["3:1-3:5|0|1|4", "4:1-4:5|0|1|4", "5:1-5:5|0|1|4", "8:3-8:7|0|1|4", "12:1-12:5|0|1|4", "15:14-15:18|0|1|4", "17:8-17:12|0|1|4", "18:8-18:12|0|1|4"] }, { "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], diff --git a/index_tests/usage/type_usage_typedef_and_using.cc b/index_tests/usage/type_usage_typedef_and_using.cc index 02d1ebbb..d3c6dc4f 100644 --- a/index_tests/usage/type_usage_typedef_and_using.cc +++ b/index_tests/usage/type_usage_typedef_and_using.cc @@ -13,7 +13,7 @@ void accept3(Foo3*) {} OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 558620830317390922, "detailed_name": "void accept1(Foo1 *)", @@ -80,27 +80,11 @@ OUTPUT: "callees": [] }], "usr2type": [{ - "usr": 17, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "declarations": [], - "alias_of": 0, - "bases": [], - "derived": [], - "types": [], - "funcs": [], - "vars": [], - "instances": [], - "uses": [] - }, { "usr": 1544499294580512394, - "detailed_name": "Foo1", - "qual_name_offset": 0, + "detailed_name": "using Foo1 = Foo *", + "qual_name_offset": 6, "short_name": "Foo1", "kind": 252, - "hover": "using Foo1 = Foo*", "declarations": [], "spell": "2:7-2:11|0|1|2", "extent": "2:1-2:18|0|1|0", @@ -111,29 +95,28 @@ OUTPUT: "funcs": [], "vars": [], "instances": [], - "uses": ["2:7-2:11|0|1|4", "4:14-4:18|0|1|4", "8:14-8:18|0|1|4"] + "uses": ["4:14-4:18|0|1|4", "8:14-8:18|0|1|4"] }, { "usr": 2638219001294786365, - "detailed_name": "Foo4", - "qual_name_offset": 0, + "detailed_name": "using Foo4 = int", + "qual_name_offset": 6, "short_name": "Foo4", "kind": 252, - "hover": "using Foo4 = int", "declarations": [], "spell": "5:7-5:11|0|1|2", "extent": "5:1-5:17|0|1|0", - "alias_of": 17, + "alias_of": 0, "bases": [], "derived": [], "types": [], "funcs": [], "vars": [], "instances": [], - "uses": ["5:7-5:11|0|1|4"] + "uses": [] }, { "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo", + "qual_name_offset": 7, "short_name": "Foo", "kind": 23, "declarations": ["1:8-1:11|0|1|1"], @@ -147,11 +130,10 @@ OUTPUT: "uses": ["2:14-2:17|0|1|4", "3:9-3:12|0|1|4", "7:13-7:16|0|1|4"] }, { "usr": 15466821155413653804, - "detailed_name": "Foo2", - "qual_name_offset": 0, + "detailed_name": "typedef Foo Foo2", + "qual_name_offset": 12, "short_name": "Foo2", "kind": 252, - "hover": "typedef Foo Foo2", "declarations": [], "spell": "3:13-3:17|0|1|2", "extent": "3:1-3:17|0|1|0", @@ -162,14 +144,13 @@ OUTPUT: "funcs": [], "vars": [], "instances": [], - "uses": ["3:13-3:17|0|1|4", "9:14-9:18|0|1|4"] + "uses": ["9:14-9:18|0|1|4"] }, { "usr": 17897026942631673064, - "detailed_name": "Foo3", - "qual_name_offset": 0, + "detailed_name": "using Foo3 = Foo1", + "qual_name_offset": 6, "short_name": "Foo3", "kind": 252, - "hover": "using Foo3 = Foo1", "declarations": [], "spell": "4:7-4:11|0|1|2", "extent": "4:1-4:18|0|1|0", @@ -180,7 +161,7 @@ OUTPUT: "funcs": [], "vars": [], "instances": [], - "uses": ["4:7-4:11|0|1|4", "10:14-10:18|0|1|4"] + "uses": ["10:14-10:18|0|1|4"] }], "usr2var": [] } diff --git a/index_tests/usage/type_usage_typedef_and_using_template.cc b/index_tests/usage/type_usage_typedef_and_using_template.cc index 92b4f6b2..457ed587 100644 --- a/index_tests/usage/type_usage_typedef_and_using_template.cc +++ b/index_tests/usage/type_usage_typedef_and_using_template.cc @@ -8,32 +8,31 @@ typedef Foo Foo2; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [{ "usr": 1544499294580512394, - "detailed_name": "Foo1", - "qual_name_offset": 0, + "detailed_name": "using Foo1 = Foo", + "qual_name_offset": 6, "short_name": "Foo1", "kind": 252, - "hover": "using Foo1 = Foo", "declarations": [], "spell": "4:7-4:11|0|1|2", "extent": "4:1-4:22|0|1|0", - "alias_of": 10528472276654770367, + "alias_of": 0, "bases": [], "derived": [], "types": [], "funcs": [], "vars": [], "instances": [], - "uses": ["4:7-4:11|0|1|4", "5:13-5:17|0|1|4"] + "uses": ["5:13-5:17|0|1|4"] }, { "usr": 10528472276654770367, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo", + "qual_name_offset": 7, "short_name": "Foo", - "kind": 5, + "kind": 23, "declarations": ["2:8-2:11|0|1|1"], "alias_of": 0, "bases": [], @@ -45,22 +44,21 @@ OUTPUT: "uses": ["4:14-4:17|0|1|4", "5:9-5:12|0|1|4"] }, { "usr": 15933698173231330933, - "detailed_name": "Foo2", - "qual_name_offset": 0, + "detailed_name": "typedef Foo Foo2", + "qual_name_offset": 18, "short_name": "Foo2", "kind": 252, - "hover": "typedef Foo Foo2", "declarations": [], "spell": "5:19-5:23|0|1|2", "extent": "5:1-5:23|0|1|0", - "alias_of": 10528472276654770367, + "alias_of": 0, "bases": [], "derived": [], "types": [], "funcs": [], "vars": [], "instances": [], - "uses": ["5:19-5:23|0|1|4"] + "uses": [] }], "usr2var": [] } diff --git a/index_tests/usage/type_usage_various.cc b/index_tests/usage/type_usage_various.cc index dc881608..93302743 100644 --- a/index_tests/usage/type_usage_various.cc +++ b/index_tests/usage/type_usage_various.cc @@ -13,7 +13,7 @@ extern Foo foo; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 9488177941273031343, "detailed_name": "Foo *Foo::make()", @@ -21,20 +21,20 @@ OUTPUT: "short_name": "make", "kind": 6, "storage": 0, - "declarations": ["2:8-2:12|15041163540773201510|2|1"], - "spell": "5:11-5:15|15041163540773201510|2|2", - "extent": "5:1-8:2|0|1|0", - "declaring_type": 15041163540773201510, + "declarations": ["2:8-2:12|15041163540773201510|2|513"], + "spell": "5:11-5:15|15041163540773201510|2|514", + "extent": "2:3-2:14|15041163540773201510|2|0", + "declaring_type": 0, "bases": [], "derived": [], - "vars": [16380484338511689669], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], @@ -51,8 +51,8 @@ OUTPUT: }], "usr2var": [{ "usr": 14455976355866885943, - "detailed_name": "Foo foo", - "qual_name_offset": 4, + "detailed_name": "extern Foo foo", + "qual_name_offset": 11, "short_name": "foo", "declarations": ["10:12-10:15|0|1|1"], "type": 15041163540773201510, diff --git a/index_tests/usage/usage_inside_of_call.cc b/index_tests/usage/usage_inside_of_call.cc index 13229c6d..412d94c1 100644 --- a/index_tests/usage/usage_inside_of_call.cc +++ b/index_tests/usage/usage_inside_of_call.cc @@ -18,7 +18,7 @@ void foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", @@ -32,9 +32,9 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [8039186520399841081], + "vars": [], "uses": [], - "callees": ["14:3-14:9|18319417758892371313|3|32", "14:14-14:17|11404602816585117695|3|32"] + "callees": [] }, { "usr": 11404602816585117695, "detailed_name": "int gen()", @@ -47,7 +47,21 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["14:14-14:17|4259594751088586730|3|32"], + "uses": ["14:14-14:17|0|1|8228"], + "callees": [] + }, { + "usr": 15041163540773201510, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [11489549839875479478, 9648311402855509901, 11489549839875479478], + "uses": [], "callees": [] }, { "usr": 18319417758892371313, @@ -61,11 +75,11 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["14:3-14:9|4259594751088586730|3|32"], + "uses": ["14:3-14:9|0|1|8228"], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -77,12 +91,12 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [11489549839875479478, 9648311402855509901, 8039186520399841081], + "instances": [11489549839875479478, 9648311402855509901, 11489549839875479478, 8039186520399841081], "uses": [] }, { "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo {}", + "qual_name_offset": 7, "short_name": "Foo", "kind": 23, "declarations": [], @@ -96,9 +110,6 @@ OUTPUT: "vars": [{ "L": 9648311402855509901, "R": 0 - }, { - "L": 11489549839875479478, - "R": -1 }], "instances": [], "uses": ["10:5-10:8|0|1|4", "14:22-14:25|0|1|4", "14:40-14:43|0|1|4"] @@ -112,8 +123,8 @@ OUTPUT: "declarations": [], "spell": "13:7-13:8|4259594751088586730|3|2", "extent": "13:3-13:12|4259594751088586730|3|0", - "type": 17, - "uses": ["14:10-14:11|4259594751088586730|3|4"], + "type": 53, + "uses": ["14:10-14:11|4259594751088586730|3|12"], "kind": 13, "storage": 0 }, { @@ -122,25 +133,25 @@ OUTPUT: "qual_name_offset": 4, "short_name": "field_var", "declarations": [], - "spell": "7:7-7:16|15041163540773201510|2|2", + "spell": "7:7-7:16|15041163540773201510|2|514", "extent": "7:3-7:16|15041163540773201510|2|0", - "type": 17, - "uses": ["14:28-14:37|4259594751088586730|3|4"], + "type": 53, + "uses": ["14:28-14:37|15041163540773201510|2|12"], "kind": 8, "storage": 0 }, { "usr": 11489549839875479478, - "detailed_name": "int Foo::static_var", - "qual_name_offset": 4, + "detailed_name": "static int Foo::static_var", + "qual_name_offset": 11, "short_name": "static_var", "hover": "int Foo::static_var = 0", - "declarations": ["6:14-6:24|15041163540773201510|2|1"], - "spell": "10:10-10:20|15041163540773201510|2|2", - "extent": "10:1-10:24|0|1|0", - "type": 17, - "uses": ["14:45-14:55|4259594751088586730|3|4"], - "kind": 8, - "storage": 0 + "declarations": ["6:14-6:24|15041163540773201510|2|513"], + "spell": "10:10-10:20|15041163540773201510|2|514", + "extent": "6:3-6:24|15041163540773201510|2|0", + "type": 53, + "uses": ["14:45-14:55|15041163540773201510|2|12"], + "kind": 13, + "storage": 2 }] } */ diff --git a/index_tests/usage/usage_inside_of_call_simple.cc b/index_tests/usage/usage_inside_of_call_simple.cc index 483cf69c..0e84edd6 100644 --- a/index_tests/usage/usage_inside_of_call_simple.cc +++ b/index_tests/usage/usage_inside_of_call_simple.cc @@ -10,7 +10,7 @@ void foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", @@ -26,7 +26,7 @@ OUTPUT: "derived": [], "vars": [], "uses": [], - "callees": ["6:3-6:9|18319417758892371313|3|32", "6:10-6:13|11404602816585117695|3|32", "6:18-6:21|11404602816585117695|3|32"] + "callees": [] }, { "usr": 11404602816585117695, "detailed_name": "int gen()", @@ -41,7 +41,7 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["6:10-6:13|4259594751088586730|3|32", "6:18-6:21|4259594751088586730|3|32"], + "uses": ["6:10-6:13|0|1|8228", "6:18-6:21|0|1|8228"], "callees": [] }, { "usr": 18319417758892371313, @@ -55,7 +55,7 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["6:3-6:9|4259594751088586730|3|32"], + "uses": ["6:3-6:9|0|1|8228"], "callees": [] }], "usr2type": [], diff --git a/index_tests/usage/var_usage_call_function.cc b/index_tests/usage/var_usage_call_function.cc index 3e6eaeff..10bb73fe 100644 --- a/index_tests/usage/var_usage_call_function.cc +++ b/index_tests/usage/var_usage_call_function.cc @@ -11,7 +11,7 @@ void caller() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 468307235068920063, "detailed_name": "void called()", @@ -26,7 +26,7 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["4:13-4:19|11404881820527069090|3|32", "7:3-7:9|11404881820527069090|3|32"], + "uses": ["4:13-4:19|0|1|132", "7:3-7:9|0|1|8228"], "callees": [] }, { "usr": 11404881820527069090, @@ -41,22 +41,22 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [9121974011454213596], + "vars": [], "uses": [], - "callees": ["4:13-4:19|468307235068920063|3|32", "4:13-4:19|468307235068920063|3|32", "7:3-7:9|468307235068920063|3|32"] + "callees": [] }], "usr2type": [], "usr2var": [{ "usr": 9121974011454213596, - "detailed_name": "void (*)() x", - "qual_name_offset": 11, + "detailed_name": "auto x", + "qual_name_offset": 5, "short_name": "x", - "hover": "void (*)() x = &called", + "hover": "auto x = &called", "declarations": [], "spell": "4:8-4:9|11404881820527069090|3|2", "extent": "4:3-4:19|11404881820527069090|3|0", "type": 0, - "uses": ["5:3-5:4|11404881820527069090|3|4"], + "uses": ["5:3-5:4|11404881820527069090|3|8236"], "kind": 13, "storage": 0 }] diff --git a/index_tests/usage/var_usage_class_member.cc b/index_tests/usage/var_usage_class_member.cc index e8c6daff..fae2ad3d 100644 --- a/index_tests/usage/var_usage_class_member.cc +++ b/index_tests/usage/var_usage_class_member.cc @@ -21,7 +21,7 @@ void foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", @@ -35,9 +35,9 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [14669930844300034456], + "vars": [], "uses": [], - "callees": ["14:3-14:9|17175780305784503374|3|32", "15:3-15:9|17175780305784503374|3|32", "16:3-16:9|12086644540399881766|3|32", "17:3-17:9|17175780305784503374|3|32"] + "callees": [] }, { "usr": 12086644540399881766, "detailed_name": "void accept(int *)", @@ -50,7 +50,21 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["16:3-16:9|4259594751088586730|3|32"], + "uses": ["16:3-16:9|0|1|8228"], + "callees": [] + }, { + "usr": 15041163540773201510, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [4220150017963593039, 3873837747174060388], + "uses": [], "callees": [] }, { "usr": 17175780305784503374, @@ -64,11 +78,11 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["14:3-14:9|4259594751088586730|3|32", "15:3-15:9|4259594751088586730|3|32", "17:3-17:9|4259594751088586730|3|32"], + "uses": ["14:3-14:9|0|1|8228", "15:3-15:9|0|1|8228", "17:3-17:9|0|1|8228"], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -84,8 +98,8 @@ OUTPUT: "uses": [] }, { "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], @@ -112,10 +126,10 @@ OUTPUT: "qual_name_offset": 4, "short_name": "y", "declarations": [], - "spell": "4:7-4:8|15041163540773201510|2|2", + "spell": "4:7-4:8|15041163540773201510|2|514", "extent": "4:3-4:8|15041163540773201510|2|0", - "type": 17, - "uses": ["17:12-17:13|4259594751088586730|3|4"], + "type": 53, + "uses": ["17:12-17:13|15041163540773201510|2|12"], "kind": 8, "storage": 0 }, { @@ -124,10 +138,10 @@ OUTPUT: "qual_name_offset": 4, "short_name": "x", "declarations": [], - "spell": "3:7-3:8|15041163540773201510|2|2", + "spell": "3:7-3:8|15041163540773201510|2|514", "extent": "3:3-3:8|15041163540773201510|2|0", - "type": 17, - "uses": ["12:5-12:6|4259594751088586730|3|4", "13:5-13:6|4259594751088586730|3|4", "14:12-14:13|4259594751088586730|3|4", "15:12-15:13|4259594751088586730|3|4", "16:13-16:14|4259594751088586730|3|4"], + "type": 53, + "uses": ["12:5-12:6|15041163540773201510|2|20", "13:5-13:6|15041163540773201510|2|4", "14:12-14:13|15041163540773201510|2|12", "15:12-15:13|15041163540773201510|2|12", "16:13-16:14|15041163540773201510|2|132"], "kind": 8, "storage": 0 }, { diff --git a/index_tests/usage/var_usage_class_member_static.cc b/index_tests/usage/var_usage_class_member_static.cc index d9d0b08c..4dad3dd9 100644 --- a/index_tests/usage/var_usage_class_member_static.cc +++ b/index_tests/usage/var_usage_class_member_static.cc @@ -12,7 +12,7 @@ void foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", @@ -28,7 +28,21 @@ OUTPUT: "derived": [], "vars": [], "uses": [], - "callees": ["8:3-8:9|17175780305784503374|3|32"] + "callees": [] + }, { + "usr": 15041163540773201510, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [8599782646965457351], + "uses": [], + "callees": [] }, { "usr": 17175780305784503374, "detailed_name": "void accept(int)", @@ -41,11 +55,11 @@ OUTPUT: "bases": [], "derived": [], "vars": [], - "uses": ["8:3-8:9|4259594751088586730|3|32"], + "uses": ["8:3-8:9|0|1|8228"], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -61,8 +75,8 @@ OUTPUT: "uses": [] }, { "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo {}", + "qual_name_offset": 7, "short_name": "Foo", "kind": 23, "declarations": [], @@ -79,13 +93,13 @@ OUTPUT: }], "usr2var": [{ "usr": 8599782646965457351, - "detailed_name": "int Foo::x", - "qual_name_offset": 4, + "detailed_name": "static int Foo::x", + "qual_name_offset": 11, "short_name": "x", - "declarations": ["2:14-2:15|15041163540773201510|2|1"], - "type": 17, - "uses": ["8:15-8:16|4259594751088586730|3|4"], - "kind": 8, + "declarations": ["2:14-2:15|15041163540773201510|2|513"], + "type": 53, + "uses": ["8:15-8:16|15041163540773201510|2|12"], + "kind": 13, "storage": 2 }] } diff --git a/index_tests/usage/var_usage_cstyle_cast.cc b/index_tests/usage/var_usage_cstyle_cast.cc index 1d7a86cf..18372325 100644 --- a/index_tests/usage/var_usage_cstyle_cast.cc +++ b/index_tests/usage/var_usage_cstyle_cast.cc @@ -11,12 +11,26 @@ const VarType Holder::static_var; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], + "skipped_ranges": [], + "usr2func": [{ + "usr": 10028537921178202800, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [7057400933868440116, 7057400933868440116], + "uses": [], + "callees": [] + }], "usr2type": [{ "usr": 5792006888140599735, - "detailed_name": "VarType", - "qual_name_offset": 0, + "detailed_name": "enum VarType {\n}", + "qual_name_offset": 5, "short_name": "VarType", "kind": 10, "declarations": [], @@ -28,12 +42,12 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [7057400933868440116], + "instances": [7057400933868440116, 7057400933868440116], "uses": ["4:20-4:27|0|1|4", "4:42-4:49|0|1|4", "7:7-7:14|0|1|4"] }, { "usr": 10028537921178202800, - "detailed_name": "Holder", - "qual_name_offset": 0, + "detailed_name": "struct Holder {}", + "qual_name_offset": 7, "short_name": "Holder", "kind": 23, "declarations": [], @@ -44,26 +58,23 @@ OUTPUT: "derived": [], "types": [], "funcs": [], - "vars": [{ - "L": 7057400933868440116, - "R": -1 - }], + "vars": [], "instances": [], "uses": ["7:15-7:21|0|1|4"] }], "usr2var": [{ "usr": 7057400933868440116, - "detailed_name": "const VarType Holder::static_var", - "qual_name_offset": 14, + "detailed_name": "static constexpr VarType Holder::static_var", + "qual_name_offset": 25, "short_name": "static_var", - "hover": "const VarType Holder::static_var = (VarType)0x0", - "declarations": ["4:28-4:38|10028537921178202800|2|1"], - "spell": "7:23-7:33|10028537921178202800|2|2", - "extent": "7:1-7:33|0|1|0", + "hover": "static constexpr VarType Holder::static_var = (VarType)0", + "declarations": ["4:28-4:38|10028537921178202800|2|513"], + "spell": "7:23-7:33|10028537921178202800|2|514", + "extent": "4:3-4:53|10028537921178202800|2|0", "type": 5792006888140599735, "uses": [], - "kind": 8, - "storage": 0 + "kind": 13, + "storage": 2 }] } */ diff --git a/index_tests/usage/var_usage_extern.cc b/index_tests/usage/var_usage_extern.cc index 894dcadc..2dbbf1c2 100644 --- a/index_tests/usage/var_usage_extern.cc +++ b/index_tests/usage/var_usage_extern.cc @@ -7,7 +7,7 @@ void foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", @@ -26,7 +26,7 @@ OUTPUT: "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -43,12 +43,12 @@ OUTPUT: }], "usr2var": [{ "usr": 16721564935990383768, - "detailed_name": "int a", - "qual_name_offset": 4, + "detailed_name": "extern int a", + "qual_name_offset": 11, "short_name": "a", "declarations": ["1:12-1:13|0|1|1"], - "type": 17, - "uses": ["4:3-4:4|4259594751088586730|3|4"], + "type": 53, + "uses": ["4:3-4:4|0|1|20"], "kind": 13, "storage": 1 }] diff --git a/index_tests/usage/var_usage_func_parameter.cc b/index_tests/usage/var_usage_func_parameter.cc index 2b833d1a..0a97cd9b 100644 --- a/index_tests/usage/var_usage_func_parameter.cc +++ b/index_tests/usage/var_usage_func_parameter.cc @@ -5,7 +5,7 @@ void foo(int a) { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 11998306017310352355, "detailed_name": "void foo(int a)", @@ -19,12 +19,12 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [10063793875496522529], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -45,9 +45,9 @@ OUTPUT: "qual_name_offset": 4, "short_name": "a", "declarations": [], - "spell": "1:14-1:15|11998306017310352355|3|2", + "spell": "1:14-1:15|11998306017310352355|3|514", "extent": "1:10-1:15|11998306017310352355|3|0", - "type": 17, + "type": 53, "uses": ["2:3-2:4|11998306017310352355|3|4"], "kind": 253, "storage": 0 diff --git a/index_tests/usage/var_usage_local.cc b/index_tests/usage/var_usage_local.cc index 1843caba..4eb8c803 100644 --- a/index_tests/usage/var_usage_local.cc +++ b/index_tests/usage/var_usage_local.cc @@ -6,7 +6,7 @@ void foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", @@ -20,12 +20,12 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [14014650769929566957], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -48,8 +48,8 @@ OUTPUT: "declarations": [], "spell": "2:7-2:8|4259594751088586730|3|2", "extent": "2:3-2:8|4259594751088586730|3|0", - "type": 17, - "uses": ["3:3-3:4|4259594751088586730|3|4"], + "type": 53, + "uses": ["3:3-3:4|4259594751088586730|3|20"], "kind": 13, "storage": 0 }] diff --git a/index_tests/usage/var_usage_shadowed_local.cc b/index_tests/usage/var_usage_shadowed_local.cc index 11590ae2..23e465f0 100644 --- a/index_tests/usage/var_usage_shadowed_local.cc +++ b/index_tests/usage/var_usage_shadowed_local.cc @@ -11,7 +11,7 @@ void foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", @@ -25,12 +25,12 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [13311055950748663970, 14036425367303419504], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -53,8 +53,8 @@ OUTPUT: "declarations": [], "spell": "2:7-2:8|4259594751088586730|3|2", "extent": "2:3-2:8|4259594751088586730|3|0", - "type": 17, - "uses": ["3:3-3:4|4259594751088586730|3|4", "8:3-8:4|4259594751088586730|3|4"], + "type": 53, + "uses": ["3:3-3:4|4259594751088586730|3|20", "8:3-8:4|4259594751088586730|3|20"], "kind": 13, "storage": 0 }, { @@ -65,8 +65,8 @@ OUTPUT: "declarations": [], "spell": "5:9-5:10|4259594751088586730|3|2", "extent": "5:5-5:10|4259594751088586730|3|0", - "type": 17, - "uses": ["6:5-6:6|4259594751088586730|3|4"], + "type": 53, + "uses": ["6:5-6:6|4259594751088586730|3|20"], "kind": 13, "storage": 0 }] diff --git a/index_tests/usage/var_usage_shadowed_parameter.cc b/index_tests/usage/var_usage_shadowed_parameter.cc index e10ac0f1..d94f26e5 100644 --- a/index_tests/usage/var_usage_shadowed_parameter.cc +++ b/index_tests/usage/var_usage_shadowed_parameter.cc @@ -11,7 +11,7 @@ void foo(int a) { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 11998306017310352355, "detailed_name": "void foo(int a)", @@ -25,12 +25,12 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [11608231465452906059, 6997229590862003559], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -53,8 +53,8 @@ OUTPUT: "declarations": [], "spell": "4:9-4:10|11998306017310352355|3|2", "extent": "4:5-4:10|11998306017310352355|3|0", - "type": 17, - "uses": ["5:5-5:6|11998306017310352355|3|4"], + "type": 53, + "uses": ["5:5-5:6|11998306017310352355|3|20"], "kind": 13, "storage": 0 }, { @@ -63,10 +63,10 @@ OUTPUT: "qual_name_offset": 4, "short_name": "a", "declarations": [], - "spell": "1:14-1:15|11998306017310352355|3|2", + "spell": "1:14-1:15|11998306017310352355|3|514", "extent": "1:10-1:15|11998306017310352355|3|0", - "type": 17, - "uses": ["2:3-2:4|11998306017310352355|3|4", "7:3-7:4|11998306017310352355|3|4"], + "type": 53, + "uses": ["2:3-2:4|11998306017310352355|3|20", "7:3-7:4|11998306017310352355|3|20"], "kind": 253, "storage": 0 }] diff --git a/index_tests/usage/var_usage_static.cc b/index_tests/usage/var_usage_static.cc index 9b4661a9..aaee2226 100644 --- a/index_tests/usage/var_usage_static.cc +++ b/index_tests/usage/var_usage_static.cc @@ -8,7 +8,7 @@ void foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", @@ -27,7 +27,7 @@ OUTPUT: "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -44,14 +44,14 @@ OUTPUT: }], "usr2var": [{ "usr": 11823161916242867318, - "detailed_name": "int a", - "qual_name_offset": 4, + "detailed_name": "static int a", + "qual_name_offset": 0, "short_name": "a", "declarations": [], "spell": "1:12-1:13|0|1|2", "extent": "1:1-1:13|0|1|0", - "type": 17, - "uses": ["4:3-4:4|4259594751088586730|3|4"], + "type": 53, + "uses": ["4:3-4:4|0|1|20"], "kind": 13, "storage": 2 }] diff --git a/index_tests/vars/class_member.cc b/index_tests/vars/class_member.cc index 191c62ca..408ed566 100644 --- a/index_tests/vars/class_member.cc +++ b/index_tests/vars/class_member.cc @@ -5,12 +5,26 @@ class Foo { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], + "skipped_ranges": [], + "usr2func": [{ + "usr": 15041163540773201510, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [13799811842374292251], + "uses": [], + "callees": [] + }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], @@ -34,7 +48,7 @@ OUTPUT: "qual_name_offset": 5, "short_name": "member", "declarations": [], - "spell": "2:8-2:14|15041163540773201510|2|2", + "spell": "2:8-2:14|15041163540773201510|2|514", "extent": "2:3-2:14|15041163540773201510|2|0", "type": 15041163540773201510, "uses": [], diff --git a/index_tests/vars/class_static_member.cc b/index_tests/vars/class_static_member.cc index 0dfb2dc9..3e6689ce 100644 --- a/index_tests/vars/class_static_member.cc +++ b/index_tests/vars/class_static_member.cc @@ -7,12 +7,26 @@ Foo* Foo::member = nullptr; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], + "skipped_ranges": [], + "usr2func": [{ + "usr": 15041163540773201510, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [5844987037615239736, 5844987037615239736], + "uses": [], + "callees": [] + }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], @@ -23,26 +37,23 @@ OUTPUT: "derived": [], "types": [], "funcs": [], - "vars": [{ - "L": 5844987037615239736, - "R": -1 - }], - "instances": [5844987037615239736], + "vars": [], + "instances": [5844987037615239736, 5844987037615239736], "uses": ["2:10-2:13|0|1|4", "4:1-4:4|0|1|4", "4:6-4:9|0|1|4"] }], "usr2var": [{ "usr": 5844987037615239736, - "detailed_name": "Foo *Foo::member", - "qual_name_offset": 5, + "detailed_name": "static Foo *Foo::member", + "qual_name_offset": 12, "short_name": "member", "hover": "Foo *Foo::member = nullptr", - "declarations": ["2:15-2:21|15041163540773201510|2|1"], - "spell": "4:11-4:17|15041163540773201510|2|2", - "extent": "4:1-4:27|0|1|0", + "declarations": ["2:15-2:21|15041163540773201510|2|513"], + "spell": "4:11-4:17|15041163540773201510|2|514", + "extent": "2:3-2:21|15041163540773201510|2|0", "type": 15041163540773201510, "uses": [], - "kind": 8, - "storage": 0 + "kind": 13, + "storage": 2 }] } */ diff --git a/index_tests/vars/class_static_member_decl_only.cc b/index_tests/vars/class_static_member_decl_only.cc index 61a74165..694d8bc9 100644 --- a/index_tests/vars/class_static_member_decl_only.cc +++ b/index_tests/vars/class_static_member_decl_only.cc @@ -5,10 +5,24 @@ class Foo { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], - "usr2func": [], + "skipped_ranges": [], + "usr2func": [{ + "usr": 15041163540773201510, + "detailed_name": "", + "qual_name_offset": 0, + "short_name": "", + "kind": 0, + "storage": 0, + "declarations": [], + "declaring_type": 0, + "bases": [], + "derived": [], + "vars": [5844987037615239736], + "uses": [], + "callees": [] + }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -24,8 +38,8 @@ OUTPUT: "uses": [] }, { "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], @@ -42,13 +56,13 @@ OUTPUT: }], "usr2var": [{ "usr": 5844987037615239736, - "detailed_name": "int Foo::member", - "qual_name_offset": 4, + "detailed_name": "static int Foo::member", + "qual_name_offset": 11, "short_name": "member", - "declarations": ["2:14-2:20|15041163540773201510|2|1"], - "type": 17, + "declarations": ["2:14-2:20|15041163540773201510|2|513"], + "type": 53, "uses": [], - "kind": 8, + "kind": 13, "storage": 2 }] } diff --git a/index_tests/vars/deduce_auto_type.cc b/index_tests/vars/deduce_auto_type.cc index be3796f7..9848e6e2 100644 --- a/index_tests/vars/deduce_auto_type.cc +++ b/index_tests/vars/deduce_auto_type.cc @@ -8,7 +8,7 @@ void f() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 880549676430489861, "detailed_name": "void f()", @@ -22,14 +22,14 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [10601729374837386290, 18422884837902130475], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "class Foo {}", + "qual_name_offset": 6, "short_name": "Foo", "kind": 5, "declarations": [], @@ -41,28 +41,28 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [10601729374837386290, 18422884837902130475], + "instances": [18422884837902130475], "uses": ["3:16-3:19|0|1|4", "4:17-4:20|0|1|4"] }], "usr2var": [{ "usr": 10601729374837386290, - "detailed_name": "Foo *x", + "detailed_name": "auto x", "qual_name_offset": 5, "short_name": "x", - "hover": "Foo *x = new Foo()", + "hover": "auto x = new Foo()", "declarations": [], "spell": "3:8-3:9|880549676430489861|3|2", "extent": "3:3-3:21|880549676430489861|3|0", - "type": 15041163540773201510, + "type": 0, "uses": [], "kind": 13, "storage": 0 }, { "usr": 18422884837902130475, - "detailed_name": "Foo *y", - "qual_name_offset": 5, + "detailed_name": "auto *y", + "qual_name_offset": 6, "short_name": "y", - "hover": "Foo *y = new Foo()", + "hover": "auto *y = new Foo()", "declarations": [], "spell": "4:9-4:10|880549676430489861|3|2", "extent": "4:3-4:22|880549676430489861|3|0", diff --git a/index_tests/vars/function_local.cc b/index_tests/vars/function_local.cc index d68ab382..dd9b4cf9 100644 --- a/index_tests/vars/function_local.cc +++ b/index_tests/vars/function_local.cc @@ -8,7 +8,7 @@ void foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", @@ -22,14 +22,14 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [13198746475679542317], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo", + "qual_name_offset": 7, "short_name": "Foo", "kind": 23, "declarations": ["1:8-1:11|0|1|1"], diff --git a/index_tests/vars/function_param.cc b/index_tests/vars/function_param.cc index ca65c7d3..2e27fe01 100644 --- a/index_tests/vars/function_param.cc +++ b/index_tests/vars/function_param.cc @@ -6,7 +6,7 @@ void foo(Foo* p0, Foo* p1) {} OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 8908726657907936744, "detailed_name": "void foo(Foo *p0, Foo *p1)", @@ -20,14 +20,14 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [8730439006497971620, 2525014371090380500], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ "usr": 15041163540773201510, - "detailed_name": "Foo", - "qual_name_offset": 0, + "detailed_name": "struct Foo", + "qual_name_offset": 7, "short_name": "Foo", "kind": 23, "declarations": ["1:8-1:11|0|1|1"], @@ -46,7 +46,7 @@ OUTPUT: "qual_name_offset": 5, "short_name": "p1", "declarations": [], - "spell": "3:24-3:26|8908726657907936744|3|2", + "spell": "3:24-3:26|8908726657907936744|3|514", "extent": "3:19-3:26|8908726657907936744|3|0", "type": 15041163540773201510, "uses": [], @@ -58,7 +58,7 @@ OUTPUT: "qual_name_offset": 5, "short_name": "p0", "declarations": [], - "spell": "3:15-3:17|8908726657907936744|3|2", + "spell": "3:15-3:17|8908726657907936744|3|514", "extent": "3:10-3:17|8908726657907936744|3|0", "type": 15041163540773201510, "uses": [], diff --git a/index_tests/vars/function_param_unnamed.cc b/index_tests/vars/function_param_unnamed.cc index c6378208..99b79d87 100644 --- a/index_tests/vars/function_param_unnamed.cc +++ b/index_tests/vars/function_param_unnamed.cc @@ -3,7 +3,7 @@ void foo(int, int) {} OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 2747674671862363334, "detailed_name": "void foo(int, int)", diff --git a/index_tests/vars/function_shadow_local.cc b/index_tests/vars/function_shadow_local.cc index e5673809..38e22362 100644 --- a/index_tests/vars/function_shadow_local.cc +++ b/index_tests/vars/function_shadow_local.cc @@ -11,7 +11,7 @@ void foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4259594751088586730, "detailed_name": "void foo()", @@ -25,12 +25,12 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [1894874819807168345, 4508045017817092115], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -53,8 +53,8 @@ OUTPUT: "declarations": [], "spell": "2:7-2:8|4259594751088586730|3|2", "extent": "2:3-2:8|4259594751088586730|3|0", - "type": 17, - "uses": ["3:3-3:4|4259594751088586730|3|4", "8:3-8:4|4259594751088586730|3|4"], + "type": 53, + "uses": ["3:3-3:4|4259594751088586730|3|20", "8:3-8:4|4259594751088586730|3|20"], "kind": 13, "storage": 0 }, { @@ -65,8 +65,8 @@ OUTPUT: "declarations": [], "spell": "5:9-5:10|4259594751088586730|3|2", "extent": "5:5-5:10|4259594751088586730|3|0", - "type": 17, - "uses": ["6:5-6:6|4259594751088586730|3|4"], + "type": 53, + "uses": ["6:5-6:6|4259594751088586730|3|20"], "kind": 13, "storage": 0 }] diff --git a/index_tests/vars/function_shadow_param.cc b/index_tests/vars/function_shadow_param.cc index 7aac0a2c..ecfdec49 100644 --- a/index_tests/vars/function_shadow_param.cc +++ b/index_tests/vars/function_shadow_param.cc @@ -5,7 +5,7 @@ void foo(int p) { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 11998306017310352355, "detailed_name": "void foo(int p)", @@ -19,12 +19,12 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [5875271969926422921, 11404600766177939811], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -45,9 +45,9 @@ OUTPUT: "qual_name_offset": 4, "short_name": "p", "declarations": [], - "spell": "1:14-1:15|11998306017310352355|3|2", + "spell": "1:14-1:15|11998306017310352355|3|514", "extent": "1:10-1:15|11998306017310352355|3|0", - "type": 17, + "type": 53, "uses": [], "kind": 253, "storage": 0 @@ -60,7 +60,7 @@ OUTPUT: "declarations": [], "spell": "2:9-2:10|11998306017310352355|3|2", "extent": "2:5-2:14|11998306017310352355|3|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 0 diff --git a/index_tests/vars/global_variable.cc b/index_tests/vars/global_variable.cc index 24f01ca4..c76dd406 100644 --- a/index_tests/vars/global_variable.cc +++ b/index_tests/vars/global_variable.cc @@ -3,10 +3,10 @@ static int global = 0; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -23,14 +23,14 @@ OUTPUT: }], "usr2var": [{ "usr": 6834525061342585382, - "detailed_name": "int global", - "qual_name_offset": 4, + "detailed_name": "static int global", + "qual_name_offset": 11, "short_name": "global", - "hover": "int global = 0", + "hover": "static int global = 0", "declarations": [], "spell": "1:12-1:18|0|1|2", "extent": "1:1-1:22|0|1|0", - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 2 diff --git a/index_tests/vars/global_variable_decl_only.cc b/index_tests/vars/global_variable_decl_only.cc index a7d88372..8ca10b9e 100644 --- a/index_tests/vars/global_variable_decl_only.cc +++ b/index_tests/vars/global_variable_decl_only.cc @@ -3,10 +3,10 @@ extern int global; OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [], "usr2type": [{ - "usr": 17, + "usr": 53, "detailed_name": "", "qual_name_offset": 0, "short_name": "", @@ -23,11 +23,11 @@ OUTPUT: }], "usr2var": [{ "usr": 9937941849651546906, - "detailed_name": "int global", - "qual_name_offset": 4, + "detailed_name": "extern int global", + "qual_name_offset": 11, "short_name": "global", "declarations": ["1:12-1:18|0|1|1"], - "type": 17, + "type": 53, "uses": [], "kind": 13, "storage": 1 diff --git a/index_tests/vars/type_instance_on_using_type.cc b/index_tests/vars/type_instance_on_using_type.cc index 055024e1..50004c7f 100644 --- a/index_tests/vars/type_instance_on_using_type.cc +++ b/index_tests/vars/type_instance_on_using_type.cc @@ -10,7 +10,7 @@ void Foo() { OUTPUT: { "includes": [], - "skipped_by_preprocessor": [], + "skipped_ranges": [], "usr2func": [{ "usr": 4654328188330986029, "detailed_name": "void Foo()", @@ -24,14 +24,14 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [6975456769752895964], + "vars": [], "uses": [], "callees": [] }], "usr2type": [{ "usr": 4750332761459066907, - "detailed_name": "S", - "qual_name_offset": 0, + "detailed_name": "struct S {}", + "qual_name_offset": 7, "short_name": "S", "kind": 23, "declarations": [], @@ -47,11 +47,10 @@ OUTPUT: "uses": ["2:11-2:12|0|1|4"] }, { "usr": 7434820806199665424, - "detailed_name": "F", - "qual_name_offset": 0, + "detailed_name": "using F = S", + "qual_name_offset": 6, "short_name": "F", "kind": 252, - "hover": "using F = S", "declarations": [], "spell": "2:7-2:8|0|1|2", "extent": "2:1-2:12|0|1|0", @@ -62,7 +61,7 @@ OUTPUT: "funcs": [], "vars": [], "instances": [6975456769752895964], - "uses": ["2:7-2:8|0|1|4", "4:3-4:4|0|1|4"] + "uses": ["4:3-4:4|0|1|4"] }], "usr2var": [{ "usr": 6975456769752895964, diff --git a/src/file_consumer.cc b/src/file_consumer.cc index b32a8ed5..928d36b5 100644 --- a/src/file_consumer.cc +++ b/src/file_consumer.cc @@ -95,25 +95,16 @@ FileConsumer::FileConsumer(VFS* vfs, const std::string& parse_file) IndexFile* FileConsumer::TryConsumeFile( const clang::FileEntry& File, std::unordered_map* file_contents_map) { - std::string file_name = FileName(File); - if (!File.isValid()) { - if (!file_name.empty()) { - LOG_S(ERROR) << "Could not get unique file id for " << file_name - << " when parsing " << parse_file_; - } - return nullptr; - } - - // Try to find cached local result. - unsigned UID = File.getUID(); - auto it = local_.find(UID); + auto UniqueID = File.getUniqueID(); + auto it = local_.find(UniqueID); if (it != local_.end()) return it->second.get(); + std::string file_name = FileName(File); // We did not take the file from global. Cache that we failed so we don't try // again and return nullptr. if (!vfs_->Mark(file_name, thread_id_, 2)) { - local_[UID] = nullptr; + local_[UniqueID] = nullptr; return nullptr; } @@ -124,8 +115,8 @@ IndexFile* FileConsumer::TryConsumeFile( return nullptr; // Build IndexFile instance. - local_[UID] = std::make_unique(UID, file_name, *contents); - return local_[UID].get(); + local_[UniqueID] = std::make_unique(UniqueID, file_name, *contents); + return local_[UniqueID].get(); } std::vector> FileConsumer::TakeLocalState() { diff --git a/src/file_consumer.h b/src/file_consumer.h index 0697f3b9..5fb8e260 100644 --- a/src/file_consumer.h +++ b/src/file_consumer.h @@ -8,8 +8,8 @@ #include #include +#include #include -#include #include struct IndexFile; @@ -66,7 +66,7 @@ struct FileConsumer { std::vector> TakeLocalState(); private: - std::unordered_map> local_; + std::map> local_; VFS* vfs_; std::string parse_file_; int thread_id_; diff --git a/src/indexer.cc b/src/indexer.cc index 9e2a2034..90512fa5 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -23,16 +23,17 @@ using llvm::Timer; #include #include #include +#include #include #include namespace { struct IndexParam { - llvm::DenseSet SeenUID; - std::vector seen_files; + std::map SeenUniqueID; std::unordered_map file_contents; std::unordered_map file2write_time; + llvm::DenseMap Decl2usr; // Only use this when strictly needed (ie, primary translation unit is // needed). Most logic should get the IndexFile instance via @@ -43,39 +44,42 @@ struct IndexParam { IndexFile* primary_file = nullptr; ASTUnit& Unit; + ASTContext* Ctx; FileConsumer* file_consumer = nullptr; NamespaceHelper ns; IndexParam(ASTUnit& Unit, FileConsumer* file_consumer) : Unit(Unit), file_consumer(file_consumer) {} + + IndexFile *ConsumeFile(const FileEntry &File) { + IndexFile *db = + file_consumer->TryConsumeFile(File, &file_contents); + + // If this is the first time we have seen the file (ignoring if we are + // generating an index for it): + auto it = SeenUniqueID.try_emplace(File.getUniqueID()); + if (it.second) { + std::string file_name = FileName(File); + // Add to all files we have seen so we can generate proper dependency + // graph. + it.first->second = file_name; + + // Set modification time. + std::optional write_time = LastWriteTime(file_name); + LOG_IF_S(ERROR, !write_time) + << "failed to fetch write time for " << file_name; + if (write_time) + file2write_time[file_name] = *write_time; + } + + return db; + } }; -IndexFile *ConsumeFile(IndexParam ¶m, const FileEntry &File) { - IndexFile *db = - param.file_consumer->TryConsumeFile(File, ¶m.file_contents); - - // If this is the first time we have seen the file (ignoring if we are - // generating an index for it): - if (param.SeenUID.insert(File.getUID()).second) { - std::string file_name = FileName(File); - // Add to all files we have seen so we can generate proper dependency - // graph. - param.seen_files.push_back(file_name); - - // Set modification time. - std::optional write_time = LastWriteTime(file_name); - LOG_IF_S(ERROR, !write_time) - << "failed to fetch write time for " << file_name; - if (write_time) - param.file2write_time[file_name] = *write_time; - } - - return db; -} - Range FromSourceRange(const SourceManager &SM, const LangOptions &LangOpts, - SourceRange R, unsigned *UID, bool token) { + SourceRange R, llvm::sys::fs::UniqueID *UniqueID, + bool token) { SourceLocation BLoc = R.getBegin(), ELoc = R.getEnd(); std::pair BInfo = SM.getDecomposedLoc(BLoc); std::pair EInfo = SM.getDecomposedLoc(ELoc); @@ -89,38 +93,29 @@ Range FromSourceRange(const SourceManager &SM, const LangOptions &LangOpts, if (c0 > INT16_MAX) c0 = 0; if (l1 > INT16_MAX) l1 = 0; if (c1 > INT16_MAX) c1 = 0; - if (UID) { + if (UniqueID) { if (const FileEntry *F = SM.getFileEntryForID(BInfo.first)) - *UID = F->getUID(); + *UniqueID = F->getUniqueID(); else - *UID = 0; + *UniqueID = llvm::sys::fs::UniqueID(0, 0); } return {{int16_t(l0), int16_t(c0)}, {int16_t(l1), int16_t(c1)}}; } Range FromCharRange(const SourceManager &SM, const LangOptions &LangOpts, - SourceRange R) { - return FromSourceRange(SM, LangOpts, R, nullptr, false); + SourceRange R, + llvm::sys::fs::UniqueID *UniqueID = nullptr) { + return FromSourceRange(SM, LangOpts, R, UniqueID, false); } Range FromTokenRange(const SourceManager &SM, const LangOptions &LangOpts, - SourceRange R, unsigned *UID = nullptr) { - return FromSourceRange(SM, LangOpts, R, UID, true); + SourceRange R, + llvm::sys::fs::UniqueID *UniqueID = nullptr) { + return FromSourceRange(SM, LangOpts, R, UniqueID, true); } -Position ResolveSourceLocation(const SourceManager &SM, SourceLocation Loc, - FileID *F = nullptr) { - std::pair D = SM.getDecomposedLoc(Loc); - if (F) - *F = D.first; - unsigned line = SM.getLineNumber(D.first, D.second) - 1; - unsigned col = SM.getColumnNumber(D.first, D.second) - 1; - return {int16_t(line > INT16_MAX ? 0 : line), - int16_t(col > INT16_MAX ? 0 : col)}; -} - -SymbolKind GetSymbolKind(const Decl& D) { - switch (D.getKind()) { +SymbolKind GetSymbolKind(const Decl* D) { + switch (D->getKind()) { case Decl::TranslationUnit: return SymbolKind::File; case Decl::FunctionTemplate: @@ -137,6 +132,7 @@ SymbolKind GetSymbolKind(const Decl& D) { case Decl::Enum: case Decl::Record: case Decl::CXXRecord: + case Decl::ClassTemplateSpecialization: case Decl::TypeAlias: case Decl::Typedef: case Decl::UnresolvedUsingTypename: @@ -157,6 +153,7 @@ const Decl* GetTypeDecl(QualType T) { Decl *D = nullptr; const Type *TP; for(;;) { + T = T.getUnqualifiedType(); TP = T.getTypePtrOrNull(); if (!TP) return D; @@ -266,9 +263,9 @@ const Decl* GetSpecialized(const Decl* D) { } class IndexDataConsumer : public index::IndexDataConsumer { +public: ASTContext *Ctx; IndexParam& param; - llvm::DenseMap Decl2usr; std::string GetComment(const Decl* D) { SourceManager &SM = Ctx->getSourceManager(); @@ -322,77 +319,23 @@ class IndexDataConsumer : public index::IndexDataConsumer { return ret; } - Usr GetUsr(const Decl* D) { + Usr GetUsr(const Decl* D) const { D = D->getCanonicalDecl(); - auto R = Decl2usr.try_emplace(D); + auto R = param.Decl2usr.try_emplace(D); if (R.second) { SmallString<256> USR; index::generateUSRForDecl(D, USR); - R.first->second = HashUsr({USR.data(), USR.size()}); + R.first->second = HashUsr(USR); } return R.first->second; } - template - void SetName(const Decl *D, std::string_view short_name, - std::string_view qualified, Def &def, - PrintingPolicy *Policy = nullptr) { - SmallString<256> Str; - llvm::raw_svector_ostream OS(Str); - if (Policy) { - D->print(OS, *Policy); - } else { - PrintingPolicy PP(Ctx->getLangOpts()); - PP.AnonymousTagLocations = false; - PP.TerseOutput = true; - // PP.PolishForDeclaration = true; - PP.ConstantsAsWritten = true; - PP.SuppressTagKeyword = false; - PP.FullyQualifiedName = false; - D->print(OS, PP); - } - - std::string name = OS.str(); - for (std::string::size_type i = 0;;) { - if ((i = name.find("(anonymous ", i)) == std::string::npos) - break; - i++; - if (name.size() > 10 + 9 && name.compare(10, 9, "namespace")) - name.replace(i, 10 + 9, "anon ns"); - else - name.replace(i, 10, "anon"); - } - auto i = name.find(short_name); - if (i == std::string::npos) { - // e.g. operator type-parameter-1 - i = 0; - def.short_name_offset = 0; - } else if (short_name.size()) { - name.replace(i, short_name.size(), qualified); - def.short_name_offset = i + qualified.size() - short_name.size(); - } else { - def.short_name_offset = i; - } - def.short_name_size = short_name.size(); - for (int paren = 0; i; i--) { - // Skip parentheses in "(anon struct)::name" - if (name[i - 1] == ')') - paren++; - else if (name[i - 1] == '(') - paren--; - else if (!(paren > 0 || isalnum(name[i - 1]) || - name[i - 1] == '_' || name[i - 1] == ':')) - break; - } - def.qual_name_offset = i; - def.detailed_name = Intern(name); - } - - Use GetUse(IndexFile* db, Range range, const DeclContext *DC, Role role) { + Use GetUse(IndexFile *db, Range range, const DeclContext *DC, + Role role) const { if (!DC) return Use{{range, 0, SymbolKind::File, role}}; const Decl *D = cast(DC); - switch (GetSymbolKind(*D)) { + switch (GetSymbolKind(D)) { case SymbolKind::Func: return Use{{range, db->ToFunc(GetUsr(D)).usr, SymbolKind::Func, role}}; case SymbolKind::Type: @@ -404,10 +347,91 @@ class IndexDataConsumer : public index::IndexDataConsumer { } } + PrintingPolicy GetDefaultPolicy() const { + PrintingPolicy PP(Ctx->getLangOpts()); + PP.AnonymousTagLocations = false; + PP.TerseOutput = true; + PP.PolishForDeclaration = true; + PP.ConstantsAsWritten = true; + PP.SuppressTagKeyword = true; + PP.SuppressInitializers = true; + PP.FullyQualifiedName = false; + return PP; + } + + static void SimplifyAnonymous(std::string& name) { + for (std::string::size_type i = 0;;) { + if ((i = name.find("(anonymous ", i)) == std::string::npos) + break; + i++; + if (name.size() - i > 19 && name.compare(i + 10, 9, "namespace") == 0) + name.replace(i, 19, "anon ns"); + else + name.replace(i, 9, "anon"); + } + } + + template + void SetName(const Decl *D, std::string_view short_name, + std::string_view qualified, Def &def, bool hover = false) { + SmallString<256> Str; + llvm::raw_svector_ostream OS(Str); + PrintingPolicy PP = GetDefaultPolicy(); + if (hover) + PP.SuppressInitializers = false; + D->print(OS, PP); + + std::string name = OS.str(); + SimplifyAnonymous(name); + auto i = name.find(short_name); + if (i == std::string::npos) { + // e.g. operator type-parameter-1 + i = 0; + if (!hover) + def.short_name_offset = 0; + } else if (short_name.size()) { + name.replace(i, short_name.size(), qualified); + if (!hover) + def.short_name_offset = i + qualified.size() - short_name.size(); + } else { + if (!hover) + def.short_name_offset = i; + } + if (hover) { + if (name != def.detailed_name) + def.hover = Intern(name); + } else { + def.short_name_size = short_name.size(); + for (int paren = 0; i; i--) { + // Skip parentheses in "(anon struct)::name" + if (name[i - 1] == ')') + paren++; + else if (name[i - 1] == '(') + paren--; + else if (!(paren > 0 || isalnum(name[i - 1]) || name[i - 1] == '_' || + name[i - 1] == ':')) + break; + } + def.qual_name_offset = i; + def.detailed_name = Intern(name); + } + } + + void AddMacroUse(SourceManager &SM, std::vector &uses, + SourceLocation Spell) const { + const FileEntry *FE = SM.getFileEntryForID(SM.getFileID(Spell)); + if (FE) { + IndexFile *db = param.ConsumeFile(*FE); + Range spell = + FromTokenRange(SM, Ctx->getLangOpts(), SourceRange(Spell, Spell)); + uses.push_back(GetUse(db, spell, nullptr, Role::Dynamic)); + } + } + public: IndexDataConsumer(IndexParam& param) : param(param) {} void initialize(ASTContext &Ctx) override { - this->Ctx = &Ctx; + this->Ctx = param.Ctx = &Ctx; } bool handleDeclOccurence(const Decl *D, index::SymbolRoleSet Roles, ArrayRef Relations, @@ -430,22 +454,24 @@ public: } #endif SourceLocation Spell = SM.getSpellingLoc(Loc); - Range spell = FromTokenRange(SM, Ctx->getLangOpts(), SourceRange(Spell, Spell)); - const FileEntry *FE = SM.getFileEntryForID(SM.getFileID(Spell)); + Loc = SM.getFileLoc(Loc); + Range loc = FromTokenRange(SM, Ctx->getLangOpts(), SourceRange(Loc, Loc)); + const FileEntry *FE = SM.getFileEntryForID(SM.getFileID(Loc)); if (!FE) { + // TODO #if LLVM_VERSION_MAJOR < 7 auto P = SM.getExpansionRange(Loc); - spell = FromCharRange(SM, Ctx->getLangOpts(), SourceRange(P.first, P.second)); + loc = FromCharRange(SM, Ctx->getLangOpts(), SourceRange(P.first, P.second)); FE = SM.getFileEntryForID(SM.getFileID(P.first)); #else auto R = SM.getExpansionRange(Loc); - spell = FromTokenRange(SM, Ctx->getLangOpts(), R.getAsRange()); + loc = FromTokenRange(SM, Ctx->getLangOpts(), R.getAsRange()); FE = SM.getFileEntryForID(SM.getFileID(R.getBegin())); #endif if (!FE) return true; } - IndexFile *db = ConsumeFile(param, *FE); + IndexFile *db = param.ConsumeFile(*FE); if (!db) return true; @@ -463,13 +489,33 @@ public: if (auto* ND = dyn_cast(D)) { short_name = ND->getNameAsString(); qualified = ND->getQualifiedNameAsString(); + SimplifyAnonymous(qualified); } IndexFunc *func = nullptr; IndexType *type = nullptr; IndexVar *var = nullptr; - SymbolKind kind = GetSymbolKind(*D); + SymbolKind kind = GetSymbolKind(D); Usr usr = GetUsr(D); + + auto do_def_decl = [&](auto *entity) { + if (!entity->def.detailed_name[0]) { + SetName(D, short_name, qualified, entity->def); + if (g_config->index.comments) + entity->def.comments = Intern(GetComment(D)); + } + if (is_def) { + entity->def.spell = GetUse(db, loc, LexDC, role); + // extent may come from a declaration. + entity->def.extent = GetUse(db, extent, LexDC, Role::None); + } else if (is_decl) { + entity->declarations.push_back(GetUse(db, loc, LexDC, role)); + } else { + entity->uses.push_back(GetUse(db, loc, LexDC, role)); + } + if (Spell != Loc) + AddMacroUse(SM, entity->uses, Spell); + }; switch (kind) { case SymbolKind::Invalid: LOG_S(INFO) << "Unhandled " << int(D->getKind()); @@ -478,63 +524,65 @@ public: return true; case SymbolKind::Func: func = &db->ToFunc(usr); - if (!func->def.detailed_name[0]) { - SetName(D, short_name, qualified, func->def); - if (g_config->index.comments) - func->def.comments = Intern(GetComment(D)); + do_def_decl(func); + if (is_def || is_decl) { + const Decl* DC = cast(SemDC); + if (GetSymbolKind(DC) == SymbolKind::Type) + db->ToType(GetUsr(DC)).def.funcs.push_back(usr); } - if (is_def || (is_decl && !func->def.spell)) { - if (func->def.spell) - func->declarations.push_back(*func->def.spell); - func->def.spell = GetUse(db, spell, LexDC, role); - func->def.extent = GetUse(db, extent, LexDC, Role::None); - if (auto *FD = dyn_cast(D)) { - DeclarationNameInfo Info = FD->getNameInfo(); - func->def.spell = GetUse( - db, FromTokenRange(SM, Ctx->getLangOpts(), Info.getSourceRange()), - LexDC, role); - } - } else - func->uses.push_back(GetUse(db, spell, LexDC, role)); break; case SymbolKind::Type: type = &db->ToType(usr); - if (!type->def.detailed_name[0]) { - SetName(D, short_name, qualified, type->def); - if (g_config->index.comments) - type->def.comments = Intern(GetComment(D)); + do_def_decl(type); + if (is_def || is_decl) { + const Decl* DC = cast(SemDC); + if (GetSymbolKind(DC) == SymbolKind::Type) + db->ToType(GetUsr(DC)).def.types.push_back(usr); } - if (is_def || (is_decl && !type->def.spell)) { - if (type->def.spell) - type->declarations.push_back(*type->def.spell); - type->def.spell = GetUse(db, spell, LexDC, role); - type->def.extent = GetUse(db, extent, LexDC, Role::None); - } else - type->uses.push_back(GetUse(db, spell, LexDC, role)); break; case SymbolKind::Var: var = &db->ToVar(usr); - if (!var->def.detailed_name[0]) { - SetName(D, short_name, qualified, var->def); - if (g_config->index.comments) - var->def.comments = Intern(GetComment(D)); - } - if (is_def || (is_decl && !var->def.spell)) { - if (var->def.spell) - var->declarations.push_back(*var->def.spell); - var->def.spell = GetUse(db, spell, LexDC, role); - var->def.extent = GetUse(db, extent, LexDC, Role::None); + do_def_decl(var); + if (is_def || is_decl) { + const Decl* DC = cast(SemDC); + if (GetSymbolKind(DC) == SymbolKind::Type) + db->ToFunc(GetUsr(DC)).def.vars.push_back(usr); + else if (auto *ND = dyn_cast(SemDC)) + db->ToType(GetUsr(ND)).def.vars.emplace_back(usr, -1); + QualType T; if (auto *VD = dyn_cast(D)) { var->def.storage = VD->getStorageClass(); - QualType T = VD->getType(); - for (const Decl* D1 = GetTypeDecl(T); D1; D1 = GetSpecialized(D1)) { - Usr usr1 = GetUsr(D1); - if (db->usr2type.count(usr1)) - var->def.type = usr1; + T = VD->getType(); + // O(n^2) + for (auto I : VD->redecls()) + if (I->hasInit()) { + // TODO missing "static" in definition + SetName(I, short_name, qualified, var->def, true); + break; + } + } else if (auto *FD = dyn_cast(D)) { + T = FD->getType(); + if (FD->hasInClassInitializer()) + SetName(D, short_name, qualified, var->def, true); + } + if (!T.isNull()) { + if (auto *BT = T->getAs()) { + Usr usr1 = static_cast(BT->getKind()); + var->def.type = usr1; + db->ToType(usr1).instances.push_back(usr); + } else { + for (const Decl *D1 = GetTypeDecl(T); D1; D1 = GetSpecialized(D1)) { + Usr usr1 = GetUsr(D1); + auto it = db->usr2type.find(usr1); + if (it != db->usr2type.end()) { + var->def.type = usr1; + it->second.instances.push_back(usr); + break; + } + } } } - } else - var->uses.push_back(GetUse(db, spell, LexDC, role)); + } break; } @@ -555,11 +603,37 @@ public: case Decl::Enum: type->def.kind = lsSymbolKind::Enum; break; - case Decl::Record: - case Decl::CXXRecord: - type->def.kind = lsSymbolKind::Struct; + case Decl::CXXRecord: { + auto *RD = cast(D); + if (is_def && RD->hasDefinition()) { + for (const CXXBaseSpecifier &Base : RD->bases()) { + QualType T = Base.getType(); + const NamedDecl *BaseD = nullptr; + if (auto *TDT = T->getAs()) { + BaseD = TDT->getDecl(); + } else if (auto *TST = T->getAs()) { + BaseD = TST->getTemplateName().getAsTemplateDecl(); + } else if (auto *RT = T->getAs()) { + BaseD = RT->getDecl(); + } + if (BaseD) { + Usr usr1 = GetUsr(BaseD); + auto it = db->usr2type.find(usr1); + if (it != db->usr2type.end()) { + type->def.bases.push_back(usr1); + it->second.derived.push_back(usr); + } + } + } + } + } + [[fallthrough]]; + case Decl::Record: { + auto *RD = cast(D); + // spec has no Union, use Class + type->def.kind = RD->getTagKind() == TTK_Struct ? lsSymbolKind::Struct + : lsSymbolKind::Class; if (is_def) { - auto *RD = cast(D); bool can_get_offset = RD->isCompleteDefinition() && !RD->isDependentType(); for (FieldDecl *FD : RD->fields()) @@ -567,6 +641,7 @@ public: GetUsr(FD), can_get_offset ? Ctx->getFieldOffset(FD) : -1); } break; + } case Decl::ClassTemplate: type->def.kind = lsSymbolKind::Class; break; @@ -576,6 +651,35 @@ public: case Decl::TypeAliasTemplate: type->def.kind = lsSymbolKind::TypeAlias; break; + case Decl::ClassTemplateSpecialization: + type->def.kind = lsSymbolKind::Class; + if (is_def || is_decl) { + if (auto *RD = dyn_cast(D)) { + Decl *D1 = nullptr; + if (auto *SD = dyn_cast(RD)) + D1 = SD->getSpecializedTemplate(); + else if (auto *SD = dyn_cast(RD)) { + llvm::PointerUnion + Result = SD->getSpecializedTemplateOrPartial(); + if (Result.is()) + D1 = Result.get(); + else + D1 = Result.get(); + + } else + D1 = RD->getInstantiatedFromMemberClass(); + if (D1) { + Usr usr1 = GetUsr(D1); + auto it = db->usr2type.find(usr1); + if (it != db->usr2type.end()) { + type->def.bases.push_back(usr1); + it->second.derived.push_back(usr); + } + } + } + } + break; case Decl::TypeAlias: case Decl::Typedef: case Decl::UnresolvedUsingTypename: @@ -594,6 +698,20 @@ public: break; case Decl::CXXMethod: func->def.kind = lsSymbolKind::Method; + if (is_def || is_decl) { + if (auto *ND = dyn_cast(D)) { + SmallVector OverDecls; + Ctx->getOverriddenMethods(ND, OverDecls); + for (const auto* ND1 : OverDecls) { + Usr usr1 = GetUsr(ND1); + auto it = db->usr2func.find(usr1); + if (it != db->usr2func.end()) { + func->def.bases.push_back(usr1); + it->second.derived.push_back(usr); + } + } + } + } break; case Decl::CXXConstructor: case Decl::CXXConversion: @@ -602,29 +720,29 @@ public: case Decl::CXXDestructor: func->def.kind = lsSymbolKind::Method; break; - case Decl::Var: - case Decl::ParmVar: - var->def.kind = lsSymbolKind::Variable; - if (is_def) { - if (auto* FD = dyn_cast(SemDC)) - db->ToFunc(GetUsr(FD)).def.vars.push_back(usr); - else if (auto* ND = dyn_cast(SemDC)) - db->ToType(GetUsr(ND)).def.vars.emplace_back(usr, -1); - } - [[fallthrough]]; case Decl::Field: - case Decl::ImplicitParam: + var->def.kind = lsSymbolKind::Field; + break; + case Decl::Var: case Decl::Decomposition: + var->def.kind = lsSymbolKind::Variable; break; - case Decl::EnumConstant: { - auto *ECD = cast(D); - const auto& Val = ECD->getInitVal(); - std::string init = - " = " + (Val.isSigned() ? std::to_string(Val.getSExtValue()) - : std::to_string(Val.getZExtValue())); - var->def.detailed_name = Intern(var->def.detailed_name + init); + case Decl::ImplicitParam: + case Decl::ParmVar: + // ccls extension + var->def.kind = lsSymbolKind::Parameter; + break; + case Decl::EnumConstant: + var->def.kind = lsSymbolKind::EnumMember; + if (is_def) { + auto *ECD = cast(D); + const auto &Val = ECD->getInitVal(); + std::string init = + " = " + (Val.isSigned() ? std::to_string(Val.getSExtValue()) + : std::to_string(Val.getZExtValue())); + var->def.hover = Intern(var->def.detailed_name + init); + } break; - } default: LOG_S(INFO) << "Unhandled " << int(D->getKind()); break; @@ -632,14 +750,90 @@ public: return true; } }; + +class IndexPPCallbacks : public PPCallbacks { + SourceManager& SM; + IndexParam& param; + + std::pair GetMacro(const Token& Tok) const { + StringRef Name = Tok.getIdentifierInfo()->getName(); + SmallString<256> USR("@macro@"); + USR += Name; + return {Name, HashUsr(USR)}; + } + +public: + IndexPPCallbacks(SourceManager& SM, IndexParam& param) : SM(SM), param(param) {} + void MacroDefined(const Token &Tok, const MacroDirective *MD) override { + llvm::sys::fs::UniqueID UniqueID; + SourceLocation L = MD->getLocation(); + auto range = + FromTokenRange(SM, param.Ctx->getLangOpts(), {L, L}, &UniqueID); + const FileEntry *FE = SM.getFileEntryForID(SM.getFileID(L)); + if (!FE) + return; + if (IndexFile *db = param.ConsumeFile(*FE)) { + auto[Name, usr] = GetMacro(Tok); + IndexVar &var = db->ToVar(usr); + if (!var.def.detailed_name[0]) { + var.def.detailed_name = Intern(Name); + var.def.short_name_size = Name.size(); + // TODO defin + var.def.hover = Intern(Twine("#define ", Name).str()); + var.def.kind = lsSymbolKind::Macro; + if (var.def.spell) + var.declarations.push_back(*var.def.spell); + var.def.spell = Use{{range, 0, SymbolKind::File, Role::Definition}}; + var.def.extent = var.def.spell; + } + } + } + void MacroExpands(const Token &Tok, const MacroDefinition &MD, + SourceRange R, const MacroArgs *Args) override { + llvm::sys::fs::UniqueID UniqueID; + auto range = FromTokenRange(SM, param.Ctx->getLangOpts(), R, &UniqueID); + const FileEntry *FE = SM.getFileEntryForID(SM.getFileID(R.getBegin())); + if (!FE) + return; + if (IndexFile *db = param.ConsumeFile(*FE)) { + auto[Name, usr] = GetMacro(Tok); + IndexVar &var = db->ToVar(usr); + var.uses.push_back({{range, 0, SymbolKind::File, Role::Reference}}); + } + } + void MacroUndefined(const Token &Tok, const MacroDefinition &MD, + const MacroDirective *UD) override { + SourceLocation L = UD->getLocation(); + MacroExpands(Tok, MD, {L, L}, nullptr); + } + void SourceRangeSkipped(SourceRange Range, SourceLocation EndifLoc) override { + llvm::sys::fs::UniqueID UniqueID; + auto range = FromCharRange(SM, param.Ctx->getLangOpts(), Range, &UniqueID); + const FileEntry *FE = SM.getFileEntryForID(SM.getFileID(Range.getBegin())); + if (IndexFile *db = param.ConsumeFile(*FE)) + db->skipped_ranges.push_back(range); + } +}; + +class IndexFrontendAction : public ASTFrontendAction { + IndexParam& param; +public: + IndexFrontendAction(IndexParam& param) : param(param) {} + std::unique_ptr CreateASTConsumer(CompilerInstance &CI, + StringRef InFile) override { + Preprocessor &PP = CI.getPreprocessor(); + PP.addPPCallbacks(std::make_unique(PP.getSourceManager(), param)); + return std::make_unique(); + } +}; } const int IndexFile::kMajorVersion = 16; const int IndexFile::kMinorVersion = 1; -IndexFile::IndexFile(unsigned UID, const std::string &path, +IndexFile::IndexFile(llvm::sys::fs::UniqueID UniqueID, const std::string &path, const std::string &contents) - : UID(UID), path(path), file_contents(contents) {} + : UniqueID(UniqueID), path(path), file_contents(contents) {} IndexFunc& IndexFile::ToFunc(Usr usr) { auto ret = usr2func.try_emplace(usr); @@ -698,8 +892,6 @@ std::vector> ClangIndexer::Index( std::vector Args; for (auto& arg: args) Args.push_back(arg.c_str()); - Args.push_back("-Xclang"); - Args.push_back("-detailed-preprocessing-record"); Args.push_back("-fno-spell-checking"); auto PCHCO = std::make_shared(); IntrusiveRefCntPtr @@ -733,8 +925,8 @@ std::vector> ClangIndexer::Index( index::IndexingOptions::SystemSymbolFilterKind::All; IndexOpts.IndexFunctionLocals = true; - std::unique_ptr IndexAction = - createIndexingAction(DataConsumer, IndexOpts, nullptr); + std::unique_ptr IndexAction = createIndexingAction( + DataConsumer, IndexOpts, std::make_unique(param)); llvm::CrashRecoveryContextCleanupRegistrar IndexActionCleanup( IndexAction.get()); @@ -753,33 +945,19 @@ std::vector> ClangIndexer::Index( // ClangCursor(clang_getTranslationUnitCursor(tu->cx_tu)) // .VisitChildren(&VisitMacroDefinitionAndExpansions, ¶m); + const SourceManager& SM = Unit->getSourceManager(); + const FileEntry* FE = SM.getFileEntryForID(SM.getMainFileID()); + param.primary_file = param.ConsumeFile(*FE); std::unordered_map inc_to_line; // TODO if (param.primary_file) for (auto& inc : param.primary_file->includes) inc_to_line[inc.resolved_path] = inc.line; - llvm::DenseMap> UID2skipped; - { - const SourceManager& SM = Unit->getSourceManager(); - PreprocessingRecord *PPRec = Unit->getPreprocessor().getPreprocessingRecord(); - if (PPRec) { - const std::vector& Skipped = PPRec->getSkippedRanges(); - for (auto& R : Skipped) { - unsigned UID; - Range range = FromTokenRange(SM, Unit->getLangOpts(), R, &UID); - UID2skipped[UID].push_back(range); - } - } - } - auto result = param.file_consumer->TakeLocalState(); for (std::unique_ptr& entry : result) { entry->import_file = file; entry->args = args; - auto it = UID2skipped.find(entry->UID); - if (it != UID2skipped.end()) - entry->skipped_ranges = std::move(it->second); for (auto& it : entry->usr2func) { // e.g. declaration + out-of-line definition Uniquify(it.second.derived); @@ -815,7 +993,7 @@ std::vector> ClangIndexer::Index( // Update dependencies for the file. Do not include the file in its own // dependency set. - for (const std::string& path : param.seen_files) + for (auto & [ _, path ] : param.SeenUniqueID) if (path != entry->path && path != entry->import_file) entry->dependencies[path] = param.file2write_time[path]; } diff --git a/src/indexer.h b/src/indexer.h index 441dc44c..9deae62d 100644 --- a/src/indexer.h +++ b/src/indexer.h @@ -249,7 +249,7 @@ struct IndexFile { // files accepted by newer ccls. static const int kMinorVersion; - unsigned UID; + llvm::sys::fs::UniqueID UniqueID; std::string path; std::vector args; int64_t last_write_time = 0; @@ -275,7 +275,8 @@ struct IndexFile { // File contents at the time of index. Not serialized. std::string file_contents; - IndexFile(unsigned UID, const std::string& path, const std::string& contents); + IndexFile(llvm::sys::fs::UniqueID UniqueID, const std::string &path, + const std::string &contents); IndexFunc& ToFunc(Usr usr); IndexType& ToType(Usr usr); diff --git a/src/query.cc b/src/query.cc index 7200121d..fdd3b99f 100644 --- a/src/query.cc +++ b/src/query.cc @@ -172,7 +172,8 @@ bool TryReplaceDef(llvm::SmallVectorImpl& def_list, Q&& def) { IndexUpdate IndexUpdate::CreateDelta(IndexFile* previous, IndexFile* current) { IndexUpdate r; - static IndexFile empty(0u, current->path, ""); + static IndexFile empty(llvm::sys::fs::UniqueID(0, 0), current->path, + ""); if (!previous) previous = ∅ diff --git a/src/serializer.cc b/src/serializer.cc index 458d268a..423154bd 100644 --- a/src/serializer.cc +++ b/src/serializer.cc @@ -426,7 +426,8 @@ std::unique_ptr Deserialize( if (major != IndexFile::kMajorVersion || minor != IndexFile::kMinorVersion) throw std::invalid_argument("Invalid version"); - file = std::make_unique(0u, path, file_content); + file = std::make_unique(sys::fs::UniqueID(0, 0), path, + file_content); Reflect(reader, *file); } catch (std::invalid_argument& e) { LOG_S(INFO) << "failed to deserialize '" << path @@ -450,7 +451,8 @@ std::unique_ptr Deserialize( if (reader.HasParseError()) return nullptr; - file = std::make_unique(0u, path, file_content); + file = std::make_unique(sys::fs::UniqueID(0, 0), path, + file_content); JsonReader json_reader{&reader}; try { Reflect(json_reader, *file); diff --git a/src/utils.cc b/src/utils.cc index c10b9246..36c277a3 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -38,6 +38,10 @@ uint64_t HashUsr(std::string_view s) { return ret; } +uint64_t HashUsr(llvm::StringRef s) { + return HashUsr(std::string_view(s.data(), s.size())); +} + bool EndsWith(std::string_view s, std::string_view suffix) { return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin()); diff --git a/src/utils.h b/src/utils.h index 3b3bb511..49af3555 100644 --- a/src/utils.h +++ b/src/utils.h @@ -9,10 +9,15 @@ #include #include +namespace llvm { +class StringRef; +} + void TrimInPlace(std::string& s); std::string Trim(std::string s); uint64_t HashUsr(std::string_view s); +uint64_t HashUsr(llvm::StringRef s); // Returns true if |value| starts/ends with |start| or |ending|. bool StartsWith(std::string_view value, std::string_view start);