diff --git a/index_tests/constructors/constructor.cc b/index_tests/constructors/constructor.cc index 46f44dbe..b444e162 100644 --- a/index_tests/constructors/constructor.cc +++ b/index_tests/constructors/constructor.cc @@ -42,7 +42,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [10983126130596230582, 17165811951126099095], "uses": [], "callees": [] }], diff --git a/index_tests/constructors/destructor.cc b/index_tests/constructors/destructor.cc index c722bab0..32bfd0d8 100644 --- a/index_tests/constructors/destructor.cc +++ b/index_tests/constructors/destructor.cc @@ -47,7 +47,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [1893354193220338759], "uses": [], "callees": [] }, { diff --git a/index_tests/constructors/implicit_constructor.cc b/index_tests/constructors/implicit_constructor.cc index abcbd9a5..e84ae3ff 100644 --- a/index_tests/constructors/implicit_constructor.cc +++ b/index_tests/constructors/implicit_constructor.cc @@ -25,7 +25,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [449111627548814328, 17097499197730163115], "uses": [], "callees": [] }, { @@ -77,10 +77,10 @@ OUTPUT: "storage": 0 }, { "usr": 17097499197730163115, - "detailed_name": "auto foo1", + "detailed_name": "Type foo1", "qual_name_offset": 5, "short_name": "foo1", - "hover": "auto foo1 = Type()", + "hover": "Type 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/make_functions.cc b/index_tests/constructors/make_functions.cc index ecce8489..c5fc5788 100644 --- a/index_tests/constructors/make_functions.cc +++ b/index_tests/constructors/make_functions.cc @@ -150,7 +150,7 @@ OUTPUT: make_functions.cc "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [3908732770590594660], "uses": ["17:3-17:14|0|1|8228"], "callees": [] }, { @@ -182,7 +182,7 @@ OUTPUT: make_functions.cc "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [8463700030555379526], "uses": ["14:3-14:13|0|1|8228", "15:3-15:13|0|1|8228", "16:3-16:13|0|1|8228"], "callees": [] }], diff --git a/index_tests/declaration_vs_definition/class_member.cc b/index_tests/declaration_vs_definition/class_member.cc index 37649b69..3478c5e8 100644 --- a/index_tests/declaration_vs_definition/class_member.cc +++ b/index_tests/declaration_vs_definition/class_member.cc @@ -7,21 +7,7 @@ OUTPUT: { "includes": [], "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 53, "detailed_name": "", diff --git a/index_tests/declaration_vs_definition/class_member_static.cc b/index_tests/declaration_vs_definition/class_member_static.cc index 24570fcb..5434f6cb 100644 --- a/index_tests/declaration_vs_definition/class_member_static.cc +++ b/index_tests/declaration_vs_definition/class_member_static.cc @@ -9,21 +9,7 @@ OUTPUT: { "includes": [], "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 53, "detailed_name": "", 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 eb8071c0..a399d5d9 100644 --- a/index_tests/declaration_vs_definition/func_associated_function_params.cc +++ b/index_tests/declaration_vs_definition/func_associated_function_params.cc @@ -22,7 +22,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [14555488990109936920, 10963664335057337329], "uses": [], "callees": [] }], diff --git a/index_tests/enums/enum_class_decl.cc b/index_tests/enums/enum_class_decl.cc index b417eb0b..5e2ad16c 100644 --- a/index_tests/enums/enum_class_decl.cc +++ b/index_tests/enums/enum_class_decl.cc @@ -9,21 +9,7 @@ OUTPUT: { "includes": [], "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 2010430204259339553, "detailed_name": "typedef unsigned char uint8_t", diff --git a/index_tests/enums/enum_decl.cc b/index_tests/enums/enum_decl.cc index 5719a261..da4cfc64 100644 --- a/index_tests/enums/enum_decl.cc +++ b/index_tests/enums/enum_decl.cc @@ -8,21 +8,7 @@ OUTPUT: { "includes": [], "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 16985894625255407295, "detailed_name": "enum Foo {\n}", diff --git a/index_tests/enums/enum_inherit.cc b/index_tests/enums/enum_inherit.cc index d0535609..fd36cf56 100644 --- a/index_tests/enums/enum_inherit.cc +++ b/index_tests/enums/enum_inherit.cc @@ -15,35 +15,7 @@ OUTPUT: { "includes": [], "skipped_ranges": [], - "usr2func": [{ - "usr": 2986879766914123941, - "detailed_name": "", - "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "storage": 0, - "declarations": [], - "declaring_type": 0, - "bases": [], - "derived": [], - "vars": [16614320383091394267, 16847439761518576294], - "uses": [], - "callees": [] - }, { - "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 2986879766914123941, "detailed_name": "enum class E : int32_t {\n}", diff --git a/index_tests/enums/enum_usage.cc b/index_tests/enums/enum_usage.cc index 1ea1d3bd..b086892b 100644 --- a/index_tests/enums/enum_usage.cc +++ b/index_tests/enums/enum_usage.cc @@ -10,21 +10,7 @@ OUTPUT: { "includes": [], "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 16985894625255407295, "detailed_name": "enum class Foo : int {\n}", diff --git a/index_tests/foobar.cc b/index_tests/foobar.cc index bb21a22a..24ca7afb 100644 --- a/index_tests/foobar.cc +++ b/index_tests/foobar.cc @@ -31,6 +31,23 @@ OUTPUT: "vars": [], "instances": [], "uses": ["9:5-9:6|0|1|4"] + }, { + "usr": 7074603899792463171, + "detailed_name": "Inner", + "qual_name_offset": 0, + "short_name": "Inner", + "kind": 26, + "declarations": [], + "spell": "6:3-6:18|0|1|2", + "extent": "6:3-6:18|0|1|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [16721564935990383768], + "uses": [] }, { "usr": 10528472276654770367, "detailed_name": "struct Foo {}", @@ -46,8 +63,25 @@ OUTPUT: "types": [13938528237873543349], "funcs": [], "vars": [], - "instances": [12028309045033782423], + "instances": [], "uses": ["9:1-9:4|0|1|4", "10:1-10:4|0|1|4"] + }, { + "usr": 11976530632376795217, + "detailed_name": "Foo", + "qual_name_offset": 0, + "short_name": "Foo", + "kind": 26, + "declarations": [], + "spell": "4:1-7:2|0|1|2", + "extent": "4:1-7:2|0|1|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [12028309045033782423], + "uses": [] }, { "usr": 13892793056005362145, "detailed_name": "enum B {\n}", @@ -80,7 +114,7 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [16721564935990383768], + "instances": [], "uses": ["9:9-9:14|10528472276654770367|2|4"] }], "usr2var": [{ @@ -91,7 +125,7 @@ OUTPUT: "declarations": [], "spell": "10:8-10:9|0|1|2", "extent": "10:1-10:9|0|1|0", - "type": 10528472276654770367, + "type": 11976530632376795217, "uses": [], "kind": 13, "storage": 0 @@ -103,7 +137,7 @@ OUTPUT: "declarations": [], "spell": "9:15-9:16|0|1|2", "extent": "9:1-9:16|0|1|0", - "type": 13938528237873543349, + "type": 7074603899792463171, "uses": [], "kind": 13, "storage": 0 diff --git a/index_tests/lambdas/lambda.cc b/index_tests/lambdas/lambda.cc index d3738010..a6284a4b 100644 --- a/index_tests/lambdas/lambda.cc +++ b/index_tests/lambdas/lambda.cc @@ -29,7 +29,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [12666114896600231317, 2981279427664991319], "uses": [], "callees": [] }, { @@ -67,27 +67,29 @@ OUTPUT: "detailed_name": "", "qual_name_offset": 0, "short_name": "", - "kind": 0, + "kind": 26, "declarations": [], + "spell": "4:22-4:23|4259594751088586730|3|2", + "extent": "4:22-4:23|4259594751088586730|3|0", "alias_of": 0, "bases": [], "derived": [], "types": [], "funcs": [], "vars": [], - "instances": [], + "instances": [2981279427664991319], "uses": [] }], "usr2var": [{ "usr": 2981279427664991319, - "detailed_name": "auto dosomething", - "qual_name_offset": 5, + "detailed_name": "(lambda) dosomething", + "qual_name_offset": 9, "short_name": "dosomething", - "hover": "auto dosomething = [&x] (int y) {\n ++x;\n ++y;\n }\n", + "hover": "(lambda) dosomething = [&x](int y) {\n ++x;\n ++y;\n }", "declarations": [], "spell": "4:8-4:19|4259594751088586730|3|2", "extent": "4:3-7:4|4259594751088586730|3|0", - "type": 0, + "type": 14635009347499519042, "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 @@ -109,6 +111,8 @@ OUTPUT: "qual_name_offset": 4, "short_name": "y", "declarations": [], + "spell": "4:31-4:32|17926497908620168464|3|2", + "extent": "4:27-4:32|17926497908620168464|3|0", "type": 0, "uses": ["6:7-6:8|17926497908620168464|3|28"], "kind": 253, diff --git a/index_tests/macros/complex.cc b/index_tests/macros/complex.cc index f014946e..38c8e22b 100644 --- a/index_tests/macros/complex.cc +++ b/index_tests/macros/complex.cc @@ -83,10 +83,10 @@ OUTPUT: "detailed_name": "FOO", "qual_name_offset": 0, "short_name": "FOO", - "hover": "#define FOO", + "hover": "#define FOO(aaa, bbb) \\\n int a();\\\n int a() { return aaa + bbb; }", "declarations": [], "spell": "1:9-1:12|0|1|2", - "extent": "1:9-1:12|0|1|2", + "extent": "1:9-3:32|0|1|0", "type": 0, "uses": ["12:1-12:20|0|1|4"], "kind": 255, diff --git a/index_tests/macros/foo.cc b/index_tests/macros/foo.cc index 50f38b94..c2e05248 100644 --- a/index_tests/macros/foo.cc +++ b/index_tests/macros/foo.cc @@ -67,10 +67,10 @@ OUTPUT: "detailed_name": "A", "qual_name_offset": 0, "short_name": "A", - "hover": "#define A", + "hover": "#define A 5", "declarations": [], "spell": "1:9-1:10|0|1|2", - "extent": "1:9-1:10|0|1|2", + "extent": "1:9-1:12|0|1|0", "type": 0, "uses": ["8:9-8:10|0|1|4"], "kind": 255, @@ -80,10 +80,10 @@ OUTPUT: "detailed_name": "DISALLOW", "qual_name_offset": 0, "short_name": "DISALLOW", - "hover": "#define DISALLOW", + "hover": "#define DISALLOW(type) type(type&&) = delete;", "declarations": [], "spell": "2:9-2:17|0|1|2", - "extent": "2:9-2:17|0|1|2", + "extent": "2:9-2:46|0|1|0", "type": 0, "uses": ["5:3-5:16|0|1|4"], "kind": 255, @@ -93,7 +93,7 @@ OUTPUT: "detailed_name": "int x", "qual_name_offset": 4, "short_name": "x", - "hover": "int x = 5", + "hover": "int x = ", "declarations": [], "spell": "8:5-8:6|0|1|2", "extent": "8:1-1:1|0|1|0", diff --git a/index_tests/multi_file/funky_enum.cc b/index_tests/multi_file/funky_enum.cc index 29963edf..f49c6297 100644 --- a/index_tests/multi_file/funky_enum.cc +++ b/index_tests/multi_file/funky_enum.cc @@ -10,21 +10,7 @@ OUTPUT: funky_enum.h { "includes": [], "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 16985894625255407295, "detailed_name": "", diff --git a/index_tests/multi_file/impl.cc b/index_tests/multi_file/impl.cc index 48cbb17a..8501799b 100644 --- a/index_tests/multi_file/impl.cc +++ b/index_tests/multi_file/impl.cc @@ -10,20 +10,6 @@ OUTPUT: header.h "includes": [], "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, diff --git a/index_tests/multi_file/static.cc b/index_tests/multi_file/static.cc index c7dcd941..bc5e50a4 100644 --- a/index_tests/multi_file/static.cc +++ b/index_tests/multi_file/static.cc @@ -51,8 +51,8 @@ OUTPUT: static.cc "skipped_ranges": [], "usr2func": [{ "usr": 14576076421851654759, - "detailed_name": "static void Buffer::CreateSharedBuffer()", - "qual_name_offset": 12, + "detailed_name": "void Buffer::CreateSharedBuffer()", + "qual_name_offset": 5, "short_name": "CreateSharedBuffer", "kind": 6, "storage": 0, diff --git a/index_tests/namespaces/namespace_alias.cc b/index_tests/namespaces/namespace_alias.cc index 88f1adf3..32c420fa 100644 --- a/index_tests/namespaces/namespace_alias.cc +++ b/index_tests/namespaces/namespace_alias.cc @@ -31,21 +31,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "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], + "vars": [6030927277961448585, 7657277353101371136], "uses": [], "callees": [] }], @@ -106,7 +92,10 @@ OUTPUT: "derived": [], "types": [], "funcs": [], - "vars": [], + "vars": [{ + "L": 15042442838933090518, + "R": -1 + }], "instances": [], "uses": ["9:27-9:30|17805385787823406700|2|4", "12:21-12:24|17805385787823406700|2|4"] }, { diff --git a/index_tests/namespaces/namespace_reference.cc b/index_tests/namespaces/namespace_reference.cc index c412f7c0..323c6d91 100644 --- a/index_tests/namespaces/namespace_reference.cc +++ b/index_tests/namespaces/namespace_reference.cc @@ -30,20 +30,6 @@ OUTPUT: "vars": [], "uses": [], "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)", @@ -57,7 +43,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [3649375698083002347], "uses": ["7:7-7:13|11072669167287398027|2|8228", "9:3-9:9|11072669167287398027|2|8228"], "callees": [] }], @@ -88,7 +74,10 @@ OUTPUT: "derived": [], "types": [], "funcs": [17328473273923617489], - "vars": [], + "vars": [{ + "L": 12898699035586282159, + "R": -1 + }], "instances": [], "uses": ["7:3-7:5|0|1|4", "7:14-7:16|0|1|4", "8:19-8:21|0|1|4"] }], diff --git a/index_tests/outline/static_function_in_type.cc b/index_tests/outline/static_function_in_type.cc index 74a75735..6f6818e0 100644 --- a/index_tests/outline/static_function_in_type.cc +++ b/index_tests/outline/static_function_in_type.cc @@ -85,18 +85,19 @@ OUTPUT: static_function_in_type.cc "skipped_ranges": [], "usr2func": [{ "usr": 17019747379608639279, - "detailed_name": "static void ns::Foo::Register(ns::Manager *)", - "qual_name_offset": 12, + "detailed_name": "void Foo::Register(ns::Manager *m)", + "qual_name_offset": 5, "short_name": "Register", "kind": 6, "storage": 0, + "comments": "static", "declarations": [], "spell": "5:11-5:19|17262466801709381811|2|514", "extent": "5:1-6:2|11072669167287398027|2|0", "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [13569879755236306838], "uses": [], "callees": [] }], diff --git a/index_tests/preprocessor/include_guard.cc b/index_tests/preprocessor/include_guard.cc index 9a2edd7d..5b4ef807 100644 --- a/index_tests/preprocessor/include_guard.cc +++ b/index_tests/preprocessor/include_guard.cc @@ -18,7 +18,7 @@ OUTPUT: "hover": "#define FOO", "declarations": [], "spell": "2:9-2:12|0|1|2", - "extent": "2:9-2:12|0|1|2", + "extent": "2:9-2:12|0|1|0", "type": 0, "uses": [], "kind": 255, diff --git a/index_tests/templates/implicit_variable_instantiation.cc b/index_tests/templates/implicit_variable_instantiation.cc index 0c356b62..e4a75de5 100644 --- a/index_tests/templates/implicit_variable_instantiation.cc +++ b/index_tests/templates/implicit_variable_instantiation.cc @@ -19,35 +19,7 @@ OUTPUT: { "includes": [], "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 53, "detailed_name": "", @@ -92,7 +64,13 @@ OUTPUT: "derived": [], "types": [1532099849728741556, 12688716854043726585], "funcs": [], - "vars": [], + "vars": [{ + "L": 12898699035586282159, + "R": -1 + }, { + "L": 9008550860229740818, + "R": -1 + }], "instances": [], "uses": [] }, { @@ -118,7 +96,7 @@ OUTPUT: "detailed_name": "static constexpr ns::VarType ns::Holder::static_var", "qual_name_offset": 29, "short_name": "static_var", - "hover": "static constexpr ns::VarType ns::Holder::static_var = (ns::VarType)0", + "hover": "static constexpr ns::VarType ns::Holder::static_var = (VarType)0x0", "declarations": ["6:30-6:40|12688716854043726585|2|513"], "spell": "10:37-10:47|12688716854043726585|2|514", "extent": "9:3-10:47|11072669167287398027|2|0", diff --git a/index_tests/templates/member_ref_in_template.cc b/index_tests/templates/member_ref_in_template.cc index f136e253..a9d7f9e2 100644 --- a/index_tests/templates/member_ref_in_template.cc +++ b/index_tests/templates/member_ref_in_template.cc @@ -41,20 +41,6 @@ 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()", @@ -90,6 +76,23 @@ OUTPUT: }], "instances": [], "uses": [] + }, { + "usr": 14750650276757822712, + "detailed_name": "T", + "qual_name_offset": 0, + "short_name": "T", + "kind": 26, + "declarations": [], + "spell": "1:11-1:18|8402783583255987702|2|2", + "extent": "1:11-1:18|8402783583255987702|2|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [5866801090710377175], + "uses": [] }], "usr2var": [{ "usr": 5866801090710377175, @@ -99,7 +102,7 @@ OUTPUT: "declarations": [], "spell": "3:5-3:6|8402783583255987702|2|514", "extent": "3:3-3:6|8402783583255987702|2|0", - "type": 0, + "type": 14750650276757822712, "uses": [], "kind": 8, "storage": 0 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 426d5be3..909cce9e 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 @@ -32,20 +32,6 @@ OUTPUT: "vars": [], "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": 53, @@ -74,7 +60,13 @@ OUTPUT: "derived": [], "types": [14042997404480181958], "funcs": [], - "vars": [], + "vars": [{ + "L": 15768138241775955040, + "R": -1 + }, { + "L": 3182917058194750998, + "R": -1 + }], "instances": [], "uses": [] }, { 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 fada88f9..aeb397de 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 @@ -11,22 +11,42 @@ OUTPUT: { "includes": [], "skipped_ranges": [], - "usr2func": [{ - "usr": 11072669167287398027, - "detailed_name": "", + "usr2func": [], + "usr2type": [{ + "usr": 3948666349864691553, + "detailed_name": "Foo", "qual_name_offset": 0, - "short_name": "", - "kind": 0, - "storage": 0, + "short_name": "Foo", + "kind": 26, "declarations": [], - "declaring_type": 0, + "spell": "2:3-3:15|11072669167287398027|2|2", + "extent": "2:3-3:15|11072669167287398027|2|0", + "alias_of": 0, "bases": [], "derived": [], - "vars": [15768138241775955040, 3182917058194750998], - "uses": [], - "callees": [] - }], - "usr2type": [{ + "types": [], + "funcs": [], + "vars": [], + "instances": [3182917058194750998], + "uses": [] + }, { + "usr": 8224244241460152567, + "detailed_name": "Foo", + "qual_name_offset": 0, + "short_name": "Foo", + "kind": 26, + "declarations": [], + "spell": "2:3-3:15|11072669167287398027|2|2", + "extent": "2:3-3:15|11072669167287398027|2|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [15768138241775955040], + "uses": [] + }, { "usr": 11072669167287398027, "detailed_name": "namespace ns {\n}", "qual_name_offset": 10, @@ -38,7 +58,13 @@ OUTPUT: "derived": [], "types": [14042997404480181958], "funcs": [], - "vars": [], + "vars": [{ + "L": 15768138241775955040, + "R": -1 + }, { + "L": 3182917058194750998, + "R": -1 + }], "instances": [], "uses": [] }, { @@ -56,7 +82,7 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [15768138241775955040, 3182917058194750998], + "instances": [], "uses": ["5:3-5:6|11072669167287398027|2|4", "6:3-6:6|11072669167287398027|2|4"] }], "usr2var": [{ @@ -67,7 +93,7 @@ OUTPUT: "declarations": [], "spell": "6:13-6:14|11072669167287398027|2|514", "extent": "6:3-6:14|11072669167287398027|2|0", - "type": 14042997404480181958, + "type": 3948666349864691553, "uses": [], "kind": 13, "storage": 0 @@ -79,7 +105,7 @@ OUTPUT: "declarations": [], "spell": "5:12-5:13|11072669167287398027|2|514", "extent": "5:3-5:13|11072669167287398027|2|0", - "type": 14042997404480181958, + "type": 8224244241460152567, "uses": [], "kind": 13, "storage": 0 diff --git a/index_tests/templates/specialization.cc b/index_tests/templates/specialization.cc index deca63d9..2acb713f 100644 --- a/index_tests/templates/specialization.cc +++ b/index_tests/templates/specialization.cc @@ -75,20 +75,6 @@ OUTPUT: "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)", @@ -102,7 +88,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [17826688417349629938], "uses": [], "callees": [] }, { @@ -135,6 +121,23 @@ OUTPUT: "vars": [], "instances": [13914496963221806870], "uses": [] + }, { + "usr": 218068462278884837, + "detailed_name": "template class function {}", + "qual_name_offset": 46, + "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": [], + "uses": [] }, { "usr": 1663022413889915338, "detailed_name": "template<> class vector> {}", @@ -152,6 +155,23 @@ OUTPUT: "vars": [], "instances": [15931696253641284761], "uses": [] + }, { + "usr": 3231449734830406187, + "detailed_name": "function", + "qual_name_offset": 0, + "short_name": "function", + "kind": 26, + "declarations": [], + "spell": "4:1-5:30|0|1|2", + "extent": "4:1-5:30|0|1|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [2933643612409209903], + "uses": [] }, { "usr": 5760043510674081814, "detailed_name": "struct Z1 {}", @@ -180,11 +200,11 @@ OUTPUT: "extent": "12:1-14:2|0|1|0", "alias_of": 0, "bases": [], - "derived": [1663022413889915338], + "derived": [16155717907537731864, 1663022413889915338], "types": [], "funcs": [18107614608385228556], "vars": [], - "instances": [5792869548777559988, 86949563628772958, 3566687051827176322], + "instances": [], "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, @@ -220,6 +240,57 @@ OUTPUT: "vars": [], "instances": [], "uses": ["26:14-26:16|0|1|4", "33:8-33:10|0|1|4"] + }, { + "usr": 11153492883079050853, + "detailed_name": "vector", + "qual_name_offset": 0, + "short_name": "vector", + "kind": 26, + "declarations": [], + "spell": "16:1-17:20|0|1|2", + "extent": "16:1-17:20|0|1|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [86949563628772958], + "uses": [] + }, { + "usr": 13322943937025195708, + "detailed_name": "vector", + "qual_name_offset": 0, + "short_name": "vector", + "kind": 26, + "declarations": [], + "spell": "11:1-14:2|0|1|2", + "extent": "11:1-14:2|0|1|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [5792869548777559988], + "uses": [] + }, { + "usr": 14111105212951082474, + "detailed_name": "T", + "qual_name_offset": 0, + "short_name": "T", + "kind": 26, + "declarations": [], + "spell": "38:11-38:21|17498190318698490707|3|2", + "extent": "38:11-38:21|17498190318698490707|3|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [17826688417349629938], + "uses": [] }, { "usr": 15019211479263750068, "detailed_name": "class function", @@ -229,12 +300,29 @@ OUTPUT: "declarations": ["2:7-2:15|0|1|1"], "alias_of": 0, "bases": [], + "derived": [218068462278884837], + "types": [], + "funcs": [], + "vars": [], + "instances": [], + "uses": ["5:7-5:15|0|1|4", "7:1-7:9|0|1|4"] + }, { + "usr": 15440970074034693939, + "detailed_name": "vector", + "qual_name_offset": 0, + "short_name": "vector", + "kind": 26, + "declarations": [], + "spell": "21:1-21:26|0|1|2", + "extent": "21:1-21:26|0|1|0", + "alias_of": 0, + "bases": [], "derived": [], "types": [], "funcs": [], "vars": [], - "instances": [2933643612409209903], - "uses": ["5:7-5:15|0|1|4", "7:1-7:9|0|1|4"] + "instances": [3566687051827176322], + "uses": [] }, { "usr": 15695704394170757108, "detailed_name": "class allocator", @@ -250,6 +338,23 @@ OUTPUT: "vars": [], "instances": [], "uses": ["11:39-11:48|0|1|4"] + }, { + "usr": 16155717907537731864, + "detailed_name": "template class vector> {}", + "qual_name_offset": 28, + "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": [], + "uses": [] }], "usr2var": [{ "usr": 86949563628772958, @@ -259,7 +364,7 @@ OUTPUT: "declarations": [], "spell": "31:14-31:17|0|1|2", "extent": "31:1-31:17|0|1|0", - "type": 7440942986741176606, + "type": 11153492883079050853, "uses": [], "kind": 13, "storage": 0 @@ -271,7 +376,7 @@ OUTPUT: "declarations": [], "spell": "7:21-7:22|0|1|2", "extent": "7:1-7:22|0|1|0", - "type": 15019211479263750068, + "type": 3231449734830406187, "uses": [], "kind": 13, "storage": 0 @@ -283,7 +388,7 @@ OUTPUT: "declarations": [], "spell": "32:12-32:15|0|1|2", "extent": "32:1-32:15|0|1|0", - "type": 7440942986741176606, + "type": 15440970074034693939, "uses": [], "kind": 13, "storage": 0 @@ -308,7 +413,7 @@ OUTPUT: "declarations": [], "spell": "30:14-30:16|0|1|2", "extent": "30:1-30:16|0|1|0", - "type": 7440942986741176606, + "type": 13322943937025195708, "uses": [], "kind": 13, "storage": 0 @@ -358,7 +463,7 @@ OUTPUT: "declarations": [], "spell": "39:12-39:17|17498190318698490707|3|514", "extent": "39:10-39:17|17498190318698490707|3|0", - "type": 0, + "type": 14111105212951082474, "uses": [], "kind": 253, "storage": 0 diff --git a/index_tests/templates/specialized_func_definition.cc b/index_tests/templates/specialized_func_definition.cc index 94b33653..d23cf26a 100644 --- a/index_tests/templates/specialized_func_definition.cc +++ b/index_tests/templates/specialized_func_definition.cc @@ -24,8 +24,8 @@ OUTPUT: "skipped_ranges": [], "usr2func": [{ "usr": 6995843774014807426, - "detailed_name": "void Template::Foo()", - "qual_name_offset": 5, + "detailed_name": "template <> void Template::Foo()", + "qual_name_offset": 31, "short_name": "Foo", "kind": 6, "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 ddc6495e..37377cbc 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 @@ -50,6 +50,23 @@ OUTPUT: "vars": [], "instances": [], "uses": ["9:5-9:6|0|1|4"] + }, { + "usr": 7074603899792463171, + "detailed_name": "Inner", + "qual_name_offset": 0, + "short_name": "Inner", + "kind": 26, + "declarations": [], + "spell": "6:3-6:18|0|1|2", + "extent": "6:3-6:18|0|1|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [16721564935990383768], + "uses": [] }, { "usr": 10528472276654770367, "detailed_name": "struct Foo {}", @@ -99,8 +116,25 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [16721564935990383768, 12028309045033782423], + "instances": [], "uses": ["9:9-9:14|10528472276654770367|2|4", "10:9-10:14|10528472276654770367|2|4"] + }, { + "usr": 15961308565836244174, + "detailed_name": "Inner", + "qual_name_offset": 0, + "short_name": "Inner", + "kind": 26, + "declarations": [], + "spell": "6:3-6:18|0|1|2", + "extent": "6:3-6:18|0|1|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [12028309045033782423], + "uses": [] }], "usr2var": [{ "usr": 12028309045033782423, @@ -110,7 +144,7 @@ OUTPUT: "declarations": [], "spell": "10:15-10:16|0|1|2", "extent": "10:1-10:16|0|1|0", - "type": 13938528237873543349, + "type": 15961308565836244174, "uses": [], "kind": 13, "storage": 0 @@ -122,7 +156,7 @@ OUTPUT: "declarations": [], "spell": "9:15-9:16|0|1|2", "extent": "9:1-9:16|0|1|0", - "type": 13938528237873543349, + "type": 7074603899792463171, "uses": [], "kind": 13, "storage": 0 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 e6b7b4a6..a6a84ad8 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 @@ -11,21 +11,7 @@ OUTPUT: { "includes": [], "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 53, "detailed_name": "", 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 c4dbcd5b..0ecebac8 100644 --- a/index_tests/templates/template_type_usage_folded_into_one.cc +++ b/index_tests/templates/template_type_usage_folded_into_one.cc @@ -11,6 +11,23 @@ OUTPUT: "skipped_ranges": [], "usr2func": [], "usr2type": [{ + "usr": 5123806965838456033, + "detailed_name": "Foo", + "qual_name_offset": 0, + "short_name": "Foo", + "kind": 26, + "declarations": [], + "spell": "1:1-2:13|0|1|2", + "extent": "1:1-2:13|0|1|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [16721564935990383768], + "uses": [] + }, { "usr": 10528472276654770367, "detailed_name": "class Foo {}", "qual_name_offset": 6, @@ -25,8 +42,25 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [16721564935990383768, 12028309045033782423], + "instances": [], "uses": ["4:1-4:4|0|1|4", "5:1-5:4|0|1|4"] + }, { + "usr": 14134940367505932005, + "detailed_name": "Foo", + "qual_name_offset": 0, + "short_name": "Foo", + "kind": 26, + "declarations": [], + "spell": "1:1-2:13|0|1|2", + "extent": "1:1-2:13|0|1|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [12028309045033782423], + "uses": [] }], "usr2var": [{ "usr": 12028309045033782423, @@ -36,7 +70,7 @@ OUTPUT: "declarations": [], "spell": "5:11-5:12|0|1|2", "extent": "5:1-5:12|0|1|0", - "type": 10528472276654770367, + "type": 14134940367505932005, "uses": [], "kind": 13, "storage": 0 @@ -48,7 +82,7 @@ OUTPUT: "declarations": [], "spell": "4:10-4:11|0|1|2", "extent": "4:1-4:11|0|1|0", - "type": 10528472276654770367, + "type": 5123806965838456033, "uses": [], "kind": 13, "storage": 0 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 f64125be..b4ef4977 100644 --- a/index_tests/templates/template_var_usage_folded_into_one.cc +++ b/index_tests/templates/template_var_usage_folded_into_one.cc @@ -53,6 +53,23 @@ OUTPUT: "vars": [], "instances": [16721564935990383768], "uses": ["7:1-7:2|0|1|4", "7:11-7:12|0|1|4"] + }, { + "usr": 11919899838872947844, + "detailed_name": "T", + "qual_name_offset": 0, + "short_name": "T", + "kind": 26, + "declarations": [], + "spell": "4:10-4:20|0|1|2", + "extent": "4:10-4:20|0|1|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [8096973118640070624], + "uses": [] }, { "usr": 13892793056005362145, "detailed_name": "enum B {\n}", @@ -80,7 +97,7 @@ OUTPUT: "declarations": [], "spell": "5:3-5:6|0|1|2", "extent": "5:1-5:12|0|1|0", - "type": 0, + "type": 11919899838872947844, "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 56f38ebf..370d30e5 100644 --- a/index_tests/types/anonymous_struct.cc +++ b/index_tests/types/anonymous_struct.cc @@ -8,35 +8,7 @@ OUTPUT: { "includes": [], "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 82, "detailed_name": "", diff --git a/index_tests/unions/union_decl.cc b/index_tests/unions/union_decl.cc index 3745475b..b7500dbc 100644 --- a/index_tests/unions/union_decl.cc +++ b/index_tests/unions/union_decl.cc @@ -8,21 +8,7 @@ OUTPUT: { "includes": [], "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 37, "detailed_name": "", diff --git a/index_tests/unions/union_usage.cc b/index_tests/unions/union_usage.cc index 4b36fa87..148bf27b 100644 --- a/index_tests/unions/union_usage.cc +++ b/index_tests/unions/union_usage.cc @@ -17,20 +17,6 @@ OUTPUT: "includes": [], "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, diff --git a/index_tests/usage/func_called_from_macro_argument.cc b/index_tests/usage/func_called_from_macro_argument.cc index 45e3af74..3215fa23 100644 --- a/index_tests/usage/func_called_from_macro_argument.cc +++ b/index_tests/usage/func_called_from_macro_argument.cc @@ -48,10 +48,10 @@ OUTPUT: "detailed_name": "MACRO_CALL", "qual_name_offset": 0, "short_name": "MACRO_CALL", - "hover": "#define MACRO_CALL", + "hover": "#define MACRO_CALL(e) e", "declarations": [], "spell": "1:9-1:19|0|1|2", - "extent": "1:9-1:19|0|1|2", + "extent": "1:9-1:24|0|1|0", "type": 0, "uses": ["6:3-6:33|0|1|4"], "kind": 255, diff --git a/index_tests/usage/func_usage_addr_func.cc b/index_tests/usage/func_usage_addr_func.cc index 68dd2c21..49afc9ac 100644 --- a/index_tests/usage/func_usage_addr_func.cc +++ b/index_tests/usage/func_usage_addr_func.cc @@ -41,7 +41,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [16088407831770615719], "uses": [], "callees": [] }, { diff --git a/index_tests/usage/func_usage_addr_method.cc b/index_tests/usage/func_usage_addr_method.cc index 9c435a9a..27508d54 100644 --- a/index_tests/usage/func_usage_addr_method.cc +++ b/index_tests/usage/func_usage_addr_method.cc @@ -25,7 +25,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [4636142131003982569], "uses": [], "callees": [] }, { @@ -63,10 +63,10 @@ OUTPUT: }], "usr2var": [{ "usr": 4636142131003982569, - "detailed_name": "auto x", - "qual_name_offset": 5, + "detailed_name": "void (Foo::*)() x", + "qual_name_offset": 16, "short_name": "x", - "hover": "auto x = &Foo::Used", + "hover": "void (Foo::*)() 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_method.cc b/index_tests/usage/func_usage_call_method.cc index db90d666..3a78b2fd 100644 --- a/index_tests/usage/func_usage_call_method.cc +++ b/index_tests/usage/func_usage_call_method.cc @@ -25,7 +25,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [14045150712868309451], "uses": [], "callees": [] }, { 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 45c77afc..0a94d6e6 100644 --- a/index_tests/usage/func_usage_class_inline_var_def.cc +++ b/index_tests/usage/func_usage_class_inline_var_def.cc @@ -27,20 +27,6 @@ OUTPUT: "vars": [], "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": 53, diff --git a/index_tests/usage/func_usage_forward_decl_method.cc b/index_tests/usage/func_usage_forward_decl_method.cc index b00ff4fa..e1ee4d45 100644 --- a/index_tests/usage/func_usage_forward_decl_method.cc +++ b/index_tests/usage/func_usage_forward_decl_method.cc @@ -24,7 +24,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [16229832321010999607], "uses": [], "callees": [] }, { diff --git a/index_tests/usage/type_usage_as_template_parameter.cc b/index_tests/usage/type_usage_as_template_parameter.cc index 56da2161..c8a5e6c3 100644 --- a/index_tests/usage/type_usage_as_template_parameter.cc +++ b/index_tests/usage/type_usage_as_template_parameter.cc @@ -28,7 +28,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [3364438781074774169], "uses": [], "callees": [] }], @@ -47,8 +47,25 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [12857919739649552168, 18075066956054788088, 3364438781074774169], + "instances": [], "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": 4186953406371619898, + "detailed_name": "unique_ptr", + "qual_name_offset": 0, + "short_name": "unique_ptr", + "kind": 26, + "declarations": [], + "spell": "1:1-2:20|0|1|2", + "extent": "1:1-2:20|0|1|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [18075066956054788088, 3364438781074774169], + "uses": [] }, { "usr": 4750332761459066907, "detailed_name": "struct S {}", @@ -66,6 +83,23 @@ OUTPUT: "vars": [], "instances": [], "uses": ["7:19-7:20|0|1|4", "9:12-9:13|0|1|4", "10:14-10:15|0|1|4"] + }, { + "usr": 16848604152578034754, + "detailed_name": "unique_ptr", + "qual_name_offset": 0, + "short_name": "unique_ptr", + "kind": 26, + "declarations": [], + "spell": "1:1-2:20|0|1|2", + "extent": "1:1-2:20|0|1|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [12857919739649552168], + "uses": [] }], "usr2var": [{ "usr": 3364438781074774169, @@ -75,7 +109,7 @@ OUTPUT: "declarations": [], "spell": "10:18-10:23|16359708726068806331|3|2", "extent": "10:3-10:23|16359708726068806331|3|0", - "type": 3286534761799572592, + "type": 4186953406371619898, "uses": [], "kind": 13, "storage": 0 @@ -87,7 +121,7 @@ OUTPUT: "declarations": [], "spell": "6:25-6:27|0|1|2", "extent": "6:1-6:27|0|1|0", - "type": 3286534761799572592, + "type": 16848604152578034754, "uses": [], "kind": 13, "storage": 2 @@ -99,7 +133,7 @@ OUTPUT: "declarations": [], "spell": "7:22-7:24|0|1|2", "extent": "7:1-7:24|0|1|0", - "type": 3286534761799572592, + "type": 4186953406371619898, "uses": [], "kind": 13, "storage": 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 76c28471..1af6dbdf 100644 --- a/index_tests/usage/type_usage_as_template_parameter_complex.cc +++ b/index_tests/usage/type_usage_as_template_parameter_complex.cc @@ -144,7 +144,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [500112618220246], "uses": [], "callees": [] }], @@ -191,7 +191,7 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [2933643612409209903, 500112618220246], + "instances": [], "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, @@ -210,6 +210,23 @@ OUTPUT: "vars": [], "instances": [], "uses": ["79:21-79:24|0|1|4"] + }, { + "usr": 18153735331422331128, + "detailed_name": "unique_ptr", + "qual_name_offset": 0, + "short_name": "unique_ptr", + "kind": 26, + "declarations": [], + "spell": "1:1-2:17|0|1|2", + "extent": "1:1-2:17|0|1|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [2933643612409209903, 500112618220246], + "uses": [] }], "usr2var": [{ "usr": 500112618220246, @@ -219,7 +236,7 @@ OUTPUT: "declarations": [], "spell": "54:39-54:44|18320186404467436976|3|2", "extent": "54:3-54:44|18320186404467436976|3|0", - "type": 14209198335088845323, + "type": 18153735331422331128, "uses": [], "kind": 13, "storage": 0 @@ -229,7 +246,7 @@ OUTPUT: "qual_name_offset": 42, "short_name": "f", "declarations": ["15:43-15:44|0|1|1"], - "type": 14209198335088845323, + "type": 18153735331422331128, "uses": [], "kind": 13, "storage": 1 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 75aed976..84ebefe2 100644 --- a/index_tests/usage/type_usage_as_template_parameter_simple.cc +++ b/index_tests/usage/type_usage_as_template_parameter_simple.cc @@ -26,8 +26,25 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [3398408600781120939], + "instances": [], "uses": ["6:8-6:18|0|1|4"] + }, { + "usr": 4186953406371619898, + "detailed_name": "unique_ptr", + "qual_name_offset": 0, + "short_name": "unique_ptr", + "kind": 26, + "declarations": [], + "spell": "1:1-2:20|0|1|2", + "extent": "1:1-2:20|0|1|0", + "alias_of": 0, + "bases": [], + "derived": [], + "types": [], + "funcs": [], + "vars": [], + "instances": [3398408600781120939], + "uses": [] }, { "usr": 4750332761459066907, "detailed_name": "struct S", @@ -52,7 +69,7 @@ OUTPUT: "declarations": [], "spell": "6:22-6:25|0|1|2", "extent": "6:1-6:25|0|1|0", - "type": 3286534761799572592, + "type": 4186953406371619898, "uses": [], "kind": 13, "storage": 2 diff --git a/index_tests/usage/type_usage_declare_field.cc b/index_tests/usage/type_usage_declare_field.cc index 87e2514d..1d8fcb26 100644 --- a/index_tests/usage/type_usage_declare_field.cc +++ b/index_tests/usage/type_usage_declare_field.cc @@ -11,21 +11,7 @@ OUTPUT: { "includes": [], "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 8508299082070213750, "detailed_name": "struct ImplementedType {}", diff --git a/index_tests/usage/type_usage_declare_local.cc b/index_tests/usage/type_usage_declare_local.cc index b4462a95..09af0afe 100644 --- a/index_tests/usage/type_usage_declare_local.cc +++ b/index_tests/usage/type_usage_declare_local.cc @@ -24,7 +24,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [16374832544037266261, 2580122838476012357], "uses": [], "callees": [] }], diff --git a/index_tests/usage/type_usage_declare_param.cc b/index_tests/usage/type_usage_declare_param.cc index 7ccd5eef..583c1c08 100644 --- a/index_tests/usage/type_usage_declare_param.cc +++ b/index_tests/usage/type_usage_declare_param.cc @@ -21,7 +21,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [13058491096576226774, 11055777568039014776], "uses": [], "callees": [] }], diff --git a/index_tests/usage/type_usage_declare_param_prototype.cc b/index_tests/usage/type_usage_declare_param_prototype.cc index 3326f28e..0d84a644 100644 --- a/index_tests/usage/type_usage_declare_param_prototype.cc +++ b/index_tests/usage/type_usage_declare_param_prototype.cc @@ -26,7 +26,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [13823260660189154978], "uses": [], "callees": [] }], diff --git a/index_tests/usage/type_usage_declare_qualifiers.cc b/index_tests/usage/type_usage_declare_qualifiers.cc index df3b9b42..ec88c76f 100644 --- a/index_tests/usage/type_usage_declare_qualifiers.cc +++ b/index_tests/usage/type_usage_declare_qualifiers.cc @@ -24,7 +24,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [7997456978847868736, 17228576662112939520, 15429032129697337561, 6081981442495435784, 5004072032239834773, 14939253431683105646], "uses": [], "callees": [] }], diff --git a/index_tests/usage/type_usage_various.cc b/index_tests/usage/type_usage_various.cc index 5e6e6ac2..c03e37ca 100644 --- a/index_tests/usage/type_usage_various.cc +++ b/index_tests/usage/type_usage_various.cc @@ -27,7 +27,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [16380484338511689669], "uses": [], "callees": [] }], diff --git a/index_tests/usage/usage_inside_of_call.cc b/index_tests/usage/usage_inside_of_call.cc index 15c45125..4417645b 100644 --- a/index_tests/usage/usage_inside_of_call.cc +++ b/index_tests/usage/usage_inside_of_call.cc @@ -32,7 +32,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [8039186520399841081], "uses": [], "callees": [] }, { @@ -49,20 +49,6 @@ OUTPUT: "vars": [], "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, "detailed_name": "void called(int a)", @@ -144,7 +130,6 @@ OUTPUT: "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|513"], "spell": "10:10-10:20|15041163540773201510|2|514", "extent": "10:1-10:24|0|1|0", diff --git a/index_tests/usage/var_usage_call_function.cc b/index_tests/usage/var_usage_call_function.cc index 10bb73fe..d9cbb63f 100644 --- a/index_tests/usage/var_usage_call_function.cc +++ b/index_tests/usage/var_usage_call_function.cc @@ -41,7 +41,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [9121974011454213596], "uses": [], "callees": [] }], diff --git a/index_tests/usage/var_usage_class_member.cc b/index_tests/usage/var_usage_class_member.cc index fae2ad3d..81a61d37 100644 --- a/index_tests/usage/var_usage_class_member.cc +++ b/index_tests/usage/var_usage_class_member.cc @@ -35,7 +35,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [14669930844300034456], "uses": [], "callees": [] }, { @@ -52,20 +52,6 @@ OUTPUT: "vars": [], "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, "detailed_name": "void accept(int)", diff --git a/index_tests/usage/var_usage_class_member_static.cc b/index_tests/usage/var_usage_class_member_static.cc index 4dad3dd9..3f939310 100644 --- a/index_tests/usage/var_usage_class_member_static.cc +++ b/index_tests/usage/var_usage_class_member_static.cc @@ -29,20 +29,6 @@ OUTPUT: "vars": [], "uses": [], "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)", diff --git a/index_tests/usage/var_usage_cstyle_cast.cc b/index_tests/usage/var_usage_cstyle_cast.cc index 91299674..a4d7e720 100644 --- a/index_tests/usage/var_usage_cstyle_cast.cc +++ b/index_tests/usage/var_usage_cstyle_cast.cc @@ -12,21 +12,7 @@ OUTPUT: { "includes": [], "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 5792006888140599735, "detailed_name": "enum VarType {\n}", @@ -67,7 +53,7 @@ OUTPUT: "detailed_name": "static constexpr VarType Holder::static_var", "qual_name_offset": 25, "short_name": "static_var", - "hover": "static constexpr VarType Holder::static_var = (VarType)0", + "hover": "static constexpr VarType Holder::static_var = (VarType)0x0", "declarations": ["4:28-4:38|10028537921178202800|2|513"], "spell": "7:23-7:33|10028537921178202800|2|514", "extent": "7:1-7:33|0|1|0", diff --git a/index_tests/usage/var_usage_func_parameter.cc b/index_tests/usage/var_usage_func_parameter.cc index 0a97cd9b..8938f552 100644 --- a/index_tests/usage/var_usage_func_parameter.cc +++ b/index_tests/usage/var_usage_func_parameter.cc @@ -19,7 +19,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [10063793875496522529], "uses": [], "callees": [] }], diff --git a/index_tests/usage/var_usage_local.cc b/index_tests/usage/var_usage_local.cc index 4eb8c803..7adc7df4 100644 --- a/index_tests/usage/var_usage_local.cc +++ b/index_tests/usage/var_usage_local.cc @@ -20,7 +20,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [14014650769929566957], "uses": [], "callees": [] }], diff --git a/index_tests/usage/var_usage_shadowed_local.cc b/index_tests/usage/var_usage_shadowed_local.cc index 23e465f0..8c8dc547 100644 --- a/index_tests/usage/var_usage_shadowed_local.cc +++ b/index_tests/usage/var_usage_shadowed_local.cc @@ -25,7 +25,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [13311055950748663970, 14036425367303419504], "uses": [], "callees": [] }], diff --git a/index_tests/usage/var_usage_shadowed_parameter.cc b/index_tests/usage/var_usage_shadowed_parameter.cc index d94f26e5..9d926c28 100644 --- a/index_tests/usage/var_usage_shadowed_parameter.cc +++ b/index_tests/usage/var_usage_shadowed_parameter.cc @@ -25,7 +25,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [11608231465452906059, 6997229590862003559], "uses": [], "callees": [] }], diff --git a/index_tests/vars/class_member.cc b/index_tests/vars/class_member.cc index 408ed566..b20a65bd 100644 --- a/index_tests/vars/class_member.cc +++ b/index_tests/vars/class_member.cc @@ -6,21 +6,7 @@ OUTPUT: { "includes": [], "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 15041163540773201510, "detailed_name": "class Foo {}", diff --git a/index_tests/vars/class_static_member.cc b/index_tests/vars/class_static_member.cc index 0c94d4a7..84f65ba5 100644 --- a/index_tests/vars/class_static_member.cc +++ b/index_tests/vars/class_static_member.cc @@ -8,21 +8,7 @@ OUTPUT: { "includes": [], "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 15041163540773201510, "detailed_name": "class Foo {}", @@ -46,7 +32,6 @@ OUTPUT: "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|513"], "spell": "4:11-4:17|15041163540773201510|2|514", "extent": "4:1-4:27|0|1|0", diff --git a/index_tests/vars/class_static_member_decl_only.cc b/index_tests/vars/class_static_member_decl_only.cc index 694d8bc9..9689afe1 100644 --- a/index_tests/vars/class_static_member_decl_only.cc +++ b/index_tests/vars/class_static_member_decl_only.cc @@ -6,21 +6,7 @@ OUTPUT: { "includes": [], "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": [] - }], + "usr2func": [], "usr2type": [{ "usr": 53, "detailed_name": "", diff --git a/index_tests/vars/deduce_auto_type.cc b/index_tests/vars/deduce_auto_type.cc index 9848e6e2..8c9460a5 100644 --- a/index_tests/vars/deduce_auto_type.cc +++ b/index_tests/vars/deduce_auto_type.cc @@ -22,7 +22,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [10601729374837386290, 18422884837902130475], "uses": [], "callees": [] }], @@ -41,7 +41,7 @@ OUTPUT: "types": [], "funcs": [], "vars": [], - "instances": [18422884837902130475], + "instances": [10601729374837386290, 18422884837902130475], "uses": ["3:16-3:19|0|1|4", "4:17-4:20|0|1|4"] }], "usr2var": [{ @@ -53,16 +53,16 @@ OUTPUT: "declarations": [], "spell": "3:8-3:9|880549676430489861|3|2", "extent": "3:3-3:21|880549676430489861|3|0", - "type": 0, + "type": 15041163540773201510, "uses": [], "kind": 13, "storage": 0 }, { "usr": 18422884837902130475, - "detailed_name": "auto *y", - "qual_name_offset": 6, + "detailed_name": "Foo *y", + "qual_name_offset": 5, "short_name": "y", - "hover": "auto *y = new Foo()", + "hover": "Foo *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 dd9b4cf9..3cca9f45 100644 --- a/index_tests/vars/function_local.cc +++ b/index_tests/vars/function_local.cc @@ -22,7 +22,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [13198746475679542317], "uses": [], "callees": [] }], diff --git a/index_tests/vars/function_param.cc b/index_tests/vars/function_param.cc index 2e27fe01..06617a22 100644 --- a/index_tests/vars/function_param.cc +++ b/index_tests/vars/function_param.cc @@ -20,7 +20,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [8730439006497971620, 2525014371090380500], "uses": [], "callees": [] }], diff --git a/index_tests/vars/function_shadow_local.cc b/index_tests/vars/function_shadow_local.cc index 38e22362..5cb9abec 100644 --- a/index_tests/vars/function_shadow_local.cc +++ b/index_tests/vars/function_shadow_local.cc @@ -25,7 +25,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [1894874819807168345, 4508045017817092115], "uses": [], "callees": [] }], diff --git a/index_tests/vars/function_shadow_param.cc b/index_tests/vars/function_shadow_param.cc index ecfdec49..a28583f3 100644 --- a/index_tests/vars/function_shadow_param.cc +++ b/index_tests/vars/function_shadow_param.cc @@ -19,7 +19,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [5875271969926422921, 11404600766177939811], "uses": [], "callees": [] }], diff --git a/index_tests/vars/type_instance_on_using_type.cc b/index_tests/vars/type_instance_on_using_type.cc index 50004c7f..d35c568d 100644 --- a/index_tests/vars/type_instance_on_using_type.cc +++ b/index_tests/vars/type_instance_on_using_type.cc @@ -24,7 +24,7 @@ OUTPUT: "declaring_type": 0, "bases": [], "derived": [], - "vars": [], + "vars": [6975456769752895964], "uses": [], "callees": [] }], diff --git a/src/indexer.cc b/src/indexer.cc index 58d1ee21..0764112a 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -33,7 +33,12 @@ struct IndexParam { std::unordered_map SeenUniqueID; std::unordered_map file_contents; std::unordered_map file2write_time; - llvm::DenseMap Decl2usr; + struct DeclInfo { + Usr usr; + std::string short_name; + std::string qualified; + }; + std::unordered_map Decl2Info; ASTUnit& Unit; ASTContext* Ctx; @@ -68,6 +73,20 @@ struct IndexParam { } }; +StringRef GetSourceInRange(const SourceManager &SM, const LangOptions &LangOpts, + SourceRange R) { + SourceLocation BLoc = R.getBegin(), ELoc = R.getEnd(); + std::pair BInfo = SM.getDecomposedLoc(BLoc), + EInfo = SM.getDecomposedLoc(ELoc); + bool invalid = false; + StringRef Buf = SM.getBufferData(BInfo.first, &invalid); + if (invalid) + return ""; + return Buf.substr(BInfo.second, EInfo.second + Lexer::MeasureTokenLength( + ELoc, SM, LangOpts) - + BInfo.second); +} + Range FromSourceRange(const SourceManager &SM, const LangOptions &LangOpts, SourceRange R, llvm::sys::fs::UniqueID *UniqueID, bool token) { @@ -120,56 +139,65 @@ SymbolKind GetSymbolKind(const Decl* D) { case Decl::NamespaceAlias: case Decl::ClassTemplate: case Decl::TypeAliasTemplate: + case Decl::TemplateTemplateParm: case Decl::Enum: case Decl::Record: case Decl::CXXRecord: case Decl::ClassTemplateSpecialization: + case Decl::ClassTemplatePartialSpecialization: case Decl::TypeAlias: case Decl::Typedef: case Decl::UnresolvedUsingTypename: return SymbolKind::Type; + case Decl::VarTemplate: + case Decl::Binding: case Decl::Field: case Decl::Var: case Decl::ParmVar: case Decl::ImplicitParam: case Decl::Decomposition: case Decl::EnumConstant: + case Decl::UnresolvedUsingValue: return SymbolKind::Var; default: return SymbolKind::Invalid; } } +// clang/lib/AST/DeclPrinter.cpp +QualType GetBaseType(QualType T, bool deduce_auto) { + QualType BaseType = T; + while (!BaseType.isNull() && !BaseType->isSpecifierType()) { + if (const PointerType *PTy = BaseType->getAs()) + BaseType = PTy->getPointeeType(); + else if (const BlockPointerType *BPy = BaseType->getAs()) + BaseType = BPy->getPointeeType(); + else if (const ArrayType* ATy = dyn_cast(BaseType)) + BaseType = ATy->getElementType(); + else if (const VectorType *VTy = BaseType->getAs()) + BaseType = VTy->getElementType(); + else if (const ReferenceType *RTy = BaseType->getAs()) + BaseType = RTy->getPointeeType(); + else if (const ParenType *PTy = BaseType->getAs()) + BaseType = PTy->desugar(); + else if (deduce_auto) { + if (const AutoType *ATy = BaseType->getAs()) + BaseType = ATy->getDeducedType(); + else + break; + } + else + break; + } + return BaseType; +} + const Decl* GetTypeDecl(QualType T) { Decl *D = nullptr; - const Type *TP; - for(;;) { - T = T.getUnqualifiedType(); - TP = T.getTypePtrOrNull(); - if (!TP) - return D; - switch (TP->getTypeClass()) { - case Type::Pointer: - T = cast(TP)->getPointeeType(); - continue; - case Type::BlockPointer: - T = cast(TP)->getPointeeType(); - continue; - case Type::LValueReference: - case Type::RValueReference: - T = cast(TP)->getPointeeType(); - continue; - case Type::ObjCObjectPointer: - T = cast(TP)->getPointeeType(); - continue; - case Type::MemberPointer: - T = cast(TP)->getPointeeType(); - continue; - default: - break; - } - break; - } + T = GetBaseType(T.getUnqualifiedType(), true); + const Type* TP = T.getTypePtrOrNull(); + if (!TP) + return nullptr; try_again: switch (TP->getTypeClass()) { @@ -186,6 +214,9 @@ try_again: case Type::Enum: D = cast(TP)->getDecl(); break; + case Type::TemplateTypeParm: + D = cast(TP)->getDecl(); + break; case Type::TemplateSpecialization: if (const RecordType *Record = TP->getAs()) D = Record->getDecl(); @@ -310,15 +341,23 @@ public: return ret; } - Usr GetUsr(const Decl* D) const { + Usr GetUsr(const Decl *D, IndexParam::DeclInfo **info = nullptr) const { D = D->getCanonicalDecl(); - auto R = param.Decl2usr.try_emplace(D); + auto R = param.Decl2Info.try_emplace(D); if (R.second) { SmallString<256> USR; index::generateUSRForDecl(D, USR); - R.first->second = HashUsr(USR); + auto &info = R.first->second; + info.usr = HashUsr(USR); + if (auto *ND = dyn_cast(D)) { + info.short_name = ND->getNameAsString(); + info.qualified = ND->getQualifiedNameAsString(); + SimplifyAnonymous(info.qualified); + } } - return R.first->second; + if (info) + *info = &R.first->second; + return R.first->second.usr; } Use GetUse(IndexFile *db, Range range, const DeclContext *DC, @@ -364,13 +403,10 @@ public: template void SetName(const Decl *D, std::string_view short_name, - std::string_view qualified, Def &def, bool hover = false) { + std::string_view qualified, Def &def) { SmallString<256> Str; llvm::raw_svector_ostream OS(Str); - PrintingPolicy PP = GetDefaultPolicy(); - if (hover) - PP.SuppressInitializers = false; - D->print(OS, PP); + D->print(OS, GetDefaultPolicy()); std::string name = OS.str(); SimplifyAnonymous(name); @@ -378,44 +414,96 @@ public: 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()) { + def.short_name_offset = 0; + } else if (short_name.size() && (!i || name[i - 1] != ':')) { name.replace(i, short_name.size(), qualified); - if (!hover) - def.short_name_offset = i + qualified.size() - short_name.size(); + def.short_name_offset = i + qualified.size() - short_name.size(); } else { - if (!hover) - def.short_name_offset = i; + 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 SetVarName(const Decl *D, std::string_view short_name, + std::string_view qualified, IndexVar::Def &def) { + QualType T; + const Expr* init = nullptr; + if (auto *VD = dyn_cast(D)) { + T = VD->getType(); + init = VD->getAnyInitializer(); + def.storage = VD->getStorageClass(); + } else if (auto *FD = dyn_cast(D)) { + T = FD->getType(); + init = FD->getInClassInitializer(); + } + auto BT = GetBaseType(T, false); + if (!BT.isNull() && BT->getAs()) { + SmallString<256> Str; + llvm::raw_svector_ostream OS(Str); + PrintingPolicy PP = GetDefaultPolicy(); + T.print(OS, PP); + if (Str.size() && + (Str.back() != ' ' && Str.back() != '*' && Str.back() != '&')) + Str += ' '; + def.qual_name_offset = Str.size(); + def.short_name_offset = Str.size() + qualified.size() - short_name.size(); 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); + Str += StringRef(qualified.data(), qualified.size()); + def.detailed_name = Intern(Str.str()); + } else { + SetName(D, short_name, qualified, def); + } + if (init) { + SourceManager &SM = Ctx->getSourceManager(); + const LangOptions& Lang = Ctx->getLangOpts(); + SourceRange R = init->getSourceRange(); + SourceLocation L = D->getLocation(); + if (!SM.isBeforeInTranslationUnit(L, R.getBegin())) + return; + StringRef Buf = GetSourceInRange(SM, Lang, R); + Twine T = + def.detailed_name + + (Buf.size() && Buf[0] == ':' ? Twine(" ", Buf) : Twine(" = ", Buf)); + def.hover = + def.storage == SC_Static && strncmp(def.detailed_name, "static ", 7) + ? Intern(("static " + T).str()) + : Intern(T.str()); } } - void AddMacroUse(SourceManager &SM, std::vector &uses, + void AddMacroUse(SourceManager &SM, Usr usr, SymbolKind kind, 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)); + if (!FE) return; + IndexFile *db = param.ConsumeFile(*FE); + if (!db) return; + Range spell = + FromTokenRange(SM, Ctx->getLangOpts(), SourceRange(Spell, Spell)); + Use use = GetUse(db, spell, nullptr, Role::Dynamic); + switch (kind) { + case SymbolKind::Func: + db->ToFunc(usr).uses.push_back(use); + break; + case SymbolKind::Type: + db->ToType(usr).uses.push_back(use); + break; + case SymbolKind::Var: + db->ToVar(usr).uses.push_back(use); + break; + default: + llvm_unreachable(""); } } @@ -447,17 +535,20 @@ public: SourceLocation Spell = SM.getSpellingLoc(Loc); Loc = SM.getFileLoc(Loc); Range loc = FromTokenRange(SM, Lang, SourceRange(Loc, Loc)); - const FileEntry *FE = SM.getFileEntryForID(SM.getFileID(Loc)); + FileID LocFID = SM.getFileID(Loc); + const FileEntry *FE = SM.getFileEntryForID(LocFID); if (!FE) { // TODO #if LLVM_VERSION_MAJOR < 7 auto P = SM.getExpansionRange(Loc); loc = FromCharRange(SM, Ctx->getLangOpts(), SourceRange(P.first, P.second)); - FE = SM.getFileEntryForID(SM.getFileID(P.first)); + LocFID = SM.getFileID(P.first); + FE = SM.getFileEntryForID(LocFID); #else auto R = SM.getExpansionRange(Loc); loc = FromTokenRange(SM, Lang, R.getAsRange()); - FE = SM.getFileEntryForID(SM.getFileID(R.getBegin())); + LocFID = SM.getFileID(R.getBegin()); + FE = SM.getFileEntryForID(LocFID); #endif if (!FE) return true; @@ -473,26 +564,14 @@ public: bool is_decl = Roles & uint32_t(index::SymbolRole::Declaration); bool is_def = Roles & uint32_t(index::SymbolRole::Definition); - std::string short_name, qualified; - - 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); - Usr usr = GetUsr(D); + IndexParam::DeclInfo* info; + Usr usr = GetUsr(D, &info); auto do_def_decl = [&](auto *entity) { - if (!entity->def.detailed_name[0]) { - SetName(D, short_name, qualified, entity->def); - if (entity->def.comments[0] == '\0' && g_config->index.comments) - entity->def.comments = Intern(GetComment(D)); - } if (is_def) { entity->def.spell = GetUse(db, loc, SemDC, role); entity->def.extent = @@ -502,19 +581,25 @@ public: entity->declarations.push_back(GetUse(db, loc, LexDC, role)); } else { entity->uses.push_back(GetUse(db, loc, LexDC, role)); + return; } - if (Spell != Loc) - AddMacroUse(SM, entity->uses, Spell); + if (entity->def.comments[0] == '\0' && g_config->index.comments) + entity->def.comments = Intern(GetComment(OrigD)); }; switch (kind) { case SymbolKind::Invalid: - LOG_S(INFO) << "Unhandled " << int(D->getKind()); + LOG_S(INFO) << "Unhandled " << int(D->getKind()) << " " << info->qualified + << " in " << db->path << ":" << loc.start.line; return true; case SymbolKind::File: return true; case SymbolKind::Func: func = &db->ToFunc(usr); do_def_decl(func); + if (Spell != Loc) + AddMacroUse(SM, usr, SymbolKind::Func, Spell); + if (func->def.detailed_name[0] == '\0') + SetName(OrigD, info->short_name, info->qualified, func->def); if (is_def || is_decl) { const Decl* DC = cast(SemDC); if (GetSymbolKind(DC) == SymbolKind::Type) @@ -524,6 +609,10 @@ public: case SymbolKind::Type: type = &db->ToType(usr); do_def_decl(type); + if (Spell != Loc) + AddMacroUse(SM, usr, SymbolKind::Type, Spell); + if (type->def.detailed_name[0] == '\0') + SetName(OrigD, info->short_name, info->qualified, type->def); if (is_def || is_decl) { const Decl* DC = cast(SemDC); if (GetSymbolKind(DC) == SymbolKind::Type) @@ -533,28 +622,21 @@ public: case SymbolKind::Var: var = &db->ToVar(usr); do_def_decl(var); + if (Spell != Loc) + AddMacroUse(SM, usr, SymbolKind::Var, Spell); + if (var->def.detailed_name[0] == '\0') + SetVarName(OrigD, info->short_name, info->qualified, var->def); + QualType T; + if (auto *VD = dyn_cast(D)) + T = VD->getType(); + else if (auto *FD = dyn_cast(D)) + T = FD->getType(); if (is_def || is_decl) { const Decl* DC = cast(SemDC); - if (GetSymbolKind(DC) == SymbolKind::Type) + if (GetSymbolKind(DC) == SymbolKind::Func) 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(); - 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()); @@ -562,16 +644,41 @@ public: db->ToType(usr1).instances.push_back(usr); } else { for (const Decl *D1 = GetTypeDecl(T); D1; D1 = GetSpecialized(D1)) { - Usr usr1 = GetUsr(D1); + IndexParam::DeclInfo* info1; + Usr usr1 = GetUsr(D1, &info1); auto it = db->usr2type.find(usr1); if (it != db->usr2type.end()) { var->def.type = usr1; it->second.instances.push_back(usr); break; } + // e.g. TemplateTypeParmDecl is not handled by handleDeclOccurence. + SourceRange R1 = D1->getSourceRange(); + if (SM.getFileID(R1.getBegin()) == LocFID) { + IndexType& type1 = db->ToType(usr1); + Range loc1 = FromTokenRange(SM, Lang, R1); + type1.def.spell = GetUse(db, loc1, SemDC, Role::Definition); + type1.def.extent = GetUse(db, loc1, LexDC, Role::None); + type1.def.detailed_name = Intern(info1->short_name); + type1.def.short_name_size = int16_t(info1->short_name.size()); + type1.def.kind = lsSymbolKind::TypeParameter; + var->def.type = usr1; + type1.instances.push_back(usr); + break; + } } } } + } else if (!var->def.spell && var->declarations.empty()) { + // e.g. lambda parameter + SourceLocation L = OrigD->getLocation(); + if (SM.getFileID(L) == LocFID) { + var->def.spell = GetUse(db, FromTokenRange(SM, Lang, {L, L}), SemDC, + Role::Definition); + var->def.extent = + GetUse(db, FromTokenRange(SM, Lang, OrigD->getSourceRange()), + LexDC, Role::None); + } } break; } @@ -640,8 +747,13 @@ public: break; case Decl::TypeAliasTemplate: type->def.kind = lsSymbolKind::TypeAlias; + case Decl::VarTemplate: + type->def.kind = lsSymbolKind::Variable; + case Decl::TemplateTemplateParm: + type->def.kind = lsSymbolKind::TypeParameter; break; case Decl::ClassTemplateSpecialization: + case Decl::ClassTemplatePartialSpecialization: type->def.kind = lsSymbolKind::Class; if (is_def || is_decl) { if (auto *RD = dyn_cast(D)) { @@ -683,6 +795,11 @@ public: } } break; + case Decl::Binding: + var->def.kind = lsSymbolKind::Variable; + case Decl::Field: + var->def.kind = lsSymbolKind::Field; + break; case Decl::Function: func->def.kind = lsSymbolKind::Function; break; @@ -710,9 +827,6 @@ public: case Decl::CXXDestructor: func->def.kind = lsSymbolKind::Method; break; - case Decl::Field: - var->def.kind = lsSymbolKind::Field; - break; case Decl::Var: case Decl::Decomposition: var->def.kind = lsSymbolKind::Variable; @@ -734,6 +848,9 @@ public: var->def.hover = Intern(var->def.detailed_name + init); } break; + case Decl::UnresolvedUsingValue: + var->def.kind = lsSymbolKind::Variable; + break; default: LOG_S(INFO) << "Unhandled " << int(D->getKind()); break; @@ -754,13 +871,18 @@ class IndexPPCallbacks : public PPCallbacks { } public: - IndexPPCallbacks(SourceManager& SM, IndexParam& param) : SM(SM), param(param) {} + IndexPPCallbacks(SourceManager &SM, IndexParam ¶m) + : SM(SM), param(param) {} void InclusionDirective(SourceLocation HashLoc, const Token &Tok, StringRef Included, bool IsAngled, CharSourceRange FilenameRange, const FileEntry *File, StringRef SearchPath, StringRef RelativePath, - const Module *Imported, - SrcMgr::CharacteristicKind FileType) override { + const Module *Imported +#if LLVM_VERSION_MAJOR >= 7 + , + SrcMgr::CharacteristicKind FileType +#endif + ) override { if (!File) return; llvm::sys::fs::UniqueID UniqueID; @@ -777,25 +899,27 @@ public: } void MacroDefined(const Token &Tok, const MacroDirective *MD) override { llvm::sys::fs::UniqueID UniqueID; + const LangOptions& Lang = param.Ctx->getLangOpts(); 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]) { + auto range = FromTokenRange(SM, Lang, {L, L}, &UniqueID); + 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}}; + const MacroInfo *MI = MD->getMacroInfo(); + SourceRange R(MI->getDefinitionLoc(), MI->getDefinitionEndLoc()); + range = FromTokenRange(SM, param.Ctx->getLangOpts(), R); + var.def.extent = Use{{range, 0, SymbolKind::File, Role::None}}; + if (var.def.detailed_name[0] == '\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; + var.def.hover = Intern(Twine("#define ", GetSourceInRange(SM, Lang, R)).str()); } } } diff --git a/src/message_handler.cc b/src/message_handler.cc index 86e7d23c..a30ef685 100644 --- a/src/message_handler.cc +++ b/src/message_handler.cc @@ -14,17 +14,17 @@ MAKE_HASHABLE(SymbolIdx, t.usr, t.kind); namespace { -struct Out_CclsSetInactiveRegion - : public lsOutMessage { +struct Out_CclsSetSkippedRanges + : public lsOutMessage { struct Params { lsDocumentUri uri; - std::vector inactiveRegions; + std::vector skippedRanges; }; - std::string method = "$ccls/setInactiveRegions"; + std::string method = "$ccls/setSkippedRanges"; Params params; }; -MAKE_REFLECT_STRUCT(Out_CclsSetInactiveRegion::Params, uri, inactiveRegions); -MAKE_REFLECT_STRUCT(Out_CclsSetInactiveRegion, jsonrpc, method, params); +MAKE_REFLECT_STRUCT(Out_CclsSetSkippedRanges::Params, uri, skippedRanges); +MAKE_REFLECT_STRUCT(Out_CclsSetSkippedRanges, jsonrpc, method, params); struct ScanLineEvent { lsPosition pos; @@ -177,14 +177,14 @@ bool FindFileOrFail(DB* db, void EmitSkippedRanges(WorkingFile *working_file, const std::vector &skipped_ranges) { - Out_CclsSetInactiveRegion out; + Out_CclsSetSkippedRanges out; out.params.uri = lsDocumentUri::FromPath(working_file->filename); for (Range skipped : skipped_ranges) { std::optional ls_skipped = GetLsRange(working_file, skipped); if (ls_skipped) - out.params.inactiveRegions.push_back(*ls_skipped); + out.params.skippedRanges.push_back(*ls_skipped); } - pipeline::WriteStdout(kMethodType_CclsPublishInactiveRegions, out); + pipeline::WriteStdout(kMethodType_CclsPublishSkippedRanges, out); } void EmitSemanticHighlighting(DB* db, diff --git a/src/method.cc b/src/method.cc index 722d6fb2..914e2d4f 100644 --- a/src/method.cc +++ b/src/method.cc @@ -4,8 +4,8 @@ MethodType kMethodType_Unknown = "$unknown"; MethodType kMethodType_Exit = "exit"; MethodType kMethodType_TextDocumentPublishDiagnostics = "textDocument/publishDiagnostics"; -MethodType kMethodType_CclsPublishInactiveRegions = - "$ccls/publishInactiveRegions"; +MethodType kMethodType_CclsPublishSkippedRanges = + "$ccls/publishSkippedRanges"; MethodType kMethodType_CclsPublishSemanticHighlighting = "$ccls/publishSemanticHighlighting"; diff --git a/src/method.h b/src/method.h index 525c409a..a7317b1e 100644 --- a/src/method.h +++ b/src/method.h @@ -9,7 +9,7 @@ using MethodType = const char*; extern MethodType kMethodType_Unknown; extern MethodType kMethodType_Exit; extern MethodType kMethodType_TextDocumentPublishDiagnostics; -extern MethodType kMethodType_CclsPublishInactiveRegions; +extern MethodType kMethodType_CclsPublishSkippedRanges; extern MethodType kMethodType_CclsPublishSemanticHighlighting; struct lsRequestId { diff --git a/src/pipeline.cc b/src/pipeline.cc index 3b7f0cd6..bbced1d9 100644 --- a/src/pipeline.cc +++ b/src/pipeline.cc @@ -320,7 +320,7 @@ void Main_OnIndexed(DB* db, db->ApplyIndexUpdate(update); timer.stopTimer(); - // Update indexed content, inactive lines, and semantic highlighting. + // Update indexed content, skipped ranges, and semantic highlighting. if (update->files_def_update) { auto& def_u = *update->files_def_update; LOG_S(INFO) << "apply index for " << def_u.first.path;