diff --git a/index_tests/class_forward_declaration.cc b/index_tests/class_forward_declaration.cc index e2194d75..231a7c44 100644 --- a/index_tests/class_forward_declaration.cc +++ b/index_tests/class_forward_declaration.cc @@ -12,6 +12,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": ["1:7-1:10|-1|1|1", "2:7-2:10|-1|1|1", "4:7-4:10|-1|1|1"], diff --git a/index_tests/constructors/constructor.cc b/index_tests/constructors/constructor.cc index e779b786..b36665ad 100644 --- a/index_tests/constructors/constructor.cc +++ b/index_tests/constructors/constructor.cc @@ -17,6 +17,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": ["3:3-3:6|-1|1|4"], @@ -34,6 +35,7 @@ OUTPUT: "id": 0, "usr": 3385168158331140247, "detailed_name": "void Foo::Foo()", + "qual_name_offset": 5, "short_name": "Foo", "kind": 9, "storage": 1, @@ -50,6 +52,7 @@ OUTPUT: "id": 1, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -66,6 +69,7 @@ OUTPUT: "id": 0, "usr": 10983126130596230582, "detailed_name": "Foo f", + "qual_name_offset": 4, "short_name": "f", "declarations": [], "spell": "7:7-7:8|1|3|2", @@ -78,6 +82,7 @@ OUTPUT: "id": 1, "usr": 17165811951126099095, "detailed_name": "Foo *f2", + "qual_name_offset": 5, "short_name": "f2", "hover": "Foo *f2 = new Foo()", "declarations": [], diff --git a/index_tests/constructors/destructor.cc b/index_tests/constructors/destructor.cc index 12482769..59c46409 100644 --- a/index_tests/constructors/destructor.cc +++ b/index_tests/constructors/destructor.cc @@ -22,6 +22,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": ["3:3-3:6|-1|1|4", "4:4-4:7|-1|1|4"], @@ -39,6 +40,7 @@ OUTPUT: "id": 0, "usr": 3385168158331140247, "detailed_name": "void Foo::Foo()", + "qual_name_offset": 5, "short_name": "Foo", "kind": 9, "storage": 1, @@ -55,6 +57,7 @@ OUTPUT: "id": 1, "usr": 7440261702884428359, "detailed_name": "void Foo::~Foo() noexcept", + "qual_name_offset": 5, "short_name": "~Foo", "kind": 6, "storage": 1, @@ -71,6 +74,7 @@ OUTPUT: "id": 2, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -87,6 +91,7 @@ OUTPUT: "id": 0, "usr": 1893354193220338759, "detailed_name": "Foo f", + "qual_name_offset": 4, "short_name": "f", "declarations": [], "spell": "8:7-8:8|2|3|2", diff --git a/index_tests/constructors/implicit_constructor.cc b/index_tests/constructors/implicit_constructor.cc index 30589861..bd7b719e 100644 --- a/index_tests/constructors/implicit_constructor.cc +++ b/index_tests/constructors/implicit_constructor.cc @@ -16,6 +16,7 @@ OUTPUT: "id": 0, "usr": 13487927231218873822, "detailed_name": "Type", + "qual_name_offset": 0, "short_name": "Type", "kind": 23, "declarations": ["2:3-2:7|-1|1|4"], @@ -33,6 +34,7 @@ OUTPUT: "id": 0, "usr": 10530961286677896857, "detailed_name": "void Type::Type()", + "qual_name_offset": 5, "short_name": "Type", "kind": 9, "storage": 1, @@ -49,6 +51,7 @@ OUTPUT: "id": 1, "usr": 3957104924306079513, "detailed_name": "void Make()", + "qual_name_offset": 5, "short_name": "Make", "kind": 12, "storage": 1, @@ -65,6 +68,7 @@ OUTPUT: "id": 0, "usr": 449111627548814328, "detailed_name": "Type foo0", + "qual_name_offset": 5, "short_name": "foo0", "declarations": [], "spell": "6:8-6:12|1|3|2", @@ -77,6 +81,7 @@ OUTPUT: "id": 1, "usr": 17097499197730163115, "detailed_name": "Type foo1", + "qual_name_offset": 5, "short_name": "foo1", "declarations": [], "spell": "7:8-7:12|1|3|2", diff --git a/index_tests/constructors/invalid_reference.cc b/index_tests/constructors/invalid_reference.cc index 31bacba3..6b808793 100644 --- a/index_tests/constructors/invalid_reference.cc +++ b/index_tests/constructors/invalid_reference.cc @@ -16,6 +16,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": ["4:6-4:9|-1|1|4"], @@ -33,6 +34,7 @@ OUTPUT: "id": 0, "usr": 17319723337446061757, "detailed_name": "void Foo::Foo()", + "qual_name_offset": 5, "short_name": "Foo", "kind": 9, "storage": 1, diff --git a/index_tests/constructors/make_functions.cc b/index_tests/constructors/make_functions.cc index ab2d2cd5..a2c3a4be 100644 --- a/index_tests/constructors/make_functions.cc +++ b/index_tests/constructors/make_functions.cc @@ -32,6 +32,7 @@ OUTPUT: make_functions.h "id": 0, "usr": 12993848456528750350, "detailed_name": "Bar", + "qual_name_offset": 0, "short_name": "Bar", "kind": 23, "declarations": [], @@ -48,6 +49,7 @@ OUTPUT: make_functions.h "id": 1, "usr": 14935975554338052500, "detailed_name": "Foobar", + "qual_name_offset": 0, "short_name": "Foobar", "kind": 5, "declarations": ["5:3-5:9|-1|1|4", "6:3-6:9|-1|1|4", "7:3-7:9|-1|1|4", "8:3-8:9|-1|1|4"], @@ -65,6 +67,7 @@ OUTPUT: make_functions.h "id": 0, "usr": 13131778807733950299, "detailed_name": "void Foobar::Foobar()", + "qual_name_offset": 5, "short_name": "Foobar", "kind": 9, "storage": 1, @@ -81,6 +84,7 @@ OUTPUT: make_functions.h "id": 1, "usr": 13028995015627606181, "detailed_name": "void Foobar::Foobar(int)", + "qual_name_offset": 5, "short_name": "Foobar", "kind": 9, "storage": 1, @@ -97,6 +101,7 @@ OUTPUT: make_functions.h "id": 2, "usr": 3765833212244435302, "detailed_name": "void Foobar::Foobar(int &&, Bar *, bool *)", + "qual_name_offset": 5, "short_name": "Foobar", "kind": 9, "storage": 1, @@ -113,6 +118,7 @@ OUTPUT: make_functions.h "id": 3, "usr": 17321436359755983845, "detailed_name": "void Foobar::Foobar(int, Bar *, bool *)", + "qual_name_offset": 5, "short_name": "Foobar", "kind": 9, "storage": 1, @@ -139,6 +145,7 @@ OUTPUT: make_functions.cc "id": 0, "usr": 9281343527065946499, "detailed_name": "T", + "qual_name_offset": 0, "short_name": "T", "kind": 26, "declarations": [], @@ -155,6 +162,7 @@ OUTPUT: make_functions.cc "id": 1, "usr": 10771590811355716928, "detailed_name": "Args", + "qual_name_offset": 0, "short_name": "Args", "kind": 26, "declarations": [], @@ -171,6 +179,7 @@ OUTPUT: make_functions.cc "id": 2, "usr": 11897454629873246477, "detailed_name": "T", + "qual_name_offset": 0, "short_name": "T", "kind": 26, "declarations": [], @@ -187,6 +196,7 @@ OUTPUT: make_functions.cc "id": 3, "usr": 3337128087216004141, "detailed_name": "Args", + "qual_name_offset": 0, "short_name": "Args", "kind": 26, "declarations": [], @@ -203,6 +213,7 @@ OUTPUT: make_functions.cc "id": 4, "usr": 14935975554338052500, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -217,6 +228,7 @@ OUTPUT: make_functions.cc "id": 5, "usr": 12993848456528750350, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -232,6 +244,7 @@ OUTPUT: make_functions.cc "id": 0, "usr": 15793662558620604611, "detailed_name": "T *MakeUnique(Args &&... args)", + "qual_name_offset": 3, "short_name": "MakeUnique", "kind": 12, "storage": 1, @@ -247,6 +260,7 @@ OUTPUT: make_functions.cc "id": 1, "usr": 2532818908869373467, "detailed_name": "T *maKE_NoRefs(Args... args)", + "qual_name_offset": 3, "short_name": "maKE_NoRefs", "kind": 12, "storage": 1, @@ -262,6 +276,7 @@ OUTPUT: make_functions.cc "id": 2, "usr": 2816883305867289955, "detailed_name": "void caller22()", + "qual_name_offset": 5, "short_name": "caller22", "kind": 12, "storage": 1, @@ -277,6 +292,7 @@ OUTPUT: make_functions.cc "id": 3, "usr": 13131778807733950299, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "storage": 0, @@ -290,6 +306,7 @@ OUTPUT: make_functions.cc "id": 4, "usr": 13028995015627606181, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "storage": 0, @@ -303,6 +320,7 @@ OUTPUT: make_functions.cc "id": 5, "usr": 3765833212244435302, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "storage": 0, @@ -316,6 +334,7 @@ OUTPUT: make_functions.cc "id": 6, "usr": 17321436359755983845, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "storage": 0, @@ -330,6 +349,7 @@ OUTPUT: make_functions.cc "id": 0, "usr": 8463700030555379526, "detailed_name": "Args &&... args", + "qual_name_offset": 11, "short_name": "args", "declarations": [], "spell": "4:25-4:29|0|3|2", @@ -341,6 +361,7 @@ OUTPUT: make_functions.cc "id": 1, "usr": 3908732770590594660, "detailed_name": "Args... args", + "qual_name_offset": 8, "short_name": "args", "declarations": [], "spell": "9:24-9:28|1|3|2", diff --git a/index_tests/declaration_vs_definition/class.cc b/index_tests/declaration_vs_definition/class.cc index 00e22bc4..e8c79d61 100644 --- a/index_tests/declaration_vs_definition/class.cc +++ b/index_tests/declaration_vs_definition/class.cc @@ -14,6 +14,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": ["1:7-1:10|-1|1|1", "2:7-2:10|-1|1|1", "4:7-4:10|-1|1|1"], diff --git a/index_tests/declaration_vs_definition/class_member.cc b/index_tests/declaration_vs_definition/class_member.cc index ccbbd2c9..e51cbddc 100644 --- a/index_tests/declaration_vs_definition/class_member.cc +++ b/index_tests/declaration_vs_definition/class_member.cc @@ -11,6 +11,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -27,6 +28,7 @@ OUTPUT: "id": 1, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -43,6 +45,7 @@ OUTPUT: "id": 0, "usr": 9736582033442720743, "detailed_name": "int Foo::foo", + "qual_name_offset": 4, "short_name": "foo", "declarations": [], "spell": "2:7-2:10|0|2|2", diff --git a/index_tests/declaration_vs_definition/class_member_static.cc b/index_tests/declaration_vs_definition/class_member_static.cc index 838913bc..6dcb0b31 100644 --- a/index_tests/declaration_vs_definition/class_member_static.cc +++ b/index_tests/declaration_vs_definition/class_member_static.cc @@ -13,6 +13,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -29,6 +30,7 @@ OUTPUT: "id": 1, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -45,6 +47,7 @@ OUTPUT: "id": 0, "usr": 8942920329766232482, "detailed_name": "int Foo::foo", + "qual_name_offset": 4, "short_name": "foo", "declarations": ["2:14-2:17|0|2|1"], "spell": "5:10-5:13|0|2|2", diff --git a/index_tests/declaration_vs_definition/func.cc b/index_tests/declaration_vs_definition/func.cc index 8e69aeb1..7c73e6f0 100644 --- a/index_tests/declaration_vs_definition/func.cc +++ b/index_tests/declaration_vs_definition/func.cc @@ -14,6 +14,7 @@ OUTPUT: "id": 0, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, 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 e3aba26f..ee705c0d 100644 --- a/index_tests/declaration_vs_definition/func_associated_function_params.cc +++ b/index_tests/declaration_vs_definition/func_associated_function_params.cc @@ -13,6 +13,7 @@ OUTPUT: "id": 0, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -28,6 +29,7 @@ OUTPUT: "id": 0, "usr": 2747674671862363334, "detailed_name": "int foo(int a, int b)", + "qual_name_offset": 4, "short_name": "foo", "kind": 12, "storage": 1, @@ -53,6 +55,7 @@ OUTPUT: "id": 0, "usr": 14555488990109936920, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "declarations": [], "spell": "5:13-5:14|0|3|2", @@ -65,6 +68,7 @@ OUTPUT: "id": 1, "usr": 10963664335057337329, "detailed_name": "int b", + "qual_name_offset": 4, "short_name": "b", "declarations": [], "spell": "5:20-5:21|0|3|2", diff --git a/index_tests/declaration_vs_definition/method.cc b/index_tests/declaration_vs_definition/method.cc index 1be15a33..9ce1eb05 100644 --- a/index_tests/declaration_vs_definition/method.cc +++ b/index_tests/declaration_vs_definition/method.cc @@ -15,6 +15,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -32,6 +33,7 @@ OUTPUT: "id": 0, "usr": 4012226004228259562, "detailed_name": "void Foo::declonly()", + "qual_name_offset": 5, "short_name": "declonly", "kind": 6, "storage": 1, @@ -49,6 +51,7 @@ OUTPUT: "id": 1, "usr": 10939323144126021546, "detailed_name": "void Foo::purevirtual()", + "qual_name_offset": 5, "short_name": "purevirtual", "kind": 6, "storage": 1, @@ -66,6 +69,7 @@ OUTPUT: "id": 2, "usr": 15416083548883122431, "detailed_name": "void Foo::def()", + "qual_name_offset": 5, "short_name": "def", "kind": 6, "storage": 1, diff --git a/index_tests/enums/enum_class_decl.cc b/index_tests/enums/enum_class_decl.cc index 6d1cd6fb..9c0b8adc 100644 --- a/index_tests/enums/enum_class_decl.cc +++ b/index_tests/enums/enum_class_decl.cc @@ -13,6 +13,7 @@ OUTPUT: "id": 0, "usr": 5, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -27,6 +28,7 @@ OUTPUT: "id": 1, "usr": 2010430204259339553, "detailed_name": "uint8_t", + "qual_name_offset": 0, "short_name": "uint8_t", "kind": 252, "hover": "typedef unsigned char uint8_t", @@ -45,6 +47,7 @@ OUTPUT: "id": 2, "usr": 16985894625255407295, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 10, "declarations": [], @@ -63,6 +66,7 @@ OUTPUT: "id": 0, "usr": 439339022761937396, "detailed_name": "Foo::A", + "qual_name_offset": 0, "short_name": "A", "hover": "Foo::A = 0", "declarations": [], @@ -76,6 +80,7 @@ OUTPUT: "id": 1, "usr": 15962370213938840720, "detailed_name": "Foo::B", + "qual_name_offset": 0, "short_name": "B", "hover": "Foo::B = 20", "declarations": [], diff --git a/index_tests/enums/enum_decl.cc b/index_tests/enums/enum_decl.cc index 9240c5a5..d7a3ec92 100644 --- a/index_tests/enums/enum_decl.cc +++ b/index_tests/enums/enum_decl.cc @@ -12,6 +12,7 @@ OUTPUT: "id": 0, "usr": 16985894625255407295, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 10, "declarations": [], @@ -30,6 +31,7 @@ OUTPUT: "id": 0, "usr": 439339022761937396, "detailed_name": "Foo::A", + "qual_name_offset": 0, "short_name": "A", "hover": "Foo::A = 0", "declarations": [], @@ -43,6 +45,7 @@ OUTPUT: "id": 1, "usr": 15962370213938840720, "detailed_name": "Foo::B", + "qual_name_offset": 0, "short_name": "B", "hover": "Foo::B = 20", "declarations": [], diff --git a/index_tests/enums/enum_inherit.cc b/index_tests/enums/enum_inherit.cc index 9ee6bcdf..7f4a12c5 100644 --- a/index_tests/enums/enum_inherit.cc +++ b/index_tests/enums/enum_inherit.cc @@ -19,6 +19,7 @@ OUTPUT: "id": 0, "usr": 16985894625255407295, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 10, "declarations": [], @@ -35,6 +36,7 @@ OUTPUT: "id": 1, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -49,6 +51,7 @@ OUTPUT: "id": 2, "usr": 14939241684006947339, "detailed_name": "int32_t", + "qual_name_offset": 0, "short_name": "int32_t", "kind": 252, "hover": "typedef int int32_t", @@ -67,6 +70,7 @@ OUTPUT: "id": 3, "usr": 2986879766914123941, "detailed_name": "E", + "qual_name_offset": 0, "short_name": "E", "kind": 10, "declarations": [], @@ -85,6 +89,7 @@ OUTPUT: "id": 0, "usr": 439339022761937396, "detailed_name": "Foo::A", + "qual_name_offset": 0, "short_name": "A", "hover": "Foo::A = 0", "declarations": [], @@ -98,6 +103,7 @@ OUTPUT: "id": 1, "usr": 15962370213938840720, "detailed_name": "Foo::B", + "qual_name_offset": 0, "short_name": "B", "hover": "Foo::B = 20", "declarations": [], @@ -111,6 +117,7 @@ OUTPUT: "id": 2, "usr": 16614320383091394267, "detailed_name": "E::E0", + "qual_name_offset": 0, "short_name": "E0", "hover": "E::E0 = 0", "declarations": [], @@ -124,6 +131,7 @@ OUTPUT: "id": 3, "usr": 16847439761518576294, "detailed_name": "E::E20", + "qual_name_offset": 0, "short_name": "E20", "hover": "E::E20 = 20", "declarations": [], diff --git a/index_tests/enums/enum_usage.cc b/index_tests/enums/enum_usage.cc index c019a36c..d18ace6a 100644 --- a/index_tests/enums/enum_usage.cc +++ b/index_tests/enums/enum_usage.cc @@ -14,6 +14,7 @@ OUTPUT: "id": 0, "usr": 16985894625255407295, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 10, "declarations": [], @@ -32,6 +33,7 @@ OUTPUT: "id": 0, "usr": 439339022761937396, "detailed_name": "Foo::A", + "qual_name_offset": 0, "short_name": "A", "hover": "Foo::A = 0", "declarations": [], @@ -45,6 +47,7 @@ OUTPUT: "id": 1, "usr": 15962370213938840720, "detailed_name": "Foo::B", + "qual_name_offset": 0, "short_name": "B", "hover": "Foo::B = 20", "declarations": [], @@ -58,6 +61,7 @@ OUTPUT: "id": 2, "usr": 10677751717622394455, "detailed_name": "Foo x", + "qual_name_offset": 4, "short_name": "x", "hover": "Foo x = Foo::A", "declarations": [], diff --git a/index_tests/foobar.cc b/index_tests/foobar.cc index 0d240d27..68e2e44a 100644 --- a/index_tests/foobar.cc +++ b/index_tests/foobar.cc @@ -17,6 +17,7 @@ OUTPUT: "id": 0, "usr": 6697181287623958829, "detailed_name": "A", + "qual_name_offset": 0, "short_name": "A", "kind": 10, "declarations": [], @@ -33,6 +34,7 @@ OUTPUT: "id": 1, "usr": 13892793056005362145, "detailed_name": "B", + "qual_name_offset": 0, "short_name": "B", "kind": 10, "declarations": [], @@ -49,6 +51,7 @@ OUTPUT: "id": 2, "usr": 10528472276654770367, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -65,6 +68,7 @@ OUTPUT: "id": 3, "usr": 13938528237873543349, "detailed_name": "Foo::Inner", + "qual_name_offset": 0, "short_name": "Inner", "kind": 23, "declarations": [], @@ -83,6 +87,7 @@ OUTPUT: "id": 0, "usr": 16721564935990383768, "detailed_name": "Foo::Inner a", + "qual_name_offset": 14, "short_name": "a", "declarations": [], "spell": "9:15-9:16|-1|1|2", @@ -95,6 +100,7 @@ OUTPUT: "id": 1, "usr": 12028309045033782423, "detailed_name": "Foo b", + "qual_name_offset": 7, "short_name": "b", "declarations": [], "spell": "10:8-10:9|-1|1|2", diff --git a/index_tests/function_declaration.cc b/index_tests/function_declaration.cc index a9bb6ae1..5f325e41 100644 --- a/index_tests/function_declaration.cc +++ b/index_tests/function_declaration.cc @@ -10,6 +10,7 @@ OUTPUT: "id": 0, "usr": 2747674671862363334, "detailed_name": "void foo(int a, int b)", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, diff --git a/index_tests/function_declaration_definition.cc b/index_tests/function_declaration_definition.cc index 7b1f4030..cee46790 100644 --- a/index_tests/function_declaration_definition.cc +++ b/index_tests/function_declaration_definition.cc @@ -12,6 +12,7 @@ OUTPUT: "id": 0, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, diff --git a/index_tests/function_definition.cc b/index_tests/function_definition.cc index f4ccb882..ea8f2680 100644 --- a/index_tests/function_definition.cc +++ b/index_tests/function_definition.cc @@ -10,6 +10,7 @@ OUTPUT: "id": 0, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, diff --git a/index_tests/inheritance/class_inherit.cc b/index_tests/inheritance/class_inherit.cc index f4e214c9..1833bb09 100644 --- a/index_tests/inheritance/class_inherit.cc +++ b/index_tests/inheritance/class_inherit.cc @@ -10,6 +10,7 @@ OUTPUT: "id": 0, "usr": 3866412049634585509, "detailed_name": "Parent", + "qual_name_offset": 0, "short_name": "Parent", "kind": 5, "declarations": ["2:24-2:30|-1|1|4"], @@ -26,6 +27,7 @@ OUTPUT: "id": 1, "usr": 10963370434658308541, "detailed_name": "Derived", + "qual_name_offset": 0, "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 bc12cca6..3056a4ff 100644 --- a/index_tests/inheritance/class_inherit_templated_parent.cc +++ b/index_tests/inheritance/class_inherit_templated_parent.cc @@ -21,6 +21,7 @@ OUTPUT: "id": 0, "usr": 11930058224338108382, "detailed_name": "Base1", + "qual_name_offset": 0, "short_name": "Base1", "kind": 5, "declarations": ["8:18-8:23|-1|1|4", "13:17-13:22|-1|1|4"], @@ -37,6 +38,7 @@ OUTPUT: "id": 1, "usr": 11118288764693061434, "detailed_name": "Base2", + "qual_name_offset": 0, "short_name": "Base2", "kind": 5, "declarations": ["11:18-11:23|-1|1|4", "13:27-13:32|-1|1|4"], @@ -53,6 +55,7 @@ OUTPUT: "id": 2, "usr": 5863733211528032190, "detailed_name": "Derived1", + "qual_name_offset": 0, "short_name": "Derived1", "kind": 5, "declarations": ["13:43-13:51|-1|1|4"], @@ -69,6 +72,7 @@ OUTPUT: "id": 3, "usr": 9, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -83,6 +87,7 @@ OUTPUT: "id": 4, "usr": 10651399730831737929, "detailed_name": "Derived2", + "qual_name_offset": 0, "short_name": "Derived2", "kind": 5, "declarations": ["13:56-13:64|-1|1|4"], @@ -99,6 +104,7 @@ OUTPUT: "id": 5, "usr": 7916588271848318236, "detailed_name": "T", + "qual_name_offset": 0, "short_name": "T", "kind": 26, "declarations": [], @@ -115,6 +121,7 @@ OUTPUT: "id": 6, "usr": 10963370434658308541, "detailed_name": "Derived", + "qual_name_offset": 0, "short_name": "Derived", "kind": 5, "declarations": ["13:33-13:40|-1|1|4", "13:65-13:72|-1|1|4"], @@ -133,6 +140,7 @@ OUTPUT: "id": 0, "usr": 12990052348105569112, "detailed_name": "unsigned int T", + "qual_name_offset": 13, "short_name": "T", "declarations": [], "spell": "7:23-7:24|-1|1|2", diff --git a/index_tests/inheritance/class_multiple_inherit.cc b/index_tests/inheritance/class_multiple_inherit.cc index 785a1bf9..01f3d8a7 100644 --- a/index_tests/inheritance/class_multiple_inherit.cc +++ b/index_tests/inheritance/class_multiple_inherit.cc @@ -12,6 +12,7 @@ OUTPUT: "id": 0, "usr": 3897841498936210886, "detailed_name": "Root", + "qual_name_offset": 0, "short_name": "Root", "kind": 5, "declarations": ["2:24-2:28|-1|1|4", "3:24-3:28|-1|1|4"], @@ -28,6 +29,7 @@ OUTPUT: "id": 1, "usr": 11863524815063131483, "detailed_name": "MiddleA", + "qual_name_offset": 0, "short_name": "MiddleA", "kind": 5, "declarations": ["4:24-4:31|-1|1|4"], @@ -44,6 +46,7 @@ OUTPUT: "id": 2, "usr": 14022569716337624303, "detailed_name": "MiddleB", + "qual_name_offset": 0, "short_name": "MiddleB", "kind": 5, "declarations": ["4:40-4:47|-1|1|4"], @@ -60,6 +63,7 @@ OUTPUT: "id": 3, "usr": 10963370434658308541, "detailed_name": "Derived", + "qual_name_offset": 0, "short_name": "Derived", "kind": 5, "declarations": [], diff --git a/index_tests/inheritance/function_override.cc b/index_tests/inheritance/function_override.cc index 36b5d32d..90cfca91 100644 --- a/index_tests/inheritance/function_override.cc +++ b/index_tests/inheritance/function_override.cc @@ -14,6 +14,7 @@ OUTPUT: "id": 0, "usr": 3897841498936210886, "detailed_name": "Root", + "qual_name_offset": 0, "short_name": "Root", "kind": 5, "declarations": ["4:24-4:28|-1|1|4"], @@ -30,6 +31,7 @@ OUTPUT: "id": 1, "usr": 10963370434658308541, "detailed_name": "Derived", + "qual_name_offset": 0, "short_name": "Derived", "kind": 5, "declarations": [], @@ -47,6 +49,7 @@ OUTPUT: "id": 0, "usr": 9948027785633571339, "detailed_name": "void Root::foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 6, "storage": 1, @@ -64,6 +67,7 @@ OUTPUT: "id": 1, "usr": 6666242542855173890, "detailed_name": "void Derived::foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 6, "storage": 1, diff --git a/index_tests/inheritance/interface_pure_virtual.cc b/index_tests/inheritance/interface_pure_virtual.cc index 69251384..d9f147c3 100644 --- a/index_tests/inheritance/interface_pure_virtual.cc +++ b/index_tests/inheritance/interface_pure_virtual.cc @@ -11,6 +11,7 @@ OUTPUT: "id": 0, "usr": 9949214233977131946, "detailed_name": "IFoo", + "qual_name_offset": 0, "short_name": "IFoo", "kind": 5, "declarations": [], @@ -28,6 +29,7 @@ OUTPUT: "id": 0, "usr": 3277829753446788562, "detailed_name": "void IFoo::foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 6, "storage": 1, diff --git a/index_tests/inheritance/multiple_base_functions.cc b/index_tests/inheritance/multiple_base_functions.cc index 6550bb37..254dfcf6 100644 --- a/index_tests/inheritance/multiple_base_functions.cc +++ b/index_tests/inheritance/multiple_base_functions.cc @@ -17,6 +17,7 @@ OUTPUT: "id": 0, "usr": 11628904180681204356, "detailed_name": "Base0", + "qual_name_offset": 0, "short_name": "Base0", "kind": 23, "declarations": ["2:12-2:17|-1|1|4", "7:18-7:23|-1|1|4"], @@ -33,6 +34,7 @@ OUTPUT: "id": 1, "usr": 15826803741381445676, "detailed_name": "Base1", + "qual_name_offset": 0, "short_name": "Base1", "kind": 23, "declarations": ["5:12-5:17|-1|1|4", "7:25-7:30|-1|1|4"], @@ -49,6 +51,7 @@ OUTPUT: "id": 2, "usr": 10963370434658308541, "detailed_name": "Derived", + "qual_name_offset": 0, "short_name": "Derived", "kind": 23, "declarations": ["8:4-8:11|-1|1|4"], @@ -66,6 +69,7 @@ OUTPUT: "id": 0, "usr": 16347272523198263017, "detailed_name": "void Base0::~Base0() noexcept", + "qual_name_offset": 5, "short_name": "~Base0", "kind": 6, "storage": 1, @@ -82,6 +86,7 @@ OUTPUT: "id": 1, "usr": 8401779086123965305, "detailed_name": "void Base1::~Base1() noexcept", + "qual_name_offset": 5, "short_name": "~Base1", "kind": 6, "storage": 1, @@ -98,6 +103,7 @@ OUTPUT: "id": 2, "usr": 13164726294460837993, "detailed_name": "void Derived::~Derived() noexcept", + "qual_name_offset": 5, "short_name": "~Derived", "kind": 6, "storage": 1, diff --git a/index_tests/lambdas/lambda.cc b/index_tests/lambdas/lambda.cc index e670cc62..5ed38fa3 100644 --- a/index_tests/lambdas/lambda.cc +++ b/index_tests/lambdas/lambda.cc @@ -20,6 +20,7 @@ OUTPUT: "id": 0, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -34,6 +35,7 @@ OUTPUT: "id": 1, "usr": 14635009347499519042, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -49,6 +51,7 @@ OUTPUT: "id": 0, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -64,6 +67,7 @@ OUTPUT: "id": 1, "usr": 17926497908620168464, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "storage": 0, @@ -78,6 +82,7 @@ OUTPUT: "id": 0, "usr": 12666114896600231317, "detailed_name": "int x", + "qual_name_offset": 4, "short_name": "x", "declarations": [], "spell": "2:7-2:8|0|3|2", @@ -90,6 +95,7 @@ OUTPUT: "id": 1, "usr": 2981279427664991319, "detailed_name": "lambda dosomething", + "qual_name_offset": 7, "short_name": "dosomething", "declarations": [], "spell": "4:8-4:19|0|3|2", @@ -102,6 +108,7 @@ OUTPUT: "id": 2, "usr": 12879188959314906706, "detailed_name": "int y", + "qual_name_offset": 4, "short_name": "y", "declarations": [], "spell": "4:31-4:32|0|3|2", diff --git a/index_tests/macros/complex.cc b/index_tests/macros/complex.cc index 827a67e1..ae3e23c2 100644 --- a/index_tests/macros/complex.cc +++ b/index_tests/macros/complex.cc @@ -20,6 +20,7 @@ OUTPUT: "id": 0, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -35,6 +36,7 @@ OUTPUT: "id": 0, "usr": 14400399977994209582, "detailed_name": "int make1()", + "qual_name_offset": 4, "short_name": "make1", "kind": 12, "storage": 1, @@ -50,6 +52,7 @@ OUTPUT: "id": 1, "usr": 9720930732776154610, "detailed_name": "int a()", + "qual_name_offset": 4, "short_name": "a", "kind": 12, "storage": 1, @@ -69,6 +72,7 @@ OUTPUT: "id": 0, "usr": 2878407290385495202, "detailed_name": "const int make2", + "qual_name_offset": 10, "short_name": "make2", "hover": "const int make2 = 5", "declarations": [], @@ -82,6 +86,7 @@ OUTPUT: "id": 1, "usr": 4261071340275951718, "detailed_name": "FOO", + "qual_name_offset": 0, "short_name": "FOO", "hover": "#define FOO(aaa, bbb)\n int a();\n int a() { return aaa + bbb; }", "declarations": [], diff --git a/index_tests/macros/foo.cc b/index_tests/macros/foo.cc index 88803443..f03b19de 100644 --- a/index_tests/macros/foo.cc +++ b/index_tests/macros/foo.cc @@ -16,6 +16,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": ["5:12-5:15|-1|1|4"], @@ -32,6 +33,7 @@ OUTPUT: "id": 1, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -47,6 +49,7 @@ OUTPUT: "id": 0, "usr": 13788753348312146871, "detailed_name": "void Foo::Foo(Foo &&)", + "qual_name_offset": 5, "short_name": "Foo", "kind": 9, "storage": 1, @@ -64,6 +67,7 @@ OUTPUT: "id": 0, "usr": 10677751717622394455, "detailed_name": "int x", + "qual_name_offset": 4, "short_name": "x", "hover": "int x = A", "declarations": [], @@ -77,6 +81,7 @@ OUTPUT: "id": 1, "usr": 7651988378939587454, "detailed_name": "A", + "qual_name_offset": 0, "short_name": "A", "hover": "#define A 5", "declarations": [], @@ -89,6 +94,7 @@ OUTPUT: "id": 2, "usr": 2056319845419860263, "detailed_name": "DISALLOW", + "qual_name_offset": 0, "short_name": "DISALLOW", "hover": "#define DISALLOW(type) type(type&&) = delete;", "declarations": [], diff --git a/index_tests/method_declaration.cc b/index_tests/method_declaration.cc index 1b2698dd..54f5cec8 100644 --- a/index_tests/method_declaration.cc +++ b/index_tests/method_declaration.cc @@ -15,6 +15,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -32,6 +33,7 @@ OUTPUT: "id": 0, "usr": 17922201480358737771, "detailed_name": "void Foo::foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 6, "storage": 1, diff --git a/index_tests/method_definition.cc b/index_tests/method_definition.cc index 8da4a2af..5ee733c2 100644 --- a/index_tests/method_definition.cc +++ b/index_tests/method_definition.cc @@ -13,6 +13,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -30,6 +31,7 @@ OUTPUT: "id": 0, "usr": 6446764306530590711, "detailed_name": "void Foo::foo() const", + "qual_name_offset": 5, "short_name": "foo", "kind": 6, "storage": 1, diff --git a/index_tests/method_inline_declaration.cc b/index_tests/method_inline_declaration.cc index 85cfb39c..8dcd5448 100644 --- a/index_tests/method_inline_declaration.cc +++ b/index_tests/method_inline_declaration.cc @@ -11,6 +11,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -28,6 +29,7 @@ OUTPUT: "id": 0, "usr": 17922201480358737771, "detailed_name": "void Foo::foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 6, "storage": 1, diff --git a/index_tests/multi_file/funky_enum.cc b/index_tests/multi_file/funky_enum.cc index d445744f..44a27cfd 100644 --- a/index_tests/multi_file/funky_enum.cc +++ b/index_tests/multi_file/funky_enum.cc @@ -14,6 +14,7 @@ OUTPUT: funky_enum.h "id": 0, "usr": 16985894625255407295, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 0, "declarations": [], @@ -30,6 +31,7 @@ OUTPUT: funky_enum.h "id": 0, "usr": 439339022761937396, "detailed_name": "Foo::A", + "qual_name_offset": 0, "short_name": "A", "hover": "Foo::A = 0", "declarations": [], @@ -43,6 +45,7 @@ OUTPUT: funky_enum.h "id": 1, "usr": 15962370213938840720, "detailed_name": "Foo::B", + "qual_name_offset": 0, "short_name": "B", "hover": "Foo::B = 1", "declarations": [], @@ -56,6 +59,7 @@ OUTPUT: funky_enum.h "id": 2, "usr": 8524995777615948802, "detailed_name": "Foo::C", + "qual_name_offset": 0, "short_name": "C", "hover": "Foo::C = 2", "declarations": [], @@ -78,6 +82,7 @@ OUTPUT: funky_enum.cc "id": 0, "usr": 16985894625255407295, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 10, "declarations": [], diff --git a/index_tests/multi_file/impl.cc b/index_tests/multi_file/impl.cc index 1e3fb85c..d35cd449 100644 --- a/index_tests/multi_file/impl.cc +++ b/index_tests/multi_file/impl.cc @@ -13,6 +13,7 @@ OUTPUT: header.h "id": 0, "usr": 8420119006782424779, "detailed_name": "Base", + "qual_name_offset": 0, "short_name": "Base", "kind": 23, "declarations": ["5:26-5:30|-1|1|4"], @@ -29,6 +30,7 @@ OUTPUT: header.h "id": 1, "usr": 16750616846959666305, "detailed_name": "SameFileDerived", + "qual_name_offset": 0, "short_name": "SameFileDerived", "kind": 23, "declarations": [], @@ -45,6 +47,7 @@ OUTPUT: header.h "id": 2, "usr": 619345544228965342, "detailed_name": "Foo0", + "qual_name_offset": 0, "short_name": "Foo0", "kind": 252, "hover": "using Foo0 = SameFileDerived", @@ -63,6 +66,7 @@ OUTPUT: header.h "id": 3, "usr": 529393482671181129, "detailed_name": "Foo2", + "qual_name_offset": 0, "short_name": "Foo2", "kind": 5, "declarations": [], @@ -79,6 +83,7 @@ OUTPUT: header.h "id": 4, "usr": 4481210672785600703, "detailed_name": "Foo3", + "qual_name_offset": 0, "short_name": "Foo3", "kind": 10, "declarations": [], @@ -95,6 +100,7 @@ OUTPUT: header.h "id": 5, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -110,6 +116,7 @@ OUTPUT: header.h "id": 0, "usr": 11650481237659640387, "detailed_name": "void Foo1()", + "qual_name_offset": 5, "short_name": "Foo1", "kind": 12, "storage": 1, @@ -126,6 +133,7 @@ OUTPUT: header.h "id": 0, "usr": 6141718166919284735, "detailed_name": "Foo3::A", + "qual_name_offset": 0, "short_name": "A", "hover": "Foo3::A = 0", "declarations": [], @@ -139,6 +147,7 @@ OUTPUT: header.h "id": 1, "usr": 17716334512218775320, "detailed_name": "Foo3::B", + "qual_name_offset": 0, "short_name": "B", "hover": "Foo3::B = 1", "declarations": [], @@ -152,6 +161,7 @@ OUTPUT: header.h "id": 2, "usr": 7285646116511901840, "detailed_name": "Foo3::C", + "qual_name_offset": 0, "short_name": "C", "hover": "Foo3::C = 2", "declarations": [], @@ -165,6 +175,7 @@ OUTPUT: header.h "id": 3, "usr": 2638219001294786365, "detailed_name": "int Foo4", + "qual_name_offset": 4, "short_name": "Foo4", "declarations": [], "spell": "17:5-17:9|-1|1|2", @@ -177,6 +188,7 @@ OUTPUT: header.h "id": 4, "usr": 8395885290297540138, "detailed_name": "int Foo5", + "qual_name_offset": 4, "short_name": "Foo5", "declarations": [], "spell": "18:12-18:16|-1|1|2", @@ -199,6 +211,7 @@ OUTPUT: impl.cc "id": 0, "usr": 5817708529036841195, "detailed_name": "void Impl()", + "qual_name_offset": 5, "short_name": "Impl", "kind": 12, "storage": 1, @@ -214,6 +227,7 @@ OUTPUT: impl.cc "id": 1, "usr": 11650481237659640387, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "storage": 0, diff --git a/index_tests/multi_file/simple_impl.cc b/index_tests/multi_file/simple_impl.cc index d322603a..1c67f941 100644 --- a/index_tests/multi_file/simple_impl.cc +++ b/index_tests/multi_file/simple_impl.cc @@ -14,6 +14,7 @@ OUTPUT: simple_header.h "id": 0, "usr": 16236105532929924676, "detailed_name": "void header()", + "qual_name_offset": 5, "short_name": "header", "kind": 12, "storage": 1, @@ -41,6 +42,7 @@ OUTPUT: simple_impl.cc "id": 0, "usr": 3373269392705484958, "detailed_name": "void impl()", + "qual_name_offset": 5, "short_name": "impl", "kind": 12, "storage": 1, @@ -56,6 +58,7 @@ OUTPUT: simple_impl.cc "id": 1, "usr": 16236105532929924676, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "storage": 0, diff --git a/index_tests/multi_file/static.cc b/index_tests/multi_file/static.cc index 8ad0f72d..c5cfebcc 100644 --- a/index_tests/multi_file/static.cc +++ b/index_tests/multi_file/static.cc @@ -11,6 +11,7 @@ OUTPUT: static.h "id": 0, "usr": 9411323049603567600, "detailed_name": "Buffer", + "qual_name_offset": 0, "short_name": "Buffer", "kind": 23, "declarations": [], @@ -28,6 +29,7 @@ OUTPUT: static.h "id": 0, "usr": 14576076421851654759, "detailed_name": "void Buffer::CreateSharedBuffer()", + "qual_name_offset": 5, "short_name": "CreateSharedBuffer", "kind": 254, "storage": 3, @@ -55,6 +57,7 @@ OUTPUT: static.cc "id": 0, "usr": 9411323049603567600, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -70,6 +73,7 @@ OUTPUT: static.cc "id": 0, "usr": 14576076421851654759, "detailed_name": "void Buffer::CreateSharedBuffer()", + "qual_name_offset": 5, "short_name": "CreateSharedBuffer", "kind": 254, "storage": 1, diff --git a/index_tests/namespaces/anonymous_function.cc b/index_tests/namespaces/anonymous_function.cc index 17905fe2..701ab855 100644 --- a/index_tests/namespaces/anonymous_function.cc +++ b/index_tests/namespaces/anonymous_function.cc @@ -11,6 +11,7 @@ OUTPUT: "id": 0, "usr": 7144845543074395457, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -26,6 +27,7 @@ OUTPUT: "id": 0, "usr": 5010253035933134245, "detailed_name": "void (anon)::foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, diff --git a/index_tests/namespaces/function_declaration.cc b/index_tests/namespaces/function_declaration.cc index 7c6ba361..18f81f7c 100644 --- a/index_tests/namespaces/function_declaration.cc +++ b/index_tests/namespaces/function_declaration.cc @@ -11,6 +11,7 @@ OUTPUT: "id": 0, "usr": 2029211996748007610, "detailed_name": "hello", + "qual_name_offset": 0, "short_name": "hello", "kind": 3, "declarations": [], @@ -27,6 +28,7 @@ OUTPUT: "id": 1, "usr": 13838176792705659279, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -42,6 +44,7 @@ OUTPUT: "id": 0, "usr": 18343102288837190527, "detailed_name": "void hello::foo(int a, int b)", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, diff --git a/index_tests/namespaces/function_definition.cc b/index_tests/namespaces/function_definition.cc index 5ccd8254..1ae23ab3 100644 --- a/index_tests/namespaces/function_definition.cc +++ b/index_tests/namespaces/function_definition.cc @@ -11,6 +11,7 @@ OUTPUT: "id": 0, "usr": 2029211996748007610, "detailed_name": "hello", + "qual_name_offset": 0, "short_name": "hello", "kind": 3, "declarations": [], @@ -27,6 +28,7 @@ OUTPUT: "id": 1, "usr": 13838176792705659279, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -42,6 +44,7 @@ OUTPUT: "id": 0, "usr": 243328841292951622, "detailed_name": "void hello::foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, diff --git a/index_tests/namespaces/method_declaration.cc b/index_tests/namespaces/method_declaration.cc index 37687fd3..d66e1ab3 100644 --- a/index_tests/namespaces/method_declaration.cc +++ b/index_tests/namespaces/method_declaration.cc @@ -13,6 +13,7 @@ OUTPUT: "id": 0, "usr": 2029211996748007610, "detailed_name": "hello", + "qual_name_offset": 0, "short_name": "hello", "kind": 3, "declarations": [], @@ -29,6 +30,7 @@ OUTPUT: "id": 1, "usr": 13838176792705659279, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -43,6 +45,7 @@ OUTPUT: "id": 2, "usr": 4508214972876735896, "detailed_name": "hello::Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -60,6 +63,7 @@ OUTPUT: "id": 0, "usr": 10487325150128053272, "detailed_name": "void hello::Foo::foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 6, "storage": 1, diff --git a/index_tests/namespaces/method_definition.cc b/index_tests/namespaces/method_definition.cc index 4df6edf1..2149a037 100644 --- a/index_tests/namespaces/method_definition.cc +++ b/index_tests/namespaces/method_definition.cc @@ -15,6 +15,7 @@ OUTPUT: "id": 0, "usr": 2029211996748007610, "detailed_name": "hello", + "qual_name_offset": 0, "short_name": "hello", "kind": 3, "declarations": [], @@ -31,6 +32,7 @@ OUTPUT: "id": 1, "usr": 13838176792705659279, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -45,6 +47,7 @@ OUTPUT: "id": 2, "usr": 4508214972876735896, "detailed_name": "hello::Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -62,6 +65,7 @@ OUTPUT: "id": 0, "usr": 10487325150128053272, "detailed_name": "void hello::Foo::foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 6, "storage": 1, diff --git a/index_tests/namespaces/method_inline_declaration.cc b/index_tests/namespaces/method_inline_declaration.cc index 9d0b940f..d38f8f8c 100644 --- a/index_tests/namespaces/method_inline_declaration.cc +++ b/index_tests/namespaces/method_inline_declaration.cc @@ -13,6 +13,7 @@ OUTPUT: "id": 0, "usr": 2029211996748007610, "detailed_name": "hello", + "qual_name_offset": 0, "short_name": "hello", "kind": 3, "declarations": [], @@ -29,6 +30,7 @@ OUTPUT: "id": 1, "usr": 13838176792705659279, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -43,6 +45,7 @@ OUTPUT: "id": 2, "usr": 4508214972876735896, "detailed_name": "hello::Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -60,6 +63,7 @@ OUTPUT: "id": 0, "usr": 10487325150128053272, "detailed_name": "void hello::Foo::foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 6, "storage": 1, diff --git a/index_tests/namespaces/namespace_alias.cc b/index_tests/namespaces/namespace_alias.cc index 8fa50438..2c8280f5 100644 --- a/index_tests/namespaces/namespace_alias.cc +++ b/index_tests/namespaces/namespace_alias.cc @@ -22,6 +22,7 @@ OUTPUT: "id": 0, "usr": 926793467007732869, "detailed_name": "foo", + "qual_name_offset": 0, "short_name": "foo", "kind": 3, "declarations": [], @@ -38,6 +39,7 @@ OUTPUT: "id": 1, "usr": 13838176792705659279, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -52,6 +54,7 @@ OUTPUT: "id": 2, "usr": 17805385787823406700, "detailed_name": "foo::bar", + "qual_name_offset": 0, "short_name": "bar", "kind": 3, "declarations": [], @@ -68,6 +71,7 @@ OUTPUT: "id": 3, "usr": 14450849931009540802, "detailed_name": "foo::bar::baz", + "qual_name_offset": 0, "short_name": "baz", "kind": 3, "declarations": [], @@ -84,6 +88,7 @@ OUTPUT: "id": 4, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -98,6 +103,7 @@ OUTPUT: "id": 5, "usr": 11879713791858506216, "detailed_name": "fbz", + "qual_name_offset": 0, "short_name": "fbz", "kind": 0, "declarations": [], @@ -115,6 +121,7 @@ OUTPUT: "id": 0, "usr": 10818727483146447186, "detailed_name": "void func()", + "qual_name_offset": 5, "short_name": "func", "kind": 12, "storage": 1, @@ -131,6 +138,7 @@ OUTPUT: "id": 0, "usr": 15042442838933090518, "detailed_name": "int foo::bar::baz::qux", + "qual_name_offset": 4, "short_name": "qux", "hover": "int foo::bar::baz::qux = 42", "declarations": [], @@ -144,6 +152,7 @@ OUTPUT: "id": 1, "usr": 6030927277961448585, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "hover": "int a = foo::bar::baz::qux", "declarations": [], @@ -157,6 +166,7 @@ OUTPUT: "id": 2, "usr": 7657277353101371136, "detailed_name": "int b", + "qual_name_offset": 4, "short_name": "b", "hover": "int b = fbz::qux", "declarations": [], diff --git a/index_tests/namespaces/namespace_reference.cc b/index_tests/namespaces/namespace_reference.cc index a8383d89..cf559e1c 100644 --- a/index_tests/namespaces/namespace_reference.cc +++ b/index_tests/namespaces/namespace_reference.cc @@ -18,6 +18,7 @@ OUTPUT: "id": 0, "usr": 11072669167287398027, "detailed_name": "ns", + "qual_name_offset": 0, "short_name": "ns", "kind": 3, "declarations": [], @@ -34,6 +35,7 @@ OUTPUT: "id": 1, "usr": 13838176792705659279, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -48,6 +50,7 @@ OUTPUT: "id": 2, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -63,6 +66,7 @@ OUTPUT: "id": 0, "usr": 17328473273923617489, "detailed_name": "void ns::Accept(int a)", + "qual_name_offset": 5, "short_name": "Accept", "kind": 12, "storage": 1, @@ -79,6 +83,7 @@ OUTPUT: "id": 1, "usr": 631910859630953711, "detailed_name": "void Runner()", + "qual_name_offset": 5, "short_name": "Runner", "kind": 12, "storage": 1, @@ -95,6 +100,7 @@ OUTPUT: "id": 0, "usr": 12898699035586282159, "detailed_name": "int ns::Foo", + "qual_name_offset": 4, "short_name": "Foo", "declarations": [], "spell": "2:7-2:10|0|2|2", @@ -107,6 +113,7 @@ OUTPUT: "id": 1, "usr": 3649375698083002347, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "declarations": [], "spell": "3:19-3:20|0|3|2", diff --git a/index_tests/operators/operator.cc b/index_tests/operators/operator.cc index dc8151b0..0624270b 100644 --- a/index_tests/operators/operator.cc +++ b/index_tests/operators/operator.cc @@ -15,6 +15,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -32,6 +33,7 @@ OUTPUT: "id": 0, "usr": 7874436189163837815, "detailed_name": "void Foo::operator()(int)", + "qual_name_offset": 5, "short_name": "operator()", "kind": 6, "storage": 1, @@ -48,6 +50,7 @@ OUTPUT: "id": 1, "usr": 3545323327609582678, "detailed_name": "void Foo::operator()(bool)", + "qual_name_offset": 5, "short_name": "operator()", "kind": 6, "storage": 1, @@ -65,6 +68,7 @@ OUTPUT: "id": 2, "usr": 3986818119971932909, "detailed_name": "int Foo::operator()(int a, int b)", + "qual_name_offset": 4, "short_name": "operator()", "kind": 6, "storage": 1, @@ -82,6 +86,7 @@ OUTPUT: "id": 3, "usr": 8288368475529136092, "detailed_name": "Foo &operator+=(const Foo &, const int &)", + "qual_name_offset": 5, "short_name": "operator+=", "kind": 12, "storage": 1, diff --git a/index_tests/outline/static_function_in_type.cc b/index_tests/outline/static_function_in_type.cc index 682ca165..9d05094f 100644 --- a/index_tests/outline/static_function_in_type.cc +++ b/index_tests/outline/static_function_in_type.cc @@ -15,6 +15,7 @@ OUTPUT: static_function_in_type.h "id": 0, "usr": 11072669167287398027, "detailed_name": "ns", + "qual_name_offset": 0, "short_name": "ns", "kind": 3, "declarations": [], @@ -31,6 +32,7 @@ OUTPUT: static_function_in_type.h "id": 1, "usr": 13838176792705659279, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -45,6 +47,7 @@ OUTPUT: static_function_in_type.h "id": 2, "usr": 1972401196751872203, "detailed_name": "ns::Manager", + "qual_name_offset": 0, "short_name": "Manager", "kind": 5, "declarations": ["3:7-3:14|0|2|1"], @@ -59,6 +62,7 @@ OUTPUT: static_function_in_type.h "id": 3, "usr": 17262466801709381811, "detailed_name": "ns::Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": [], @@ -76,6 +80,7 @@ OUTPUT: static_function_in_type.h "id": 0, "usr": 17019747379608639279, "detailed_name": "void ns::Foo::Register(ns::Manager *)", + "qual_name_offset": 5, "short_name": "Register", "kind": 254, "storage": 3, @@ -103,6 +108,7 @@ OUTPUT: static_function_in_type.cc "id": 0, "usr": 11072669167287398027, "detailed_name": "ns", + "qual_name_offset": 0, "short_name": "ns", "kind": 3, "declarations": [], @@ -119,6 +125,7 @@ OUTPUT: static_function_in_type.cc "id": 1, "usr": 13838176792705659279, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -133,6 +140,7 @@ OUTPUT: static_function_in_type.cc "id": 2, "usr": 17262466801709381811, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -147,6 +155,7 @@ OUTPUT: static_function_in_type.cc "id": 3, "usr": 1972401196751872203, "detailed_name": "ns::Manager", + "qual_name_offset": 0, "short_name": "Manager", "kind": 0, "declarations": [], @@ -162,6 +171,7 @@ OUTPUT: static_function_in_type.cc "id": 0, "usr": 17019747379608639279, "detailed_name": "void ns::Foo::Register(ns::Manager *m)", + "qual_name_offset": 5, "short_name": "Register", "kind": 254, "storage": 1, @@ -179,6 +189,7 @@ OUTPUT: static_function_in_type.cc "id": 0, "usr": 13569879755236306838, "detailed_name": "ns::Manager *m", + "qual_name_offset": 13, "short_name": "m", "declarations": [], "spell": "5:29-5:30|0|3|2", diff --git a/index_tests/preprocessor/include_guard.cc b/index_tests/preprocessor/include_guard.cc index 764e434c..592fab71 100644 --- a/index_tests/preprocessor/include_guard.cc +++ b/index_tests/preprocessor/include_guard.cc @@ -14,6 +14,7 @@ OUTPUT: "id": 0, "usr": 11674328179498211370, "detailed_name": "FOO", + "qual_name_offset": 0, "short_name": "FOO", "hover": "#define FOO", "declarations": [], diff --git a/index_tests/templates/func_specialized_template_param.cc b/index_tests/templates/func_specialized_template_param.cc index cdcb516c..d1da2699 100644 --- a/index_tests/templates/func_specialized_template_param.cc +++ b/index_tests/templates/func_specialized_template_param.cc @@ -16,6 +16,7 @@ OUTPUT: "id": 0, "usr": 17107291254533526269, "detailed_name": "Template", + "qual_name_offset": 0, "short_name": "Template", "kind": 5, "declarations": [], @@ -32,6 +33,7 @@ OUTPUT: "id": 1, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": [], @@ -49,6 +51,7 @@ OUTPUT: "id": 0, "usr": 8412238651648388423, "detailed_name": "void Foo::Bar(Template &)", + "qual_name_offset": 5, "short_name": "Bar", "kind": 6, "storage": 1, diff --git a/index_tests/templates/implicit_variable_instantiation.cc b/index_tests/templates/implicit_variable_instantiation.cc index b4ef6130..42a89405 100644 --- a/index_tests/templates/implicit_variable_instantiation.cc +++ b/index_tests/templates/implicit_variable_instantiation.cc @@ -23,6 +23,7 @@ OUTPUT: "id": 0, "usr": 11072669167287398027, "detailed_name": "ns", + "qual_name_offset": 0, "short_name": "ns", "kind": 3, "declarations": [], @@ -39,6 +40,7 @@ OUTPUT: "id": 1, "usr": 13838176792705659279, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -53,6 +55,7 @@ OUTPUT: "id": 2, "usr": 1532099849728741556, "detailed_name": "ns::VarType", + "qual_name_offset": 0, "short_name": "VarType", "kind": 10, "declarations": [], @@ -69,6 +72,7 @@ OUTPUT: "id": 3, "usr": 12688716854043726585, "detailed_name": "ns::Holder", + "qual_name_offset": 0, "short_name": "Holder", "kind": 5, "declarations": [], @@ -85,6 +89,7 @@ OUTPUT: "id": 4, "usr": 2205716167465743256, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -99,6 +104,7 @@ OUTPUT: "id": 5, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -115,6 +121,7 @@ OUTPUT: "id": 0, "usr": 4731849186641714451, "detailed_name": "const ns::VarType ns::Holder::static_var", + "qual_name_offset": 18, "short_name": "static_var", "hover": "const ns::VarType ns::Holder::static_var = (VarType)0x0", "declarations": ["6:30-6:40|3|2|1"], @@ -128,6 +135,7 @@ OUTPUT: "id": 1, "usr": 12898699035586282159, "detailed_name": "int ns::Foo", + "qual_name_offset": 4, "short_name": "Foo", "hover": "int ns::Foo = Holder::static_var", "declarations": [], @@ -141,6 +149,7 @@ OUTPUT: "id": 2, "usr": 9008550860229740818, "detailed_name": "int ns::Foo2", + "qual_name_offset": 4, "short_name": "Foo2", "hover": "int ns::Foo2 = Holder::static_var", "declarations": [], diff --git a/index_tests/templates/member_ref_in_template.cc b/index_tests/templates/member_ref_in_template.cc index 7044a041..f3bed2b2 100644 --- a/index_tests/templates/member_ref_in_template.cc +++ b/index_tests/templates/member_ref_in_template.cc @@ -29,6 +29,7 @@ OUTPUT: "id": 0, "usr": 8402783583255987702, "detailed_name": "C", + "qual_name_offset": 0, "short_name": "C", "kind": 5, "declarations": [], @@ -45,6 +46,7 @@ OUTPUT: "id": 1, "usr": 14750650276757822712, "detailed_name": "T", + "qual_name_offset": 0, "short_name": "T", "kind": 26, "declarations": [], @@ -62,6 +64,7 @@ OUTPUT: "id": 0, "usr": 8905286151237717330, "detailed_name": "void C::bar()", + "qual_name_offset": 5, "short_name": "bar", "kind": 6, "storage": 1, @@ -79,6 +82,7 @@ OUTPUT: "id": 1, "usr": 6875364467121018690, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -95,6 +99,7 @@ OUTPUT: "id": 0, "usr": 5866801090710377175, "detailed_name": "T C::x", + "qual_name_offset": 2, "short_name": "x", "declarations": [], "spell": "3:5-3:6|0|2|2", 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 c7e77d6e..da7af9dd 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 @@ -20,6 +20,7 @@ OUTPUT: "id": 0, "usr": 11072669167287398027, "detailed_name": "ns", + "qual_name_offset": 0, "short_name": "ns", "kind": 3, "declarations": [], @@ -36,6 +37,7 @@ OUTPUT: "id": 1, "usr": 13838176792705659279, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -50,6 +52,7 @@ OUTPUT: "id": 2, "usr": 14042997404480181958, "detailed_name": "ns::Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -66,6 +69,7 @@ OUTPUT: "id": 3, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -81,6 +85,7 @@ OUTPUT: "id": 0, "usr": 8221803074608342407, "detailed_name": "int ns::Foo::foo()", + "qual_name_offset": 4, "short_name": "foo", "kind": 254, "storage": 3, @@ -98,6 +103,7 @@ OUTPUT: "id": 0, "usr": 15768138241775955040, "detailed_name": "int ns::a", + "qual_name_offset": 4, "short_name": "a", "hover": "int ns::a = Foo::foo()", "declarations": [], @@ -111,6 +117,7 @@ OUTPUT: "id": 1, "usr": 3182917058194750998, "detailed_name": "int ns::b", + "qual_name_offset": 4, "short_name": "b", "hover": "int ns::b = Foo::foo()", "declarations": [], 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 61a53f89..c1a8ae9d 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 @@ -15,6 +15,7 @@ OUTPUT: "id": 0, "usr": 11072669167287398027, "detailed_name": "ns", + "qual_name_offset": 0, "short_name": "ns", "kind": 3, "declarations": [], @@ -31,6 +32,7 @@ OUTPUT: "id": 1, "usr": 13838176792705659279, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -45,6 +47,7 @@ OUTPUT: "id": 2, "usr": 14042997404480181958, "detailed_name": "ns::Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -63,6 +66,7 @@ OUTPUT: "id": 0, "usr": 15768138241775955040, "detailed_name": "Foo ns::a", + "qual_name_offset": 9, "short_name": "a", "declarations": [], "spell": "5:12-5:13|0|2|2", @@ -75,6 +79,7 @@ OUTPUT: "id": 1, "usr": 3182917058194750998, "detailed_name": "Foo ns::b", + "qual_name_offset": 10, "short_name": "b", "declarations": [], "spell": "6:13-6:14|0|2|2", diff --git a/index_tests/templates/specialization.cc b/index_tests/templates/specialization.cc index 2b75f557..840493fa 100644 --- a/index_tests/templates/specialization.cc +++ b/index_tests/templates/specialization.cc @@ -51,6 +51,7 @@ OUTPUT: "id": 0, "usr": 15019211479263750068, "detailed_name": "function", + "qual_name_offset": 0, "short_name": "function", "kind": 5, "declarations": ["2:7-2:15|-1|1|1", "5:7-5:15|-1|1|4"], @@ -67,6 +68,7 @@ OUTPUT: "id": 1, "usr": 218068462278884837, "detailed_name": "function", + "qual_name_offset": 0, "short_name": "function", "kind": 5, "declarations": [], @@ -83,6 +85,7 @@ OUTPUT: "id": 2, "usr": 9673599782548740467, "detailed_name": "T", + "qual_name_offset": 0, "short_name": "T", "kind": 26, "declarations": [], @@ -99,6 +102,7 @@ OUTPUT: "id": 3, "usr": 7143192229126273961, "detailed_name": "Args", + "qual_name_offset": 0, "short_name": "Args", "kind": 26, "declarations": [], @@ -115,6 +119,7 @@ OUTPUT: "id": 4, "usr": 15695704394170757108, "detailed_name": "allocator", + "qual_name_offset": 0, "short_name": "allocator", "kind": 5, "declarations": ["9:28-9:37|-1|1|1", "11:39-11:48|-1|1|4"], @@ -129,6 +134,7 @@ OUTPUT: "id": 5, "usr": 7440942986741176606, "detailed_name": "vector", + "qual_name_offset": 0, "short_name": "vector", "kind": 5, "declarations": ["17:7-17:13|-1|1|4", "26:7-26:13|-1|1|4"], @@ -145,6 +151,7 @@ OUTPUT: "id": 6, "usr": 16155717907537731864, "detailed_name": "vector", + "qual_name_offset": 0, "short_name": "vector", "kind": 5, "declarations": [], @@ -161,6 +168,7 @@ OUTPUT: "id": 7, "usr": 8880262253425334092, "detailed_name": "T", + "qual_name_offset": 0, "short_name": "T", "kind": 26, "declarations": [], @@ -177,6 +185,7 @@ OUTPUT: "id": 8, "usr": 5760043510674081814, "detailed_name": "Z1", + "qual_name_offset": 0, "short_name": "Z1", "kind": 23, "declarations": [], @@ -193,6 +202,7 @@ OUTPUT: "id": 9, "usr": 10124869160135436852, "detailed_name": "Z2", + "qual_name_offset": 0, "short_name": "Z2", "kind": 23, "declarations": ["26:14-26:16|-1|1|4"], @@ -209,6 +219,7 @@ OUTPUT: "id": 10, "usr": 1663022413889915338, "detailed_name": "vector", + "qual_name_offset": 0, "short_name": "vector", "kind": 5, "declarations": [], @@ -225,6 +236,7 @@ OUTPUT: "id": 11, "usr": 9201299975592934124, "detailed_name": "Enum", + "qual_name_offset": 0, "short_name": "Enum", "kind": 10, "declarations": [], @@ -241,6 +253,7 @@ OUTPUT: "id": 12, "usr": 14111105212951082474, "detailed_name": "T", + "qual_name_offset": 0, "short_name": "T", "kind": 26, "declarations": [], @@ -257,6 +270,7 @@ OUTPUT: "id": 13, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -272,6 +286,7 @@ OUTPUT: "id": 0, "usr": 18107614608385228556, "detailed_name": "void vector::clear()", + "qual_name_offset": 5, "short_name": "clear", "kind": 6, "storage": 1, @@ -289,6 +304,7 @@ OUTPUT: "id": 1, "usr": 6113470698424012876, "detailed_name": "void vector::clear()", + "qual_name_offset": 5, "short_name": "clear", "kind": 6, "storage": 1, @@ -306,6 +322,7 @@ OUTPUT: "id": 2, "usr": 17498190318698490707, "detailed_name": "void foo(T Value)", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -325,6 +342,7 @@ OUTPUT: "id": 0, "usr": 2933643612409209903, "detailed_name": "function f", + "qual_name_offset": 21, "short_name": "f", "declarations": [], "spell": "7:21-7:22|-1|1|2", @@ -337,6 +355,7 @@ OUTPUT: "id": 1, "usr": 5792869548777559988, "detailed_name": "vector vc", + "qual_name_offset": 13, "short_name": "vc", "declarations": [], "spell": "30:14-30:16|-1|1|2", @@ -349,6 +368,7 @@ OUTPUT: "id": 2, "usr": 86949563628772958, "detailed_name": "vector vip", + "qual_name_offset": 14, "short_name": "vip", "declarations": [], "spell": "31:14-31:17|-1|1|2", @@ -361,6 +381,7 @@ OUTPUT: "id": 3, "usr": 3566687051827176322, "detailed_name": "vector vz1", + "qual_name_offset": 11, "short_name": "vz1", "declarations": [], "spell": "32:12-32:15|-1|1|2", @@ -373,6 +394,7 @@ OUTPUT: "id": 4, "usr": 15931696253641284761, "detailed_name": "vector vz2", + "qual_name_offset": 11, "short_name": "vz2", "declarations": [], "spell": "33:12-33:15|-1|1|2", @@ -385,6 +407,7 @@ OUTPUT: "id": 5, "usr": 15477793821005285152, "detailed_name": "Enum::Enum0", + "qual_name_offset": 0, "short_name": "Enum0", "hover": "Enum::Enum0 = 0", "declarations": [], @@ -398,6 +421,7 @@ OUTPUT: "id": 6, "usr": 4917621020431490070, "detailed_name": "Enum::Enum1", + "qual_name_offset": 0, "short_name": "Enum1", "hover": "Enum::Enum1 = 1", "declarations": [], @@ -411,6 +435,7 @@ OUTPUT: "id": 7, "usr": 17826688417349629938, "detailed_name": "T Value", + "qual_name_offset": 2, "short_name": "Value", "declarations": [], "spell": "39:12-39:17|2|3|2", @@ -422,6 +447,7 @@ OUTPUT: "id": 8, "usr": 13914496963221806870, "detailed_name": "const int kOnst", + "qual_name_offset": 10, "short_name": "kOnst", "hover": "const int kOnst = 7", "declarations": [], diff --git a/index_tests/templates/specialized_func_definition.cc b/index_tests/templates/specialized_func_definition.cc index e39308f9..9f00bd05 100644 --- a/index_tests/templates/specialized_func_definition.cc +++ b/index_tests/templates/specialized_func_definition.cc @@ -26,6 +26,7 @@ OUTPUT: "id": 0, "usr": 17107291254533526269, "detailed_name": "Template", + "qual_name_offset": 0, "short_name": "Template", "kind": 5, "declarations": [], @@ -42,6 +43,7 @@ OUTPUT: "id": 1, "usr": 17649312483543982122, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -57,6 +59,7 @@ OUTPUT: "id": 0, "usr": 11994188353303124840, "detailed_name": "void Template::Foo()", + "qual_name_offset": 5, "short_name": "Foo", "kind": 6, "storage": 1, 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 733db96f..e4b9bdf5 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 @@ -17,6 +17,7 @@ OUTPUT: "id": 0, "usr": 10528472276654770367, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -33,6 +34,7 @@ OUTPUT: "id": 1, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -48,6 +50,7 @@ OUTPUT: "id": 0, "usr": 8340731781048851399, "detailed_name": "int Foo::foo()", + "qual_name_offset": 4, "short_name": "foo", "kind": 254, "storage": 3, @@ -65,6 +68,7 @@ OUTPUT: "id": 0, "usr": 16721564935990383768, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "hover": "int a = Foo::foo()", "declarations": [], @@ -78,6 +82,7 @@ OUTPUT: "id": 1, "usr": 12028309045033782423, "detailed_name": "int b", + "qual_name_offset": 4, "short_name": "b", "hover": "int b = Foo::foo()", "declarations": [], 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 7ee252b4..04c36e50 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 @@ -18,6 +18,7 @@ OUTPUT: "id": 0, "usr": 10528472276654770367, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -34,6 +35,7 @@ OUTPUT: "id": 1, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -49,6 +51,7 @@ OUTPUT: "id": 0, "usr": 9034026360701857235, "detailed_name": "int Foo::foo()", + "qual_name_offset": 4, "short_name": "foo", "kind": 254, "storage": 3, @@ -66,6 +69,7 @@ OUTPUT: "id": 0, "usr": 16721564935990383768, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "hover": "int a = Foo::foo()", "declarations": [], @@ -79,6 +83,7 @@ OUTPUT: "id": 1, "usr": 12028309045033782423, "detailed_name": "int b", + "qual_name_offset": 4, "short_name": "b", "hover": "int b = Foo::foo()", "declarations": [], 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 c0b611ce..063f755b 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 @@ -36,6 +36,7 @@ OUTPUT: "id": 0, "usr": 6697181287623958829, "detailed_name": "A", + "qual_name_offset": 0, "short_name": "A", "kind": 10, "declarations": [], @@ -52,6 +53,7 @@ OUTPUT: "id": 1, "usr": 13892793056005362145, "detailed_name": "B", + "qual_name_offset": 0, "short_name": "B", "kind": 10, "declarations": [], @@ -68,6 +70,7 @@ OUTPUT: "id": 2, "usr": 10528472276654770367, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -84,6 +87,7 @@ OUTPUT: "id": 3, "usr": 13938528237873543349, "detailed_name": "Foo::Inner", + "qual_name_offset": 0, "short_name": "Inner", "kind": 23, "declarations": [], @@ -102,6 +106,7 @@ OUTPUT: "id": 0, "usr": 16721564935990383768, "detailed_name": "Foo::Inner a", + "qual_name_offset": 14, "short_name": "a", "declarations": [], "spell": "9:15-9:16|-1|1|2", @@ -114,6 +119,7 @@ OUTPUT: "id": 1, "usr": 12028309045033782423, "detailed_name": "Foo::Inner b", + "qual_name_offset": 14, "short_name": "b", "declarations": [], "spell": "10:15-10:16|-1|1|2", 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 fa19a31d..f1853878 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 @@ -15,6 +15,7 @@ OUTPUT: "id": 0, "usr": 10528472276654770367, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -31,6 +32,7 @@ OUTPUT: "id": 1, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -47,6 +49,7 @@ OUTPUT: "id": 0, "usr": 13545144895171991916, "detailed_name": "const int Foo::var", + "qual_name_offset": 10, "short_name": "var", "hover": "const int Foo::var = 3", "declarations": ["3:24-3:27|0|2|1"], @@ -58,6 +61,7 @@ OUTPUT: "id": 1, "usr": 16721564935990383768, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "hover": "int a = Foo::var", "declarations": [], @@ -71,6 +75,7 @@ OUTPUT: "id": 2, "usr": 12028309045033782423, "detailed_name": "int b", + "qual_name_offset": 4, "short_name": "b", "hover": "int b = Foo::var", "declarations": [], 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 79bca721..9a60681c 100644 --- a/index_tests/templates/template_func_usage_folded_into_one.cc +++ b/index_tests/templates/template_func_usage_folded_into_one.cc @@ -18,6 +18,7 @@ OUTPUT: "id": 0, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -33,6 +34,7 @@ OUTPUT: "id": 0, "usr": 326583651986177228, "detailed_name": "int foo()", + "qual_name_offset": 4, "short_name": "foo", "kind": 12, "storage": 3, @@ -49,6 +51,7 @@ OUTPUT: "id": 0, "usr": 16721564935990383768, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "hover": "int a = foo()", "declarations": [], @@ -62,6 +65,7 @@ OUTPUT: "id": 1, "usr": 12028309045033782423, "detailed_name": "int b", + "qual_name_offset": 4, "short_name": "b", "hover": "int b = foo()", "declarations": [], 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 0cc76af9..8a53c1cc 100644 --- a/index_tests/templates/template_type_usage_folded_into_one.cc +++ b/index_tests/templates/template_type_usage_folded_into_one.cc @@ -13,6 +13,7 @@ OUTPUT: "id": 0, "usr": 10528472276654770367, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -31,6 +32,7 @@ OUTPUT: "id": 0, "usr": 16721564935990383768, "detailed_name": "Foo a", + "qual_name_offset": 9, "short_name": "a", "declarations": [], "spell": "4:10-4:11|-1|1|2", @@ -43,6 +45,7 @@ OUTPUT: "id": 1, "usr": 12028309045033782423, "detailed_name": "Foo b", + "qual_name_offset": 10, "short_name": "b", "declarations": [], "spell": "5:11-5:12|-1|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 5d7464e9..02e01c73 100644 --- a/index_tests/templates/template_var_usage_folded_into_one.cc +++ b/index_tests/templates/template_var_usage_folded_into_one.cc @@ -39,6 +39,7 @@ OUTPUT: "id": 0, "usr": 6697181287623958829, "detailed_name": "A", + "qual_name_offset": 0, "short_name": "A", "kind": 10, "declarations": [], @@ -55,6 +56,7 @@ OUTPUT: "id": 1, "usr": 13892793056005362145, "detailed_name": "B", + "qual_name_offset": 0, "short_name": "B", "kind": 10, "declarations": [], @@ -71,6 +73,7 @@ OUTPUT: "id": 2, "usr": 11919899838872947844, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -87,6 +90,7 @@ OUTPUT: "id": 0, "usr": 8096973118640070624, "detailed_name": "T var", + "qual_name_offset": 2, "short_name": "var", "declarations": [], "spell": "5:3-5:6|-1|1|2", @@ -98,6 +102,7 @@ OUTPUT: "id": 1, "usr": 16721564935990383768, "detailed_name": "A a", + "qual_name_offset": 2, "short_name": "a", "hover": "A a = var", "declarations": [], @@ -111,6 +116,7 @@ OUTPUT: "id": 2, "usr": 12028309045033782423, "detailed_name": "B b", + "qual_name_offset": 2, "short_name": "b", "hover": "B b = var", "declarations": [], diff --git a/index_tests/types/anonymous_struct.cc b/index_tests/types/anonymous_struct.cc index 8a975693..32b4ea6f 100644 --- a/index_tests/types/anonymous_struct.cc +++ b/index_tests/types/anonymous_struct.cc @@ -12,6 +12,7 @@ OUTPUT: "id": 0, "usr": 17937907487590875128, "detailed_name": "vector3", + "qual_name_offset": 0, "short_name": "vector3", "kind": 23, "declarations": [], @@ -28,6 +29,7 @@ OUTPUT: "id": 1, "usr": 1428566502523368801, "detailed_name": "vector3::(anon struct)", + "qual_name_offset": 0, "short_name": "(anon struct)", "kind": 23, "declarations": [], @@ -44,6 +46,7 @@ OUTPUT: "id": 2, "usr": 21, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -60,6 +63,7 @@ OUTPUT: "id": 0, "usr": 3348817847649945564, "detailed_name": "float vector3::(anon struct)::x", + "qual_name_offset": 6, "short_name": "x", "declarations": [], "spell": "2:18-2:19|1|2|2", @@ -72,6 +76,7 @@ OUTPUT: "id": 1, "usr": 4821094820988543895, "detailed_name": "float vector3::(anon struct)::y", + "qual_name_offset": 6, "short_name": "y", "declarations": [], "spell": "2:21-2:22|1|2|2", @@ -84,6 +89,7 @@ OUTPUT: "id": 2, "usr": 15292551660437765731, "detailed_name": "float vector3::(anon struct)::z", + "qual_name_offset": 6, "short_name": "z", "declarations": [], "spell": "2:24-2:25|1|2|2", @@ -96,6 +102,7 @@ OUTPUT: "id": 3, "usr": 1963212417280098348, "detailed_name": "float [3] vector3::v", + "qual_name_offset": 10, "short_name": "v", "declarations": [], "spell": "3:9-3:10|0|2|2", diff --git a/index_tests/types/typedefs.cc b/index_tests/types/typedefs.cc index b11c9eee..90a30b68 100644 --- a/index_tests/types/typedefs.cc +++ b/index_tests/types/typedefs.cc @@ -10,6 +10,7 @@ OUTPUT: "id": 0, "usr": 13838176792705659279, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -24,6 +25,7 @@ OUTPUT: "id": 1, "usr": 10383876566159302459, "detailed_name": "func", + "qual_name_offset": 0, "short_name": "func", "kind": 252, "hover": "typedef int (func)(const int *a, const int *b)", @@ -43,6 +45,7 @@ OUTPUT: "id": 0, "usr": 8105378401105136463, "detailed_name": "func g", + "qual_name_offset": 5, "short_name": "g", "kind": 12, "storage": 3, diff --git a/index_tests/unions/union_decl.cc b/index_tests/unions/union_decl.cc index e3e0c501..519ddfda 100644 --- a/index_tests/unions/union_decl.cc +++ b/index_tests/unions/union_decl.cc @@ -12,6 +12,7 @@ OUTPUT: "id": 0, "usr": 8501689086387244262, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": [], @@ -28,6 +29,7 @@ OUTPUT: "id": 1, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -42,6 +44,7 @@ OUTPUT: "id": 2, "usr": 3, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -58,6 +61,7 @@ OUTPUT: "id": 0, "usr": 9529311430721959843, "detailed_name": "int Foo::a", + "qual_name_offset": 4, "short_name": "a", "declarations": [], "spell": "2:7-2:8|0|2|2", @@ -70,6 +74,7 @@ OUTPUT: "id": 1, "usr": 8804696910588009104, "detailed_name": "bool Foo::b", + "qual_name_offset": 5, "short_name": "b", "declarations": [], "spell": "3:8-3:9|0|2|2", diff --git a/index_tests/unions/union_usage.cc b/index_tests/unions/union_usage.cc index bdc57e03..a91b4e37 100644 --- a/index_tests/unions/union_usage.cc +++ b/index_tests/unions/union_usage.cc @@ -20,6 +20,7 @@ OUTPUT: "id": 0, "usr": 8501689086387244262, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": [], @@ -36,6 +37,7 @@ OUTPUT: "id": 1, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -50,6 +52,7 @@ OUTPUT: "id": 2, "usr": 3, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -65,6 +68,7 @@ OUTPUT: "id": 0, "usr": 13982179977217945200, "detailed_name": "void act(Foo *)", + "qual_name_offset": 5, "short_name": "act", "kind": 12, "storage": 1, @@ -81,6 +85,7 @@ OUTPUT: "id": 0, "usr": 9529311430721959843, "detailed_name": "int Foo::a", + "qual_name_offset": 4, "short_name": "a", "hover": "int Foo::a : 5", "declarations": [], @@ -94,6 +99,7 @@ OUTPUT: "id": 1, "usr": 8804696910588009104, "detailed_name": "bool Foo::b", + "qual_name_offset": 5, "short_name": "b", "hover": "bool Foo::b : 3", "declarations": [], @@ -107,6 +113,7 @@ OUTPUT: "id": 2, "usr": 2933643612409209903, "detailed_name": "Foo f", + "qual_name_offset": 4, "short_name": "f", "declarations": [], "spell": "6:5-6:6|-1|1|2", diff --git a/index_tests/usage/func_called_from_constructor.cc b/index_tests/usage/func_called_from_constructor.cc index 92cc9262..81aedbd4 100644 --- a/index_tests/usage/func_called_from_constructor.cc +++ b/index_tests/usage/func_called_from_constructor.cc @@ -17,6 +17,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": ["4:3-4:6|-1|1|4", "7:6-7:9|-1|1|4"], @@ -34,6 +35,7 @@ OUTPUT: "id": 0, "usr": 468307235068920063, "detailed_name": "void called()", + "qual_name_offset": 5, "short_name": "called", "kind": 12, "storage": 1, @@ -49,6 +51,7 @@ OUTPUT: "id": 1, "usr": 3385168158331140247, "detailed_name": "void Foo::Foo()", + "qual_name_offset": 5, "short_name": "Foo", "kind": 9, "storage": 1, diff --git a/index_tests/usage/func_called_from_macro_argument.cc b/index_tests/usage/func_called_from_macro_argument.cc index 42adc325..6514adae 100644 --- a/index_tests/usage/func_called_from_macro_argument.cc +++ b/index_tests/usage/func_called_from_macro_argument.cc @@ -16,6 +16,7 @@ OUTPUT: "id": 0, "usr": 3787803219955606747, "detailed_name": "bool called(bool a, bool b)", + "qual_name_offset": 5, "short_name": "called", "kind": 12, "storage": 1, @@ -32,6 +33,7 @@ OUTPUT: "id": 1, "usr": 11404881820527069090, "detailed_name": "void caller()", + "qual_name_offset": 5, "short_name": "caller", "kind": 12, "storage": 1, @@ -48,6 +50,7 @@ OUTPUT: "id": 0, "usr": 1290746656694198202, "detailed_name": "MACRO_CALL", + "qual_name_offset": 0, "short_name": "MACRO_CALL", "hover": "#define MACRO_CALL(e) e", "declarations": [], diff --git a/index_tests/usage/func_called_from_template.cc b/index_tests/usage/func_called_from_template.cc index 14e8e306..1840fb15 100644 --- a/index_tests/usage/func_called_from_template.cc +++ b/index_tests/usage/func_called_from_template.cc @@ -21,6 +21,7 @@ OUTPUT: "id": 0, "usr": 468307235068920063, "detailed_name": "void called()", + "qual_name_offset": 5, "short_name": "called", "kind": 12, "storage": 1, @@ -37,6 +38,7 @@ OUTPUT: "id": 1, "usr": 10177235824697315808, "detailed_name": "void caller()", + "qual_name_offset": 5, "short_name": "caller", "kind": 12, "storage": 1, @@ -52,6 +54,7 @@ OUTPUT: "id": 2, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, diff --git a/index_tests/usage/func_called_implicit_ctor.cc b/index_tests/usage/func_called_implicit_ctor.cc index d22528e6..b2f55947 100644 --- a/index_tests/usage/func_called_implicit_ctor.cc +++ b/index_tests/usage/func_called_implicit_ctor.cc @@ -17,6 +17,7 @@ OUTPUT: "id": 0, "usr": 13611487872560323389, "detailed_name": "Wrapper", + "qual_name_offset": 0, "short_name": "Wrapper", "kind": 23, "declarations": ["2:3-2:10|-1|1|4"], @@ -34,6 +35,7 @@ OUTPUT: "id": 0, "usr": 10544127002917214589, "detailed_name": "void Wrapper::Wrapper(int i)", + "qual_name_offset": 5, "short_name": "Wrapper", "kind": 9, "storage": 1, @@ -51,6 +53,7 @@ OUTPUT: "id": 1, "usr": 468307235068920063, "detailed_name": "int called()", + "qual_name_offset": 4, "short_name": "called", "kind": 12, "storage": 1, @@ -66,6 +69,7 @@ OUTPUT: "id": 2, "usr": 11404881820527069090, "detailed_name": "Wrapper caller()", + "qual_name_offset": 8, "short_name": "caller", "kind": 12, "storage": 1, diff --git a/index_tests/usage/func_usage_addr_func.cc b/index_tests/usage/func_usage_addr_func.cc index 2f69d39c..e87d6f34 100644 --- a/index_tests/usage/func_usage_addr_func.cc +++ b/index_tests/usage/func_usage_addr_func.cc @@ -17,6 +17,7 @@ OUTPUT: "id": 0, "usr": 12924914488846929470, "detailed_name": "void consume(void (*)())", + "qual_name_offset": 5, "short_name": "consume", "kind": 12, "storage": 1, @@ -32,6 +33,7 @@ OUTPUT: "id": 1, "usr": 5264867802674151787, "detailed_name": "void used()", + "qual_name_offset": 5, "short_name": "used", "kind": 12, "storage": 1, @@ -47,6 +49,7 @@ OUTPUT: "id": 2, "usr": 9376923949268137283, "detailed_name": "void user()", + "qual_name_offset": 5, "short_name": "user", "kind": 12, "storage": 1, @@ -63,6 +66,7 @@ OUTPUT: "id": 0, "usr": 16088407831770615719, "detailed_name": "void (*)() x", + "qual_name_offset": 11, "short_name": "x", "declarations": [], "spell": "6:10-6:11|2|3|2", diff --git a/index_tests/usage/func_usage_addr_method.cc b/index_tests/usage/func_usage_addr_method.cc index b2d9fb46..52d5739c 100644 --- a/index_tests/usage/func_usage_addr_method.cc +++ b/index_tests/usage/func_usage_addr_method.cc @@ -16,6 +16,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": [], @@ -33,6 +34,7 @@ OUTPUT: "id": 0, "usr": 18417145003926999463, "detailed_name": "void Foo::Used()", + "qual_name_offset": 5, "short_name": "Used", "kind": 6, "storage": 1, @@ -50,6 +52,7 @@ OUTPUT: "id": 1, "usr": 9376923949268137283, "detailed_name": "void user()", + "qual_name_offset": 5, "short_name": "user", "kind": 12, "storage": 1, @@ -66,6 +69,7 @@ OUTPUT: "id": 0, "usr": 4636142131003982569, "detailed_name": "void (Foo::*)() x", + "qual_name_offset": 16, "short_name": "x", "declarations": [], "spell": "6:8-6:9|1|3|2", diff --git a/index_tests/usage/func_usage_call_func.cc b/index_tests/usage/func_usage_call_func.cc index 57410853..2181c4f4 100644 --- a/index_tests/usage/func_usage_call_func.cc +++ b/index_tests/usage/func_usage_call_func.cc @@ -13,6 +13,7 @@ OUTPUT: "id": 0, "usr": 468307235068920063, "detailed_name": "void called()", + "qual_name_offset": 5, "short_name": "called", "kind": 12, "storage": 1, @@ -28,6 +29,7 @@ OUTPUT: "id": 1, "usr": 11404881820527069090, "detailed_name": "void caller()", + "qual_name_offset": 5, "short_name": "caller", "kind": 12, "storage": 1, diff --git a/index_tests/usage/func_usage_call_method.cc b/index_tests/usage/func_usage_call_method.cc index 01ef98f9..d18cc327 100644 --- a/index_tests/usage/func_usage_call_method.cc +++ b/index_tests/usage/func_usage_call_method.cc @@ -16,6 +16,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": [], @@ -33,6 +34,7 @@ OUTPUT: "id": 0, "usr": 18417145003926999463, "detailed_name": "void Foo::Used()", + "qual_name_offset": 5, "short_name": "Used", "kind": 6, "storage": 1, @@ -50,6 +52,7 @@ OUTPUT: "id": 1, "usr": 9376923949268137283, "detailed_name": "void user()", + "qual_name_offset": 5, "short_name": "user", "kind": 12, "storage": 1, @@ -66,6 +69,7 @@ OUTPUT: "id": 0, "usr": 14045150712868309451, "detailed_name": "Foo *f", + "qual_name_offset": 5, "short_name": "f", "hover": "Foo *f = nullptr", "declarations": [], 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 c3f1b85c..eb082133 100644 --- a/index_tests/usage/func_usage_class_inline_var_def.cc +++ b/index_tests/usage/func_usage_class_inline_var_def.cc @@ -15,6 +15,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -31,6 +32,7 @@ OUTPUT: "id": 1, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -46,6 +48,7 @@ OUTPUT: "id": 0, "usr": 9630503130605430498, "detailed_name": "int helper()", + "qual_name_offset": 4, "short_name": "helper", "kind": 12, "storage": 3, @@ -62,6 +65,7 @@ OUTPUT: "id": 0, "usr": 4220150017963593039, "detailed_name": "int Foo::x", + "qual_name_offset": 4, "short_name": "x", "hover": "int Foo::x = helper()", "declarations": [], diff --git a/index_tests/usage/func_usage_forward_decl_func.cc b/index_tests/usage/func_usage_forward_decl_func.cc index caec7c49..8ee0bcde 100644 --- a/index_tests/usage/func_usage_forward_decl_func.cc +++ b/index_tests/usage/func_usage_forward_decl_func.cc @@ -13,6 +13,7 @@ OUTPUT: "id": 0, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -29,6 +30,7 @@ OUTPUT: "id": 1, "usr": 6767773193109753523, "detailed_name": "void usage()", + "qual_name_offset": 5, "short_name": "usage", "kind": 12, "storage": 1, diff --git a/index_tests/usage/func_usage_forward_decl_method.cc b/index_tests/usage/func_usage_forward_decl_method.cc index c9c988c1..1d595bdf 100644 --- a/index_tests/usage/func_usage_forward_decl_method.cc +++ b/index_tests/usage/func_usage_forward_decl_method.cc @@ -15,6 +15,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": [], @@ -32,6 +33,7 @@ OUTPUT: "id": 0, "usr": 17922201480358737771, "detailed_name": "void Foo::foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 6, "storage": 1, @@ -49,6 +51,7 @@ OUTPUT: "id": 1, "usr": 6767773193109753523, "detailed_name": "void usage()", + "qual_name_offset": 5, "short_name": "usage", "kind": 12, "storage": 1, @@ -65,6 +68,7 @@ OUTPUT: "id": 0, "usr": 16229832321010999607, "detailed_name": "Foo *f", + "qual_name_offset": 5, "short_name": "f", "hover": "Foo *f = nullptr", "declarations": [], diff --git a/index_tests/usage/func_usage_template_func.cc b/index_tests/usage/func_usage_template_func.cc index ddfe668a..61087399 100644 --- a/index_tests/usage/func_usage_template_func.cc +++ b/index_tests/usage/func_usage_template_func.cc @@ -15,6 +15,7 @@ OUTPUT: "id": 0, "usr": 13420564603121289209, "detailed_name": "T", + "qual_name_offset": 0, "short_name": "T", "kind": 26, "declarations": [], @@ -32,6 +33,7 @@ OUTPUT: "id": 0, "usr": 10585861037135727329, "detailed_name": "void accept(T)", + "qual_name_offset": 5, "short_name": "accept", "kind": 12, "storage": 1, @@ -48,6 +50,7 @@ OUTPUT: "id": 1, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, diff --git a/index_tests/usage/type_usage_as_template_parameter.cc b/index_tests/usage/type_usage_as_template_parameter.cc index 57b128e7..973043fb 100644 --- a/index_tests/usage/type_usage_as_template_parameter.cc +++ b/index_tests/usage/type_usage_as_template_parameter.cc @@ -19,6 +19,7 @@ OUTPUT: "id": 0, "usr": 3286534761799572592, "detailed_name": "unique_ptr", + "qual_name_offset": 0, "short_name": "unique_ptr", "kind": 5, "declarations": [], @@ -35,6 +36,7 @@ OUTPUT: "id": 1, "usr": 4750332761459066907, "detailed_name": "S", + "qual_name_offset": 0, "short_name": "S", "kind": 23, "declarations": [], @@ -52,6 +54,7 @@ OUTPUT: "id": 0, "usr": 16359708726068806331, "detailed_name": "unique_ptr *return_type()", + "qual_name_offset": 15, "short_name": "return_type", "kind": 12, "storage": 1, @@ -68,6 +71,7 @@ OUTPUT: "id": 0, "usr": 12857919739649552168, "detailed_name": "unique_ptr f0", + "qual_name_offset": 17, "short_name": "f0", "declarations": [], "spell": "6:25-6:27|-1|1|2", @@ -80,6 +84,7 @@ OUTPUT: "id": 1, "usr": 18075066956054788088, "detailed_name": "unique_ptr f1", + "qual_name_offset": 14, "short_name": "f1", "declarations": [], "spell": "7:22-7:24|-1|1|2", @@ -92,6 +97,7 @@ OUTPUT: "id": 2, "usr": 3364438781074774169, "detailed_name": "unique_ptr *local", + "qual_name_offset": 15, "short_name": "local", "declarations": [], "spell": "10:18-10:23|0|3|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 d200b025..e740286d 100644 --- a/index_tests/usage/type_usage_as_template_parameter_complex.cc +++ b/index_tests/usage/type_usage_as_template_parameter_complex.cc @@ -87,6 +87,7 @@ OUTPUT: "id": 0, "usr": 14209198335088845323, "detailed_name": "unique_ptr", + "qual_name_offset": 0, "short_name": "unique_ptr", "kind": 5, "declarations": ["2:7-2:17|-1|1|1"], @@ -101,6 +102,7 @@ OUTPUT: "id": 1, "usr": 4310164820010458371, "detailed_name": "S1", + "qual_name_offset": 0, "short_name": "S1", "kind": 23, "declarations": ["4:8-4:10|-1|1|1"], @@ -115,6 +117,7 @@ OUTPUT: "id": 2, "usr": 12728490517004312484, "detailed_name": "S2", + "qual_name_offset": 0, "short_name": "S2", "kind": 23, "declarations": ["5:8-5:10|-1|1|1"], @@ -129,6 +132,7 @@ OUTPUT: "id": 3, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -146,6 +150,7 @@ OUTPUT: "id": 0, "usr": 1246637699196435450, "detailed_name": "unique_ptr, S2> *as_return_type(unique_ptr *)", + "qual_name_offset": 36, "short_name": "as_return_type", "kind": 12, "storage": 1, @@ -161,6 +166,7 @@ OUTPUT: "id": 1, "usr": 13067214284561914253, "detailed_name": "void no_return_type(int)", + "qual_name_offset": 5, "short_name": "no_return_type", "kind": 12, "storage": 1, @@ -176,6 +182,7 @@ OUTPUT: "id": 2, "usr": 18320186404467436976, "detailed_name": "void empty()", + "qual_name_offset": 5, "short_name": "empty", "kind": 12, "storage": 1, @@ -191,6 +198,7 @@ OUTPUT: "id": 3, "usr": 17922201480358737771, "detailed_name": "unique_ptr *Foo::foo()", + "qual_name_offset": 20, "short_name": "foo", "kind": 6, "storage": 1, @@ -211,6 +219,7 @@ OUTPUT: "id": 0, "usr": 2933643612409209903, "detailed_name": "unique_ptr, S2> f", + "qual_name_offset": 35, "short_name": "f", "declarations": ["15:43-15:44|-1|1|1"], "type": 0, @@ -221,6 +230,7 @@ OUTPUT: "id": 1, "usr": 500112618220246, "detailed_name": "unique_ptr, S2> *local", + "qual_name_offset": 36, "short_name": "local", "declarations": [], "spell": "54:39-54:44|2|3|2", 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 20ee51d3..3401f59a 100644 --- a/index_tests/usage/type_usage_as_template_parameter_simple.cc +++ b/index_tests/usage/type_usage_as_template_parameter_simple.cc @@ -14,6 +14,7 @@ OUTPUT: "id": 0, "usr": 3286534761799572592, "detailed_name": "unique_ptr", + "qual_name_offset": 0, "short_name": "unique_ptr", "kind": 5, "declarations": [], @@ -30,6 +31,7 @@ OUTPUT: "id": 1, "usr": 4750332761459066907, "detailed_name": "S", + "qual_name_offset": 0, "short_name": "S", "kind": 23, "declarations": ["4:8-4:9|-1|1|1"], @@ -46,6 +48,7 @@ OUTPUT: "id": 0, "usr": 3398408600781120939, "detailed_name": "unique_ptr foo", + "qual_name_offset": 14, "short_name": "foo", "declarations": [], "spell": "6:22-6:25|-1|1|2", diff --git a/index_tests/usage/type_usage_declare_extern.cc b/index_tests/usage/type_usage_declare_extern.cc index a89d1064..5bb50420 100644 --- a/index_tests/usage/type_usage_declare_extern.cc +++ b/index_tests/usage/type_usage_declare_extern.cc @@ -10,6 +10,7 @@ OUTPUT: "id": 0, "usr": 5673439900521455039, "detailed_name": "T", + "qual_name_offset": 0, "short_name": "T", "kind": 23, "declarations": [], @@ -28,6 +29,7 @@ OUTPUT: "id": 0, "usr": 1346710425945444872, "detailed_name": "T t", + "qual_name_offset": 2, "short_name": "t", "declarations": ["3:10-3:11|-1|1|1"], "type": 0, diff --git a/index_tests/usage/type_usage_declare_field.cc b/index_tests/usage/type_usage_declare_field.cc index 5876efe6..195f5afa 100644 --- a/index_tests/usage/type_usage_declare_field.cc +++ b/index_tests/usage/type_usage_declare_field.cc @@ -15,6 +15,7 @@ OUTPUT: "id": 0, "usr": 13749354388332789217, "detailed_name": "ForwardType", + "qual_name_offset": 0, "short_name": "ForwardType", "kind": 23, "declarations": ["1:8-1:19|-1|1|1"], @@ -29,6 +30,7 @@ OUTPUT: "id": 1, "usr": 8508299082070213750, "detailed_name": "ImplementedType", + "qual_name_offset": 0, "short_name": "ImplementedType", "kind": 23, "declarations": [], @@ -45,6 +47,7 @@ OUTPUT: "id": 2, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": [], @@ -63,6 +66,7 @@ OUTPUT: "id": 0, "usr": 14314859014962085433, "detailed_name": "ForwardType *Foo::a", + "qual_name_offset": 13, "short_name": "a", "declarations": [], "spell": "5:16-5:17|2|2|2", @@ -75,6 +79,7 @@ OUTPUT: "id": 1, "usr": 14727441168849658842, "detailed_name": "ImplementedType Foo::b", + "qual_name_offset": 16, "short_name": "b", "declarations": [], "spell": "6:19-6:20|2|2|2", diff --git a/index_tests/usage/type_usage_declare_local.cc b/index_tests/usage/type_usage_declare_local.cc index 73315594..b501a77b 100644 --- a/index_tests/usage/type_usage_declare_local.cc +++ b/index_tests/usage/type_usage_declare_local.cc @@ -15,6 +15,7 @@ OUTPUT: "id": 0, "usr": 13749354388332789217, "detailed_name": "ForwardType", + "qual_name_offset": 0, "short_name": "ForwardType", "kind": 23, "declarations": ["1:8-1:19|-1|1|1"], @@ -29,6 +30,7 @@ OUTPUT: "id": 1, "usr": 8508299082070213750, "detailed_name": "ImplementedType", + "qual_name_offset": 0, "short_name": "ImplementedType", "kind": 23, "declarations": [], @@ -46,6 +48,7 @@ OUTPUT: "id": 0, "usr": 4654328188330986029, "detailed_name": "void Foo()", + "qual_name_offset": 5, "short_name": "Foo", "kind": 12, "storage": 1, @@ -62,6 +65,7 @@ OUTPUT: "id": 0, "usr": 16374832544037266261, "detailed_name": "ForwardType *a", + "qual_name_offset": 13, "short_name": "a", "declarations": [], "spell": "5:16-5:17|0|3|2", @@ -74,6 +78,7 @@ OUTPUT: "id": 1, "usr": 2580122838476012357, "detailed_name": "ImplementedType b", + "qual_name_offset": 16, "short_name": "b", "declarations": [], "spell": "6:19-6:20|0|3|2", diff --git a/index_tests/usage/type_usage_declare_param.cc b/index_tests/usage/type_usage_declare_param.cc index b6155f87..60fccd12 100644 --- a/index_tests/usage/type_usage_declare_param.cc +++ b/index_tests/usage/type_usage_declare_param.cc @@ -12,6 +12,7 @@ OUTPUT: "id": 0, "usr": 13749354388332789217, "detailed_name": "ForwardType", + "qual_name_offset": 0, "short_name": "ForwardType", "kind": 23, "declarations": ["1:8-1:19|-1|1|1"], @@ -26,6 +27,7 @@ OUTPUT: "id": 1, "usr": 8508299082070213750, "detailed_name": "ImplementedType", + "qual_name_offset": 0, "short_name": "ImplementedType", "kind": 23, "declarations": [], @@ -43,6 +45,7 @@ OUTPUT: "id": 0, "usr": 1699390678058422036, "detailed_name": "void foo(ForwardType *f, ImplementedType a)", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -59,6 +62,7 @@ OUTPUT: "id": 0, "usr": 13058491096576226774, "detailed_name": "ForwardType *f", + "qual_name_offset": 13, "short_name": "f", "declarations": [], "spell": "4:23-4:24|0|3|2", @@ -71,6 +75,7 @@ OUTPUT: "id": 1, "usr": 11055777568039014776, "detailed_name": "ImplementedType a", + "qual_name_offset": 16, "short_name": "a", "declarations": [], "spell": "4:42-4:43|0|3|2", diff --git a/index_tests/usage/type_usage_declare_param_prototype.cc b/index_tests/usage/type_usage_declare_param_prototype.cc index 2cbc4522..05b6c4d4 100644 --- a/index_tests/usage/type_usage_declare_param_prototype.cc +++ b/index_tests/usage/type_usage_declare_param_prototype.cc @@ -17,6 +17,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": ["1:8-1:11|-1|1|1"], @@ -32,6 +33,7 @@ OUTPUT: "id": 0, "usr": 8908726657907936744, "detailed_name": "void foo(Foo *f, Foo *)", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -51,6 +53,7 @@ OUTPUT: "id": 0, "usr": 13823260660189154978, "detailed_name": "Foo *f", + "qual_name_offset": 5, "short_name": "f", "declarations": [], "spell": "4:15-4:16|0|3|2", diff --git a/index_tests/usage/type_usage_declare_param_unnamed.cc b/index_tests/usage/type_usage_declare_param_unnamed.cc index 2af6a192..b588c4f7 100644 --- a/index_tests/usage/type_usage_declare_param_unnamed.cc +++ b/index_tests/usage/type_usage_declare_param_unnamed.cc @@ -9,6 +9,7 @@ OUTPUT: "id": 0, "usr": 13749354388332789217, "detailed_name": "ForwardType", + "qual_name_offset": 0, "short_name": "ForwardType", "kind": 23, "declarations": ["1:8-1:19|-1|1|1"], @@ -24,6 +25,7 @@ OUTPUT: "id": 0, "usr": 15327735280790448926, "detailed_name": "void foo(ForwardType *)", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, diff --git a/index_tests/usage/type_usage_declare_qualifiers.cc b/index_tests/usage/type_usage_declare_qualifiers.cc index 0219d89f..799906b3 100644 --- a/index_tests/usage/type_usage_declare_qualifiers.cc +++ b/index_tests/usage/type_usage_declare_qualifiers.cc @@ -15,6 +15,7 @@ OUTPUT: "id": 0, "usr": 13487927231218873822, "detailed_name": "Type", + "qual_name_offset": 0, "short_name": "Type", "kind": 23, "declarations": [], @@ -32,6 +33,7 @@ OUTPUT: "id": 0, "usr": 16858540520096802573, "detailed_name": "void foo(Type &a0, const Type &a1)", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -48,6 +50,7 @@ OUTPUT: "id": 0, "usr": 7997456978847868736, "detailed_name": "Type &a0", + "qual_name_offset": 6, "short_name": "a0", "declarations": [], "spell": "3:16-3:18|0|3|2", @@ -60,6 +63,7 @@ OUTPUT: "id": 1, "usr": 17228576662112939520, "detailed_name": "const Type &a1", + "qual_name_offset": 12, "short_name": "a1", "declarations": [], "spell": "3:32-3:34|0|3|2", @@ -72,6 +76,7 @@ OUTPUT: "id": 2, "usr": 15429032129697337561, "detailed_name": "Type a2", + "qual_name_offset": 5, "short_name": "a2", "declarations": [], "spell": "4:8-4:10|0|3|2", @@ -84,6 +89,7 @@ OUTPUT: "id": 3, "usr": 6081981442495435784, "detailed_name": "Type *a3", + "qual_name_offset": 6, "short_name": "a3", "declarations": [], "spell": "5:9-5:11|0|3|2", @@ -96,6 +102,7 @@ OUTPUT: "id": 4, "usr": 5004072032239834773, "detailed_name": "const Type *a4", + "qual_name_offset": 12, "short_name": "a4", "declarations": [], "spell": "6:15-6:17|0|3|2", @@ -108,6 +115,7 @@ OUTPUT: "id": 5, "usr": 14939253431683105646, "detailed_name": "const Type *const a5", + "qual_name_offset": 18, "short_name": "a5", "hover": "const Type *const a5 = nullptr", "declarations": [], diff --git a/index_tests/usage/type_usage_declare_static.cc b/index_tests/usage/type_usage_declare_static.cc index 0e570fee..53b6926a 100644 --- a/index_tests/usage/type_usage_declare_static.cc +++ b/index_tests/usage/type_usage_declare_static.cc @@ -9,6 +9,7 @@ OUTPUT: "id": 0, "usr": 13487927231218873822, "detailed_name": "Type", + "qual_name_offset": 0, "short_name": "Type", "kind": 23, "declarations": [], @@ -27,6 +28,7 @@ OUTPUT: "id": 0, "usr": 6601831367240627080, "detailed_name": "Type t", + "qual_name_offset": 5, "short_name": "t", "declarations": [], "spell": "2:13-2:14|-1|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 cdd5c090..dfbc8836 100644 --- a/index_tests/usage/type_usage_on_return_type.cc +++ b/index_tests/usage/type_usage_on_return_type.cc @@ -26,6 +26,7 @@ OUTPUT: "id": 0, "usr": 13487927231218873822, "detailed_name": "Type", + "qual_name_offset": 0, "short_name": "Type", "kind": 23, "declarations": ["1:8-1:12|-1|1|1"], @@ -40,6 +41,7 @@ OUTPUT: "id": 1, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -57,6 +59,7 @@ OUTPUT: "id": 0, "usr": 4259594751088586730, "detailed_name": "Type *foo()", + "qual_name_offset": 6, "short_name": "foo", "kind": 12, "storage": 1, @@ -78,6 +81,7 @@ OUTPUT: "id": 1, "usr": 13402221340333431092, "detailed_name": "Type *Foo::Get(int)", + "qual_name_offset": 6, "short_name": "Get", "kind": 6, "storage": 1, @@ -97,6 +101,7 @@ OUTPUT: "id": 2, "usr": 4240751906910175539, "detailed_name": "void Foo::Empty()", + "qual_name_offset": 5, "short_name": "Empty", "kind": 6, "storage": 1, @@ -116,6 +121,7 @@ OUTPUT: "id": 3, "usr": 7746867874366499515, "detailed_name": "const Type &external()", + "qual_name_offset": 12, "short_name": "external", "kind": 12, "storage": 2, @@ -132,6 +138,7 @@ OUTPUT: "id": 4, "usr": 18408440185620243373, "detailed_name": "Type *bar()", + "qual_name_offset": 6, "short_name": "bar", "kind": 12, "storage": 3, diff --git a/index_tests/usage/type_usage_typedef_and_using.cc b/index_tests/usage/type_usage_typedef_and_using.cc index a732a4f6..6b243e4a 100644 --- a/index_tests/usage/type_usage_typedef_and_using.cc +++ b/index_tests/usage/type_usage_typedef_and_using.cc @@ -18,6 +18,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": ["1:8-1:11|-1|1|1"], @@ -32,6 +33,7 @@ OUTPUT: "id": 1, "usr": 1544499294580512394, "detailed_name": "Foo1", + "qual_name_offset": 0, "short_name": "Foo1", "kind": 252, "hover": "using Foo1 = Foo*", @@ -50,6 +52,7 @@ OUTPUT: "id": 2, "usr": 15466821155413653804, "detailed_name": "Foo2", + "qual_name_offset": 0, "short_name": "Foo2", "kind": 252, "hover": "typedef Foo Foo2", @@ -68,6 +71,7 @@ OUTPUT: "id": 3, "usr": 17897026942631673064, "detailed_name": "Foo3", + "qual_name_offset": 0, "short_name": "Foo3", "kind": 252, "hover": "using Foo3 = Foo1", @@ -86,6 +90,7 @@ OUTPUT: "id": 4, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -100,6 +105,7 @@ OUTPUT: "id": 5, "usr": 2638219001294786365, "detailed_name": "Foo4", + "qual_name_offset": 0, "short_name": "Foo4", "kind": 252, "hover": "using Foo4 = int", @@ -119,6 +125,7 @@ OUTPUT: "id": 0, "usr": 9119341505144503905, "detailed_name": "void accept(Foo *)", + "qual_name_offset": 5, "short_name": "accept", "kind": 12, "storage": 1, @@ -134,6 +141,7 @@ OUTPUT: "id": 1, "usr": 558620830317390922, "detailed_name": "void accept1(Foo1 *)", + "qual_name_offset": 5, "short_name": "accept1", "kind": 12, "storage": 1, @@ -149,6 +157,7 @@ OUTPUT: "id": 2, "usr": 10523262907746124479, "detailed_name": "void accept2(Foo2 *)", + "qual_name_offset": 5, "short_name": "accept2", "kind": 12, "storage": 1, @@ -164,6 +173,7 @@ OUTPUT: "id": 3, "usr": 14986366321326974406, "detailed_name": "void accept3(Foo3 *)", + "qual_name_offset": 5, "short_name": "accept3", "kind": 12, "storage": 1, 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 fb536eab..a9f31ef0 100644 --- a/index_tests/usage/type_usage_typedef_and_using_template.cc +++ b/index_tests/usage/type_usage_typedef_and_using_template.cc @@ -13,6 +13,7 @@ OUTPUT: "id": 0, "usr": 10528472276654770367, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": ["2:8-2:11|-1|1|1"], @@ -27,6 +28,7 @@ OUTPUT: "id": 1, "usr": 1544499294580512394, "detailed_name": "Foo1", + "qual_name_offset": 0, "short_name": "Foo1", "kind": 252, "hover": "using Foo1 = Foo", @@ -45,6 +47,7 @@ OUTPUT: "id": 2, "usr": 15933698173231330933, "detailed_name": "Foo2", + "qual_name_offset": 0, "short_name": "Foo2", "kind": 252, "hover": "typedef Foo Foo2", diff --git a/index_tests/usage/type_usage_various.cc b/index_tests/usage/type_usage_various.cc index e38d14d6..f948a0f7 100644 --- a/index_tests/usage/type_usage_various.cc +++ b/index_tests/usage/type_usage_various.cc @@ -18,6 +18,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -35,6 +36,7 @@ OUTPUT: "id": 0, "usr": 9488177941273031343, "detailed_name": "Foo *Foo::make()", + "qual_name_offset": 5, "short_name": "make", "kind": 6, "storage": 1, @@ -55,6 +57,7 @@ OUTPUT: "id": 0, "usr": 16380484338511689669, "detailed_name": "Foo f", + "qual_name_offset": 4, "short_name": "f", "declarations": [], "spell": "6:7-6:8|0|3|2", @@ -67,6 +70,7 @@ OUTPUT: "id": 1, "usr": 14455976355866885943, "detailed_name": "Foo foo", + "qual_name_offset": 4, "short_name": "foo", "declarations": ["10:12-10:15|-1|1|1"], "type": 0, diff --git a/index_tests/usage/usage_inside_of_call.cc b/index_tests/usage/usage_inside_of_call.cc index 556bacc4..23988cc3 100644 --- a/index_tests/usage/usage_inside_of_call.cc +++ b/index_tests/usage/usage_inside_of_call.cc @@ -23,6 +23,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": [], @@ -39,6 +40,7 @@ OUTPUT: "id": 1, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -54,6 +56,7 @@ OUTPUT: "id": 0, "usr": 18319417758892371313, "detailed_name": "void called(int a)", + "qual_name_offset": 5, "short_name": "called", "kind": 12, "storage": 1, @@ -70,6 +73,7 @@ OUTPUT: "id": 1, "usr": 11404602816585117695, "detailed_name": "int gen()", + "qual_name_offset": 4, "short_name": "gen", "kind": 12, "storage": 1, @@ -86,6 +90,7 @@ OUTPUT: "id": 2, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -102,6 +107,7 @@ OUTPUT: "id": 0, "usr": 11489549839875479478, "detailed_name": "int Foo::static_var", + "qual_name_offset": 4, "short_name": "static_var", "hover": "int Foo::static_var = 0", "declarations": ["6:14-6:24|0|2|1"], @@ -115,6 +121,7 @@ OUTPUT: "id": 1, "usr": 9648311402855509901, "detailed_name": "int Foo::field_var", + "qual_name_offset": 4, "short_name": "field_var", "declarations": [], "spell": "7:7-7:16|0|2|2", @@ -127,6 +134,7 @@ OUTPUT: "id": 2, "usr": 8039186520399841081, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "hover": "int a = 5", "declarations": [], diff --git a/index_tests/usage/usage_inside_of_call_simple.cc b/index_tests/usage/usage_inside_of_call_simple.cc index b5336d11..4aaa7875 100644 --- a/index_tests/usage/usage_inside_of_call_simple.cc +++ b/index_tests/usage/usage_inside_of_call_simple.cc @@ -16,6 +16,7 @@ OUTPUT: "id": 0, "usr": 18319417758892371313, "detailed_name": "void called(int a)", + "qual_name_offset": 5, "short_name": "called", "kind": 12, "storage": 1, @@ -32,6 +33,7 @@ OUTPUT: "id": 1, "usr": 11404602816585117695, "detailed_name": "int gen()", + "qual_name_offset": 4, "short_name": "gen", "kind": 12, "storage": 1, @@ -47,6 +49,7 @@ OUTPUT: "id": 2, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, diff --git a/index_tests/usage/var_usage_call_function.cc b/index_tests/usage/var_usage_call_function.cc index de98e5fc..e2d4f2fa 100644 --- a/index_tests/usage/var_usage_call_function.cc +++ b/index_tests/usage/var_usage_call_function.cc @@ -17,6 +17,7 @@ OUTPUT: "id": 0, "usr": 468307235068920063, "detailed_name": "void called()", + "qual_name_offset": 5, "short_name": "called", "kind": 12, "storage": 1, @@ -32,6 +33,7 @@ OUTPUT: "id": 1, "usr": 11404881820527069090, "detailed_name": "void caller()", + "qual_name_offset": 5, "short_name": "caller", "kind": 12, "storage": 1, @@ -48,6 +50,7 @@ OUTPUT: "id": 0, "usr": 9121974011454213596, "detailed_name": "void (*)() x", + "qual_name_offset": 11, "short_name": "x", "declarations": [], "spell": "4:8-4:9|1|3|2", diff --git a/index_tests/usage/var_usage_class_member.cc b/index_tests/usage/var_usage_class_member.cc index 21bbdfd9..d69730a6 100644 --- a/index_tests/usage/var_usage_class_member.cc +++ b/index_tests/usage/var_usage_class_member.cc @@ -26,6 +26,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -42,6 +43,7 @@ OUTPUT: "id": 1, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -57,6 +59,7 @@ OUTPUT: "id": 0, "usr": 17175780305784503374, "detailed_name": "void accept(int)", + "qual_name_offset": 5, "short_name": "accept", "kind": 12, "storage": 1, @@ -73,6 +76,7 @@ OUTPUT: "id": 1, "usr": 12086644540399881766, "detailed_name": "void accept(int *)", + "qual_name_offset": 5, "short_name": "accept", "kind": 12, "storage": 1, @@ -89,6 +93,7 @@ OUTPUT: "id": 2, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -105,6 +110,7 @@ OUTPUT: "id": 0, "usr": 4220150017963593039, "detailed_name": "int Foo::x", + "qual_name_offset": 4, "short_name": "x", "declarations": [], "spell": "3:7-3:8|0|2|2", @@ -117,6 +123,7 @@ OUTPUT: "id": 1, "usr": 3873837747174060388, "detailed_name": "int Foo::y", + "qual_name_offset": 4, "short_name": "y", "declarations": [], "spell": "4:7-4:8|0|2|2", @@ -129,6 +136,7 @@ OUTPUT: "id": 2, "usr": 14669930844300034456, "detailed_name": "Foo f", + "qual_name_offset": 4, "short_name": "f", "declarations": [], "spell": "11:7-11:8|2|3|2", diff --git a/index_tests/usage/var_usage_class_member_static.cc b/index_tests/usage/var_usage_class_member_static.cc index 1ad13233..981bb21a 100644 --- a/index_tests/usage/var_usage_class_member_static.cc +++ b/index_tests/usage/var_usage_class_member_static.cc @@ -17,6 +17,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": [], @@ -33,6 +34,7 @@ OUTPUT: "id": 1, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -48,6 +50,7 @@ OUTPUT: "id": 0, "usr": 17175780305784503374, "detailed_name": "void accept(int)", + "qual_name_offset": 5, "short_name": "accept", "kind": 12, "storage": 1, @@ -64,6 +67,7 @@ OUTPUT: "id": 1, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -80,6 +84,7 @@ OUTPUT: "id": 0, "usr": 8599782646965457351, "detailed_name": "int Foo::x", + "qual_name_offset": 4, "short_name": "x", "declarations": ["2:14-2:15|0|2|1"], "type": 1, diff --git a/index_tests/usage/var_usage_cstyle_cast.cc b/index_tests/usage/var_usage_cstyle_cast.cc index ecf60930..e6400caa 100644 --- a/index_tests/usage/var_usage_cstyle_cast.cc +++ b/index_tests/usage/var_usage_cstyle_cast.cc @@ -16,6 +16,7 @@ OUTPUT: "id": 0, "usr": 5792006888140599735, "detailed_name": "VarType", + "qual_name_offset": 0, "short_name": "VarType", "kind": 10, "declarations": [], @@ -32,6 +33,7 @@ OUTPUT: "id": 1, "usr": 10028537921178202800, "detailed_name": "Holder", + "qual_name_offset": 0, "short_name": "Holder", "kind": 23, "declarations": [], @@ -50,6 +52,7 @@ OUTPUT: "id": 0, "usr": 7057400933868440116, "detailed_name": "const VarType Holder::static_var", + "qual_name_offset": 14, "short_name": "static_var", "hover": "const VarType Holder::static_var = (VarType)0x0", "declarations": ["4:28-4:38|1|2|1"], diff --git a/index_tests/usage/var_usage_extern.cc b/index_tests/usage/var_usage_extern.cc index 412c8551..441c73ac 100644 --- a/index_tests/usage/var_usage_extern.cc +++ b/index_tests/usage/var_usage_extern.cc @@ -12,6 +12,7 @@ OUTPUT: "id": 0, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -27,6 +28,7 @@ OUTPUT: "id": 0, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -43,6 +45,7 @@ OUTPUT: "id": 0, "usr": 16721564935990383768, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "declarations": ["1:12-1:13|-1|1|1"], "type": 0, diff --git a/index_tests/usage/var_usage_func_parameter.cc b/index_tests/usage/var_usage_func_parameter.cc index 26341c49..f2531870 100644 --- a/index_tests/usage/var_usage_func_parameter.cc +++ b/index_tests/usage/var_usage_func_parameter.cc @@ -10,6 +10,7 @@ OUTPUT: "id": 0, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -25,6 +26,7 @@ OUTPUT: "id": 0, "usr": 11998306017310352355, "detailed_name": "void foo(int a)", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -41,6 +43,7 @@ OUTPUT: "id": 0, "usr": 10063793875496522529, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "declarations": [], "spell": "1:14-1:15|0|3|2", diff --git a/index_tests/usage/var_usage_local.cc b/index_tests/usage/var_usage_local.cc index 09fd489c..009367ea 100644 --- a/index_tests/usage/var_usage_local.cc +++ b/index_tests/usage/var_usage_local.cc @@ -11,6 +11,7 @@ OUTPUT: "id": 0, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -26,6 +27,7 @@ OUTPUT: "id": 0, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -42,6 +44,7 @@ OUTPUT: "id": 0, "usr": 14014650769929566957, "detailed_name": "int x", + "qual_name_offset": 4, "short_name": "x", "declarations": [], "spell": "2:7-2:8|0|3|2", diff --git a/index_tests/usage/var_usage_shadowed_local.cc b/index_tests/usage/var_usage_shadowed_local.cc index f1767412..e63910aa 100644 --- a/index_tests/usage/var_usage_shadowed_local.cc +++ b/index_tests/usage/var_usage_shadowed_local.cc @@ -16,6 +16,7 @@ OUTPUT: "id": 0, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -31,6 +32,7 @@ OUTPUT: "id": 0, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -47,6 +49,7 @@ OUTPUT: "id": 0, "usr": 13311055950748663970, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "declarations": [], "spell": "2:7-2:8|0|3|2", @@ -59,6 +62,7 @@ OUTPUT: "id": 1, "usr": 14036425367303419504, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "declarations": [], "spell": "5:9-5:10|0|3|2", diff --git a/index_tests/usage/var_usage_shadowed_parameter.cc b/index_tests/usage/var_usage_shadowed_parameter.cc index 591f7b1d..b33d417c 100644 --- a/index_tests/usage/var_usage_shadowed_parameter.cc +++ b/index_tests/usage/var_usage_shadowed_parameter.cc @@ -16,6 +16,7 @@ OUTPUT: "id": 0, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -31,6 +32,7 @@ OUTPUT: "id": 0, "usr": 11998306017310352355, "detailed_name": "void foo(int a)", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -47,6 +49,7 @@ OUTPUT: "id": 0, "usr": 11608231465452906059, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "declarations": [], "spell": "1:14-1:15|0|3|2", @@ -59,6 +62,7 @@ OUTPUT: "id": 1, "usr": 6997229590862003559, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "declarations": [], "spell": "4:9-4:10|0|3|2", diff --git a/index_tests/usage/var_usage_static.cc b/index_tests/usage/var_usage_static.cc index ab456631..b6fb8bc9 100644 --- a/index_tests/usage/var_usage_static.cc +++ b/index_tests/usage/var_usage_static.cc @@ -13,6 +13,7 @@ OUTPUT: "id": 0, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -28,6 +29,7 @@ OUTPUT: "id": 0, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -44,6 +46,7 @@ OUTPUT: "id": 0, "usr": 11823161916242867318, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "declarations": [], "spell": "1:12-1:13|-1|1|2", diff --git a/index_tests/vars/class_member.cc b/index_tests/vars/class_member.cc index cf676c63..43e10c01 100644 --- a/index_tests/vars/class_member.cc +++ b/index_tests/vars/class_member.cc @@ -10,6 +10,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -28,6 +29,7 @@ OUTPUT: "id": 0, "usr": 13799811842374292251, "detailed_name": "Foo *Foo::member", + "qual_name_offset": 5, "short_name": "member", "declarations": [], "spell": "2:8-2:14|0|2|2", diff --git a/index_tests/vars/class_static_member.cc b/index_tests/vars/class_static_member.cc index 6b5d1208..8af93e6c 100644 --- a/index_tests/vars/class_static_member.cc +++ b/index_tests/vars/class_static_member.cc @@ -12,6 +12,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -30,6 +31,7 @@ OUTPUT: "id": 0, "usr": 5844987037615239736, "detailed_name": "Foo *Foo::member", + "qual_name_offset": 5, "short_name": "member", "hover": "Foo *Foo::member = nullptr", "declarations": ["2:15-2:21|0|2|1"], diff --git a/index_tests/vars/class_static_member_decl_only.cc b/index_tests/vars/class_static_member_decl_only.cc index a7ea0afa..069ded36 100644 --- a/index_tests/vars/class_static_member_decl_only.cc +++ b/index_tests/vars/class_static_member_decl_only.cc @@ -10,6 +10,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -26,6 +27,7 @@ OUTPUT: "id": 1, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -42,6 +44,7 @@ OUTPUT: "id": 0, "usr": 5844987037615239736, "detailed_name": "int Foo::member", + "qual_name_offset": 4, "short_name": "member", "declarations": ["2:14-2:20|0|2|1"], "type": 1, diff --git a/index_tests/vars/deduce_auto_type.cc b/index_tests/vars/deduce_auto_type.cc index 8bd1166f..801a2203 100644 --- a/index_tests/vars/deduce_auto_type.cc +++ b/index_tests/vars/deduce_auto_type.cc @@ -13,6 +13,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 5, "declarations": [], @@ -30,6 +31,7 @@ OUTPUT: "id": 0, "usr": 880549676430489861, "detailed_name": "void f()", + "qual_name_offset": 5, "short_name": "f", "kind": 12, "storage": 1, @@ -46,6 +48,7 @@ OUTPUT: "id": 0, "usr": 10601729374837386290, "detailed_name": "Foo *x", + "qual_name_offset": 5, "short_name": "x", "declarations": [], "spell": "3:8-3:9|0|3|2", @@ -58,6 +61,7 @@ OUTPUT: "id": 1, "usr": 18422884837902130475, "detailed_name": "Foo *y", + "qual_name_offset": 5, "short_name": "y", "declarations": [], "spell": "4:9-4:10|0|3|2", diff --git a/index_tests/vars/function_local.cc b/index_tests/vars/function_local.cc index 4c3951ca..16e4995d 100644 --- a/index_tests/vars/function_local.cc +++ b/index_tests/vars/function_local.cc @@ -13,6 +13,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": ["1:8-1:11|-1|1|1"], @@ -28,6 +29,7 @@ OUTPUT: "id": 0, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -44,6 +46,7 @@ OUTPUT: "id": 0, "usr": 13198746475679542317, "detailed_name": "Foo *a", + "qual_name_offset": 5, "short_name": "a", "declarations": [], "spell": "4:8-4:9|0|3|2", diff --git a/index_tests/vars/function_param.cc b/index_tests/vars/function_param.cc index 0108c73b..cfd28001 100644 --- a/index_tests/vars/function_param.cc +++ b/index_tests/vars/function_param.cc @@ -11,6 +11,7 @@ OUTPUT: "id": 0, "usr": 15041163540773201510, "detailed_name": "Foo", + "qual_name_offset": 0, "short_name": "Foo", "kind": 23, "declarations": ["1:8-1:11|-1|1|1"], @@ -26,6 +27,7 @@ OUTPUT: "id": 0, "usr": 8908726657907936744, "detailed_name": "void foo(Foo *p0, Foo *p1)", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -42,6 +44,7 @@ OUTPUT: "id": 0, "usr": 8730439006497971620, "detailed_name": "Foo *p0", + "qual_name_offset": 5, "short_name": "p0", "declarations": [], "spell": "3:15-3:17|0|3|2", @@ -54,6 +57,7 @@ OUTPUT: "id": 1, "usr": 2525014371090380500, "detailed_name": "Foo *p1", + "qual_name_offset": 5, "short_name": "p1", "declarations": [], "spell": "3:24-3:26|0|3|2", diff --git a/index_tests/vars/function_param_unnamed.cc b/index_tests/vars/function_param_unnamed.cc index aa3fd2a7..8d4f8813 100644 --- a/index_tests/vars/function_param_unnamed.cc +++ b/index_tests/vars/function_param_unnamed.cc @@ -9,6 +9,7 @@ OUTPUT: "id": 0, "usr": 2747674671862363334, "detailed_name": "void foo(int, int)", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, diff --git a/index_tests/vars/function_shadow_local.cc b/index_tests/vars/function_shadow_local.cc index 1d16f481..53fa645e 100644 --- a/index_tests/vars/function_shadow_local.cc +++ b/index_tests/vars/function_shadow_local.cc @@ -16,6 +16,7 @@ OUTPUT: "id": 0, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -31,6 +32,7 @@ OUTPUT: "id": 0, "usr": 4259594751088586730, "detailed_name": "void foo()", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -47,6 +49,7 @@ OUTPUT: "id": 0, "usr": 1894874819807168345, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "declarations": [], "spell": "2:7-2:8|0|3|2", @@ -59,6 +62,7 @@ OUTPUT: "id": 1, "usr": 4508045017817092115, "detailed_name": "int a", + "qual_name_offset": 4, "short_name": "a", "declarations": [], "spell": "5:9-5:10|0|3|2", diff --git a/index_tests/vars/function_shadow_param.cc b/index_tests/vars/function_shadow_param.cc index ee7b225e..cab3e40d 100644 --- a/index_tests/vars/function_shadow_param.cc +++ b/index_tests/vars/function_shadow_param.cc @@ -10,6 +10,7 @@ OUTPUT: "id": 0, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -25,6 +26,7 @@ OUTPUT: "id": 0, "usr": 11998306017310352355, "detailed_name": "void foo(int p)", + "qual_name_offset": 5, "short_name": "foo", "kind": 12, "storage": 1, @@ -41,6 +43,7 @@ OUTPUT: "id": 0, "usr": 5875271969926422921, "detailed_name": "int p", + "qual_name_offset": 4, "short_name": "p", "declarations": [], "spell": "1:14-1:15|0|3|2", @@ -53,6 +56,7 @@ OUTPUT: "id": 1, "usr": 11404600766177939811, "detailed_name": "int p", + "qual_name_offset": 4, "short_name": "p", "hover": "int p = 0", "declarations": [], diff --git a/index_tests/vars/global_variable.cc b/index_tests/vars/global_variable.cc index 5d061ff7..d40c35b8 100644 --- a/index_tests/vars/global_variable.cc +++ b/index_tests/vars/global_variable.cc @@ -8,6 +8,7 @@ OUTPUT: "id": 0, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -24,6 +25,7 @@ OUTPUT: "id": 0, "usr": 6834525061342585382, "detailed_name": "int global", + "qual_name_offset": 4, "short_name": "global", "hover": "int global = 0", "declarations": [], diff --git a/index_tests/vars/global_variable_decl_only.cc b/index_tests/vars/global_variable_decl_only.cc index f70c21bc..2aaaedcd 100644 --- a/index_tests/vars/global_variable_decl_only.cc +++ b/index_tests/vars/global_variable_decl_only.cc @@ -8,6 +8,7 @@ OUTPUT: "id": 0, "usr": 17, "detailed_name": "", + "qual_name_offset": 0, "short_name": "", "kind": 0, "declarations": [], @@ -24,6 +25,7 @@ OUTPUT: "id": 0, "usr": 9937941849651546906, "detailed_name": "int global", + "qual_name_offset": 4, "short_name": "global", "declarations": ["1:12-1:18|-1|1|1"], "type": 0, diff --git a/index_tests/vars/type_instance_on_using_type.cc b/index_tests/vars/type_instance_on_using_type.cc index 1101a983..f61dd2c1 100644 --- a/index_tests/vars/type_instance_on_using_type.cc +++ b/index_tests/vars/type_instance_on_using_type.cc @@ -15,6 +15,7 @@ OUTPUT: "id": 0, "usr": 4750332761459066907, "detailed_name": "S", + "qual_name_offset": 0, "short_name": "S", "kind": 23, "declarations": [], @@ -31,6 +32,7 @@ OUTPUT: "id": 1, "usr": 7434820806199665424, "detailed_name": "F", + "qual_name_offset": 0, "short_name": "F", "kind": 252, "hover": "using F = S", @@ -50,6 +52,7 @@ OUTPUT: "id": 0, "usr": 4654328188330986029, "detailed_name": "void Foo()", + "qual_name_offset": 5, "short_name": "Foo", "kind": 12, "storage": 1, @@ -66,6 +69,7 @@ OUTPUT: "id": 0, "usr": 6975456769752895964, "detailed_name": "F a", + "qual_name_offset": 2, "short_name": "a", "declarations": [], "spell": "4:5-4:6|0|3|2", diff --git a/src/clang_indexer.cc b/src/clang_indexer.cc index fac4d740..1167416d 100644 --- a/src/clang_indexer.cc +++ b/src/clang_indexer.cc @@ -309,7 +309,9 @@ struct IndexParam { clang_PrintingPolicy_dispose(print_policy_more); } - std::string PrettyPrintCursor(CXCursor cursor, bool initializer = true) { + std::tuple PrettyPrintCursor( + CXCursor cursor, + std::string_view short_name) { if (!print_policy) { print_policy = clang_getCursorPrintingPolicy(cursor); clang_PrintingPolicy_setProperty(print_policy, @@ -324,8 +326,31 @@ struct IndexParam { clang_PrintingPolicy_setProperty(print_policy_more, CXPrintingPolicy_TerseOutput, 1); } - return ToString(clang_getCursorPrettyPrinted( - cursor, initializer ? print_policy_more : print_policy)); + std::string name = + ToString(clang_getCursorPrettyPrinted(cursor, print_policy_more)); + 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); + assert(i != std::string::npos); + int16_t short_name_offset = i, 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; + } + return {name, i, short_name_offset, short_name_size}; } #endif }; @@ -360,13 +385,8 @@ IndexFile* ConsumeFile(IndexParam* param, CXFile file) { // Report skipped source range list. CXSourceRangeList* skipped = clang_getSkippedRanges(param->tu->cx_tu, file); for (unsigned i = 0; i < skipped->count; ++i) { - Range range = ResolveCXSourceRange(skipped->ranges[i]); -#if CINDEX_VERSION < 45 // Before clang 6.0.0 - // clang_getSkippedRanges reports start one token after the '#', move it - // back so it starts at the '#' - range.start.column -= 1; -#endif - db->skipped_by_preprocessor.push_back(range); + db->skipped_by_preprocessor.push_back( + ResolveCXSourceRange(skipped->ranges[i])); } clang_disposeSourceRangeList(skipped); } @@ -497,6 +517,8 @@ const char* GetAnonName(CXCursorKind kind) { return "(anon class)"; case CXCursor_EnumDecl: return "(anon enum)"; + case CXCursor_Namespace: + return "(anon ns)"; case CXCursor_StructDecl: return "(anon struct)"; case CXCursor_UnionDecl: @@ -521,9 +543,12 @@ void SetTypeName(IndexType* type, // Investigate why clang_getCursorPrettyPrinted gives `struct A {}` `namespace // ns {}` which are not qualified. // type->def.detailed_name = param->PrettyPrintCursor(cursor.cx_cursor); - std::tie(type->def.detailed_name, type->def.short_name_offset) = + int short_name_offset, short_name_size; + std::tie(type->def.detailed_name, short_name_offset, short_name_size) = param->ns.QualifiedName(container ? container : &parent, name); - type->def.short_name_size = strlen(name); + type->def.qual_name_offset = 0; + type->def.short_name_offset = short_name_offset; + type->def.short_name_size = short_name_size; } // Finds the cursor associated with the declaration type of |cursor|. This @@ -586,13 +611,14 @@ void SetVarDetail(IndexVar* var, def.storage = GetStorageClass(clang_Cursor_getStorageClass(cursor.cx_cursor)); // TODO how to make PrettyPrint'ed variable name qualified? - std::string qualified_name = #if 0 && CINDEX_HAVE_PRETTY cursor.get_kind() != CXCursor_EnumConstantDecl ? param->PrettyPrintCursor(cursor.cx_cursor) : #endif - param->ns.QualifiedName(semanticContainer, short_name).first; + std::string qualified_name; + std::tie(qualified_name, def.short_name_offset, def.short_name_size) = + param->ns.QualifiedName(semanticContainer, short_name); if (cursor.get_kind() == CXCursor_EnumConstantDecl && semanticContainer) { CXType enum_type = clang_getCanonicalType( @@ -610,7 +636,10 @@ void SetVarDetail(IndexVar* var, #if 0 && CINDEX_HAVE_PRETTY //def.detailed_name = param->PrettyPrintCursor(cursor.cx_cursor, false); #else - ConcatTypeAndName(type_name, qualified_name); + int offset = type_name.size(); + offset += ConcatTypeAndName(type_name, qualified_name); + def.qual_name_offset = offset; + def.short_name_offset += offset; def.detailed_name = type_name; // Append the textual initializer, bit field, constructor to |hover|. // Omit |hover| for these types: @@ -947,7 +976,7 @@ void VisitDeclForTypeUsageVisitorHandler(ClangCursor cursor, if (param->toplevel_type) { IndexType* ref_type = db->Resolve(*param->toplevel_type); std::string name = cursor.get_referenced().get_spell_name(); - if (name == ref_type->def.ShortName()) { + if (name == ref_type->def.Name(false)) { AddUseSpell(db, ref_type->uses, cursor); param->toplevel_type = std::nullopt; return; @@ -1236,6 +1265,7 @@ ClangCursor::VisitResult VisitMacroDefinitionAndExpansions(ClangCursor cursor, if (cursor.get_kind() == CXCursor_MacroDefinition) { CXSourceRange cx_extent = clang_getCursorExtent(cursor.cx_cursor); var_def->def.detailed_name = cursor.get_display_name(); + var_def->def.qual_name_offset = 0; var_def->def.short_name_offset = 0; var_def->def.short_name_size = int16_t(strlen(var_def->def.detailed_name.c_str())); @@ -1407,11 +1437,11 @@ ClangCursor::VisitResult TemplateVisitor(ClangCursor cursor, } // namespace -std::pair NamespaceHelper::QualifiedName( +std::tuple NamespaceHelper::QualifiedName( const CXIdxContainerInfo* container, std::string_view unqualified_name) { if (!container) - return {std::string(unqualified_name), 0}; + return {std::string(unqualified_name), 0, 0}; // Anonymous namespaces are not processed by indexDeclaration. We trace // nested namespaces bottom-up through clang_getCursorSemanticParent until // one that we know its qualified name. Then do another trace top-down and @@ -1441,9 +1471,9 @@ std::pair NamespaceHelper::QualifiedName( qualifier += "::"; container_cursor_to_qualified_name[namespaces[i]] = qualifier; } - int pos = qualifier.size(); + int16_t pos = qualifier.size(); qualifier.append(unqualified_name); - return {qualifier, pos}; + return {qualifier, pos, int16_t(unqualified_name.size())}; } void OnIndexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) { @@ -1669,14 +1699,14 @@ void OnIndexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) { // insert the qualified name before the first '('. // FIXME GetFunctionSignature should set index #if CINDEX_HAVE_PRETTY - func->def.detailed_name = param->PrettyPrintCursor(decl->cursor); + std::tie(func->def.detailed_name, func->def.qual_name_offset, + func->def.short_name_offset, func->def.short_name_size) = + param->PrettyPrintCursor(decl->cursor, decl->entityInfo->name); #else - func->def.detailed_name = GetFunctionSignature(db, ¶m->ns, decl); + std::tie(func->def.detailed_name, func->def.qual_name_offset, + func->def.short_name_offset, func->def.short_name_size) = + GetFunctionSignature(db, ¶m->ns, decl); #endif - auto idx = func->def.detailed_name.find(decl->entityInfo->name); - assert(idx != std::string::npos); - func->def.short_name_offset = idx; - func->def.short_name_size = strlen(decl->entityInfo->name); // CXCursor_OverloadedDeclRef in templates are not processed by // OnIndexReference, thus we use TemplateVisitor to collect function @@ -1843,7 +1873,7 @@ void OnIndexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) { // cursor if (origin->def.detailed_name.empty()) { SetTypeName(origin, origin_cursor, nullptr, - &type->def.ShortName()[0], param); + &type->def.Name(false)[0], param); origin->def.kind = type->def.kind; } // TODO The name may be assigned in |ResolveToDeclarationType| but @@ -2046,7 +2076,7 @@ void OnIndexReference(CXClientData client_data, const CXIdxEntityRefInfo* ref) { IndexFuncId called_id = db->ToFuncId(HashUsr(ref->referencedEntity->USR)); IndexFunc* called = db->Resolve(called_id); - std::string_view short_name = called->def.ShortName(); + std::string_view short_name = called->def.Name(false); // libclang doesn't provide a nice api to check if the given function // call is implicit. ref->kind should probably work (it's either direct // or implicit), but libclang only supports implicit for objective-c. @@ -2296,11 +2326,15 @@ std::vector> ParseWithTu( return result; } -void ConcatTypeAndName(std::string& type, const std::string& name) { +bool ConcatTypeAndName(std::string& type, const std::string& name) { + bool ret = false; if (type.size() && - (type.back() != ' ' && type.back() != '*' && type.back() != '&')) + (type.back() != ' ' && type.back() != '*' && type.back() != '&')) { type.push_back(' '); + ret = true; + } type.append(name); + return ret; } void IndexInit() { diff --git a/src/indexer.h b/src/indexer.h index 8a6decea..a57febe1 100644 --- a/src/indexer.h +++ b/src/indexer.h @@ -140,8 +140,22 @@ struct IndexFamily { using Range = ::Range; }; +template +struct NameMixin { + std::string_view Name(bool qualified) const { + auto self = static_cast(this); + return qualified ? std::string_view( + self->detailed_name.c_str() + self->qual_name_offset, + self->short_name_offset - self->qual_name_offset + + self->short_name_size) + : std::string_view(self->detailed_name.c_str() + + self->short_name_offset, + self->short_name_size); + } +}; + template -struct TypeDefDefinitionData { +struct TypeDef : NameMixin> { // General metadata. std::string detailed_name; NtString hover; @@ -172,31 +186,26 @@ struct TypeDefDefinitionData { // type comes from a using or typedef statement). Maybe alias_of; + int16_t qual_name_offset = 0; int16_t short_name_offset = 0; int16_t short_name_size = 0; lsSymbolKind kind = lsSymbolKind::Unknown; - bool operator==(const TypeDefDefinitionData& o) const { + bool operator==(const TypeDef& o) const { return detailed_name == o.detailed_name && spell == o.spell && extent == o.extent && alias_of == o.alias_of && bases == o.bases && types == o.types && funcs == o.funcs && vars == o.vars && kind == o.kind && hover == o.hover && comments == o.comments; } - bool operator!=(const TypeDefDefinitionData& o) const { + bool operator!=(const TypeDef& o) const { return !(*this == o); } - - std::string_view ShortName() const { - return std::string_view(detailed_name.c_str() + short_name_offset, - short_name_size); - } - // Used by ccls_inheritance_hierarchy.cc:Expand generic lambda - std::string_view DetailedName(bool) const { return detailed_name; } }; template -void Reflect(TVisitor& visitor, TypeDefDefinitionData& value) { +void Reflect(TVisitor& visitor, TypeDef& value) { REFLECT_MEMBER_START(); REFLECT_MEMBER(detailed_name); + REFLECT_MEMBER(qual_name_offset); REFLECT_MEMBER(short_name_offset); REFLECT_MEMBER(short_name_size); REFLECT_MEMBER(kind); @@ -214,7 +223,7 @@ void Reflect(TVisitor& visitor, TypeDefDefinitionData& value) { } struct IndexType { - using Def = TypeDefDefinitionData; + using Def = TypeDef; Usr usr; IndexTypeId id; @@ -240,7 +249,7 @@ struct IndexType { MAKE_HASHABLE(IndexType, t.id); template -struct FuncDefDefinitionData { +struct FuncDef : NameMixin> { // General metadata. std::string detailed_name; NtString hover; @@ -260,38 +269,29 @@ struct FuncDefDefinitionData { typename F::FileId file; // Type which declares this one (ie, it is a method) Maybe declaring_type; + int16_t qual_name_offset = 0; int16_t short_name_offset = 0; int16_t short_name_size = 0; lsSymbolKind kind = lsSymbolKind::Unknown; StorageClass storage = StorageClass::Invalid; - bool operator==(const FuncDefDefinitionData& o) const { + bool operator==(const FuncDef& o) const { return detailed_name == o.detailed_name && spell == o.spell && extent == o.extent && declaring_type == o.declaring_type && bases == o.bases && vars == o.vars && callees == o.callees && kind == o.kind && storage == o.storage && hover == o.hover && comments == o.comments; } - bool operator!=(const FuncDefDefinitionData& o) const { + bool operator!=(const FuncDef& o) const { return !(*this == o); } - - std::string_view ShortName() const { - return std::string_view(detailed_name.c_str() + short_name_offset, - short_name_size); - } - std::string_view DetailedName(bool params) const { - if (params) - return detailed_name; - return std::string_view(detailed_name) - .substr(0, short_name_offset + short_name_size); - } }; template -void Reflect(TVisitor& visitor, FuncDefDefinitionData& value) { +void Reflect(TVisitor& visitor, FuncDef& value) { REFLECT_MEMBER_START(); REFLECT_MEMBER(detailed_name); + REFLECT_MEMBER(qual_name_offset); REFLECT_MEMBER(short_name_offset); REFLECT_MEMBER(short_name_size); REFLECT_MEMBER(kind); @@ -308,8 +308,8 @@ void Reflect(TVisitor& visitor, FuncDefDefinitionData& value) { REFLECT_MEMBER_END(); } -struct IndexFunc { - using Def = FuncDefDefinitionData; +struct IndexFunc : NameMixin { + using Def = FuncDef; Usr usr; IndexFuncId id; @@ -345,7 +345,7 @@ MAKE_HASHABLE(IndexFunc, t.id); MAKE_REFLECT_STRUCT(IndexFunc::Declaration, spell, param_spellings); template -struct VarDefDefinitionData { +struct VarDef : NameMixin> { // General metadata. std::string detailed_name; NtString hover; @@ -360,6 +360,7 @@ struct VarDefDefinitionData { Maybe type; // Function/type which declares this one. + int16_t qual_name_offset = 0; int16_t short_name_offset = 0; int16_t short_name_size = 0; @@ -370,41 +371,21 @@ struct VarDefDefinitionData { bool is_local() const { return kind == lsSymbolKind::Variable; } - bool operator==(const VarDefDefinitionData& o) const { + bool operator==(const VarDef& o) const { return detailed_name == o.detailed_name && spell == o.spell && extent == o.extent && type == o.type && kind == o.kind && storage == o.storage && hover == o.hover && comments == o.comments; } - bool operator!=(const VarDefDefinitionData& o) const { return !(*this == o); } - - std::string_view ShortName() const { - return std::string_view(detailed_name.c_str() + short_name_offset, - short_name_size); - } - std::string DetailedName(bool qualified) const { - if (qualified) - return detailed_name; - int i = short_name_offset; - for (int paren = 0; i; i--) { - // Skip parentheses in "(anon struct)::name" - if (detailed_name[i - 1] == ')') - paren++; - else if (detailed_name[i - 1] == '(') - paren--; - else if (!(paren > 0 || isalnum(detailed_name[i - 1]) || - detailed_name[i - 1] == '_' || detailed_name[i - 1] == ':')) - break; - } - return detailed_name.substr(0, i) + detailed_name.substr(short_name_offset); - } + bool operator!=(const VarDef& o) const { return !(*this == o); } }; template -void Reflect(TVisitor& visitor, VarDefDefinitionData& value) { +void Reflect(TVisitor& visitor, VarDef& value) { REFLECT_MEMBER_START(); REFLECT_MEMBER(detailed_name); - REFLECT_MEMBER(short_name_size); + REFLECT_MEMBER(qual_name_offset); REFLECT_MEMBER(short_name_offset); + REFLECT_MEMBER(short_name_size); REFLECT_MEMBER(hover); REFLECT_MEMBER(comments); REFLECT_MEMBER(spell); @@ -417,7 +398,7 @@ void Reflect(TVisitor& visitor, VarDefDefinitionData& value) { } struct IndexVar { - using Def = VarDefDefinitionData; + using Def = VarDef; Usr usr; IndexVarId id; @@ -509,8 +490,9 @@ struct NamespaceHelper { std::unordered_map container_cursor_to_qualified_name; - std::pair QualifiedName(const CXIdxContainerInfo* container, - std::string_view unqualified_name); + std::tuple QualifiedName( + const CXIdxContainerInfo* container, + std::string_view unqualified_name); }; // |import_file| is the cc file which is what gets passed to clang. @@ -534,7 +516,7 @@ std::vector> ParseWithTu( const std::vector& args, const std::vector& file_contents); -void ConcatTypeAndName(std::string& type, const std::string& name); +bool ConcatTypeAndName(std::string& type, const std::string& name); void IndexInit(); diff --git a/src/message_handler.cc b/src/message_handler.cc index cdc2d98a..78b32eec 100644 --- a/src/message_handler.cc +++ b/src/message_handler.cc @@ -222,9 +222,8 @@ void EmitSemanticHighlighting(QueryDatabase* db, } // Don't highlight overloadable operators or implicit lambda -> // std::function constructor. - std::string_view short_name = def->ShortName(); - if (short_name.compare(0, 8, "operator") == 0 || - short_name.compare(0, 27, "functionName(false); + if (short_name.compare(0, 8, "operator") == 0) continue; // applies to for loop if (def->spell) parent_kind = GetSymbolKind(db, *def->spell); diff --git a/src/messages/ccls_call_hierarchy.cc b/src/messages/ccls_call_hierarchy.cc index 04e117f8..50a83ae6 100644 --- a/src/messages/ccls_call_hierarchy.cc +++ b/src/messages/ccls_call_hierarchy.cc @@ -37,7 +37,7 @@ struct In_CclsCallHierarchy : public RequestInMessage { // Base: include base functions; All: include both base and derived // functions. CallType callType = CallType::All; - bool detailedName = false; + bool qualified = true; int levels = 1; }; Params params; @@ -49,7 +49,7 @@ MAKE_REFLECT_STRUCT(In_CclsCallHierarchy::Params, id, callee, callType, - detailedName, + qualified, levels); MAKE_REFLECT_STRUCT(In_CclsCallHierarchy, id, params); REGISTER_IN_MESSAGE(In_CclsCallHierarchy); @@ -81,7 +81,7 @@ bool Expand(MessageHandler* m, Out_CclsCallHierarchy::Entry* entry, bool callee, CallType call_type, - bool detailed_name, + bool qualified, int levels) { const QueryFunc& func = m->db->funcs[entry->id.id]; const QueryFunc::Def* def = func.AnyDef(); @@ -96,7 +96,7 @@ bool Expand(MessageHandler* m, if (auto loc = GetLsLocation(m->db, m->working_files, use)) entry1.location = *loc; entry1.callType = call_type; - if (Expand(m, &entry1, callee, call_type, detailed_name, levels - 1)) + if (Expand(m, &entry1, callee, call_type, qualified, levels - 1)) entry->children.push_back(std::move(entry1)); } }; @@ -117,10 +117,7 @@ bool Expand(MessageHandler* m, std::unordered_set seen; seen.insert(func.usr); std::vector stack; - if (detailed_name) - entry->name = def->detailed_name; - else - entry->name = def->ShortName(); + entry->name = def->Name(qualified); handle_uses(func, CallType::Direct); // Callers/callees of base functions. @@ -166,7 +163,7 @@ struct Handler_CclsCallHierarchy std::optional BuildInitial(QueryFuncId root_id, bool callee, CallType call_type, - bool detailed_name, + bool qualified, int levels) { const auto* def = db->funcs[root_id.id].AnyDef(); if (!def) @@ -180,7 +177,7 @@ struct Handler_CclsCallHierarchy GetLsLocation(db, working_files, *def->spell)) entry.location = *loc; } - Expand(this, &entry, callee, call_type, detailed_name, levels); + Expand(this, &entry, callee, call_type, qualified, levels); return entry; } @@ -194,8 +191,8 @@ struct Handler_CclsCallHierarchy entry.id = *params.id; entry.callType = CallType::Direct; if (entry.id.id < db->funcs.size()) - Expand(this, &entry, params.callee, params.callType, - params.detailedName, params.levels); + Expand(this, &entry, params.callee, params.callType, params.qualified, + params.levels); out.result = std::move(entry); } else { QueryFile* file; @@ -209,7 +206,7 @@ struct Handler_CclsCallHierarchy if (sym.kind == SymbolKind::Func) { out.result = BuildInitial(QueryFuncId(sym.id), params.callee, params.callType, - params.detailedName, params.levels); + params.qualified, params.levels); break; } } diff --git a/src/messages/ccls_inheritance_hierarchy.cc b/src/messages/ccls_inheritance_hierarchy.cc index 29b9ad5e..52ab1ba1 100644 --- a/src/messages/ccls_inheritance_hierarchy.cc +++ b/src/messages/ccls_inheritance_hierarchy.cc @@ -18,7 +18,7 @@ struct In_CclsInheritanceHierarchy : public RequestInMessage { // true: derived classes/functions; false: base classes/functions bool derived = false; - bool detailedName = false; + bool qualified = true; int levels = 1; }; Params params; @@ -30,7 +30,7 @@ MAKE_REFLECT_STRUCT(In_CclsInheritanceHierarchy::Params, id, kind, derived, - detailedName, + qualified, levels); MAKE_REFLECT_STRUCT(In_CclsInheritanceHierarchy, id, params); REGISTER_IN_MESSAGE(In_CclsInheritanceHierarchy); @@ -63,14 +63,14 @@ MAKE_REFLECT_STRUCT(Out_CclsInheritanceHierarchy, jsonrpc, id, result); bool Expand(MessageHandler* m, Out_CclsInheritanceHierarchy::Entry* entry, bool derived, - bool detailed_name, + bool qualified, int levels); template bool ExpandHelper(MessageHandler* m, Out_CclsInheritanceHierarchy::Entry* entry, bool derived, - bool detailed_name, + bool qualified, int levels, Q& entity) { const auto* def = entity.AnyDef(); @@ -78,10 +78,7 @@ bool ExpandHelper(MessageHandler* m, entry->numChildren = 0; return false; } - if (detailed_name) - entry->name = def->DetailedName(false); - else - entry->name = def->ShortName(); + entry->name = def->Name(qualified); if (def->spell) { if (std::optional loc = GetLsLocation(m->db, m->working_files, *def->spell)) @@ -93,7 +90,7 @@ bool ExpandHelper(MessageHandler* m, Out_CclsInheritanceHierarchy::Entry entry1; entry1.id = id; entry1.kind = entry->kind; - if (Expand(m, &entry1, derived, detailed_name, levels - 1)) + if (Expand(m, &entry1, derived, qualified, levels - 1)) entry->children.push_back(std::move(entry1)); } entry->numChildren = int(entry->children.size()); @@ -105,7 +102,7 @@ bool ExpandHelper(MessageHandler* m, Out_CclsInheritanceHierarchy::Entry entry1; entry1.id = id; entry1.kind = entry->kind; - if (Expand(m, &entry1, derived, detailed_name, levels - 1)) + if (Expand(m, &entry1, derived, qualified, levels - 1)) entry->children.push_back(std::move(entry1)); } entry->numChildren = int(entry->children.size()); @@ -118,13 +115,13 @@ bool ExpandHelper(MessageHandler* m, bool Expand(MessageHandler* m, Out_CclsInheritanceHierarchy::Entry* entry, bool derived, - bool detailed_name, + bool qualified, int levels) { if (entry->kind == SymbolKind::Func) - return ExpandHelper(m, entry, derived, detailed_name, levels, + return ExpandHelper(m, entry, derived, qualified, levels, m->db->funcs[entry->id.id]); else - return ExpandHelper(m, entry, derived, detailed_name, levels, + return ExpandHelper(m, entry, derived, qualified, levels, m->db->types[entry->id.id]); } @@ -133,11 +130,11 @@ struct Handler_CclsInheritanceHierarchy MethodType GetMethodType() const override { return kMethodType; } std::optional - BuildInitial(SymbolRef sym, bool derived, bool detailed_name, int levels) { + BuildInitial(SymbolRef sym, bool derived, bool qualified, int levels) { Out_CclsInheritanceHierarchy::Entry entry; entry.id = sym.id; entry.kind = sym.kind; - Expand(this, &entry, derived, detailed_name, levels); + Expand(this, &entry, derived, qualified, levels); return entry; } @@ -153,7 +150,7 @@ struct Handler_CclsInheritanceHierarchy if (((entry.kind == SymbolKind::Func && entry.id.id < db->funcs.size()) || (entry.kind == SymbolKind::Type && entry.id.id < db->types.size())) && - Expand(this, &entry, params.derived, params.detailedName, + Expand(this, &entry, params.derived, params.qualified, params.levels)) out.result = std::move(entry); } else { @@ -167,7 +164,7 @@ struct Handler_CclsInheritanceHierarchy for (SymbolRef sym : FindSymbolsAtLocation(working_file, file, request->params.position)) { if (sym.kind == SymbolKind::Func || sym.kind == SymbolKind::Type) { - out.result = BuildInitial(sym, params.derived, params.detailedName, + out.result = BuildInitial(sym, params.derived, params.qualified, params.levels); break; } diff --git a/src/messages/ccls_member_hierarchy.cc b/src/messages/ccls_member_hierarchy.cc index 619b5153..a2991293 100644 --- a/src/messages/ccls_member_hierarchy.cc +++ b/src/messages/ccls_member_hierarchy.cc @@ -16,7 +16,7 @@ struct In_CclsMemberHierarchy : public RequestInMessage { Maybe id; - bool detailedName = false; + bool qualified = false; int levels = 1; }; Params params; @@ -26,7 +26,7 @@ MAKE_REFLECT_STRUCT(In_CclsMemberHierarchy::Params, textDocument, position, id, - detailedName, + qualified, levels); MAKE_REFLECT_STRUCT(In_CclsMemberHierarchy, id, params); REGISTER_IN_MESSAGE(In_CclsMemberHierarchy); @@ -58,23 +58,24 @@ MAKE_REFLECT_STRUCT(Out_CclsMemberHierarchy, jsonrpc, id, result); bool Expand(MessageHandler* m, Out_CclsMemberHierarchy::Entry* entry, - bool detailed_name, + bool qualified, int levels); // Add a field to |entry| which is a Func/Type. void DoField(MessageHandler* m, Out_CclsMemberHierarchy::Entry* entry, const QueryVar& var, - bool detailed_name, + bool qualified, int levels) { const QueryVar::Def* def1 = var.AnyDef(); if (!def1) return; Out_CclsMemberHierarchy::Entry entry1; - if (detailed_name) - entry1.fieldName = def1->DetailedName(false); + if (qualified) + entry1.fieldName = def1->detailed_name; else - entry1.fieldName = std::string(def1->ShortName()); + entry1.fieldName = def1->detailed_name.substr(0, def1->qual_name_offset) + + std::string(def1->Name(false)); if (def1->spell) { if (std::optional loc = GetLsLocation(m->db, m->working_files, *def1->spell)) @@ -82,7 +83,7 @@ void DoField(MessageHandler* m, } if (def1->type) { entry1.id = *def1->type; - if (Expand(m, &entry1, detailed_name, levels)) + if (Expand(m, &entry1, qualified, levels)) entry->children.push_back(std::move(entry1)); } else { entry1.id = QueryTypeId(); @@ -93,21 +94,18 @@ void DoField(MessageHandler* m, // Expand a type node by adding members recursively to it. bool Expand(MessageHandler* m, Out_CclsMemberHierarchy::Entry* entry, - bool detailed_name, + bool qualified, int levels) { const QueryType& type = m->db->types[entry->id.id]; const QueryType::Def* def = type.AnyDef(); - // builtin types have no declaration and empty |detailed_name|. + // builtin types have no declaration and empty |qualified|. if (CXType_FirstBuiltin <= type.usr && type.usr <= CXType_LastBuiltin) { entry->name = ClangBuiltinTypeName(CXTypeKind(type.usr)); return true; } if (!def) return false; - if (detailed_name) - entry->name = def->detailed_name; - else - entry->name = def->ShortName(); + entry->name = def->Name(qualified); std::unordered_set seen; if (levels > 0) { std::vector stack; @@ -139,17 +137,17 @@ bool Expand(MessageHandler* m, GetLsLocation(m->db, m->working_files, *def->spell)) entry1.location = *loc; } - if (def1 && detailed_name) + if (def1 && qualified) entry1.fieldName = def1->detailed_name; - if (Expand(m, &entry1, detailed_name, levels - 1)) { + if (Expand(m, &entry1, qualified, levels - 1)) { // For builtin types |name| is set. - if (detailed_name && entry1.fieldName.empty()) + if (entry1.fieldName.empty()) entry1.fieldName = std::string(entry1.name); entry->children.push_back(std::move(entry1)); } } else { EachDefinedEntity(m->db->vars, def->vars, [&](QueryVar& var) { - DoField(m, entry, var, detailed_name, levels - 1); + DoField(m, entry, var, qualified, levels - 1); }); } } @@ -165,7 +163,7 @@ struct Handler_CclsMemberHierarchy MethodType GetMethodType() const override { return kMethodType; } std::optional BuildInitial(QueryFuncId root_id, - bool detailed_name, + bool qualified, int levels) { const auto* def = db->funcs[root_id.id].AnyDef(); if (!def) @@ -173,23 +171,20 @@ struct Handler_CclsMemberHierarchy Out_CclsMemberHierarchy::Entry entry; // Not type, |id| is invalid. - if (detailed_name) - entry.name = def->DetailedName(false); - else - entry.name = std::string(def->ShortName()); + entry.name = std::string(def->Name(qualified)); if (def->spell) { if (std::optional loc = GetLsLocation(db, working_files, *def->spell)) entry.location = *loc; } EachDefinedEntity(db->vars, def->vars, [&](QueryVar& var) { - DoField(this, &entry, var, detailed_name, levels - 1); + DoField(this, &entry, var, qualified, levels - 1); }); return entry; } std::optional BuildInitial(QueryTypeId root_id, - bool detailed_name, + bool qualified, int levels) { const auto* def = db->types[root_id.id].AnyDef(); if (!def) @@ -202,7 +197,7 @@ struct Handler_CclsMemberHierarchy GetLsLocation(db, working_files, *def->spell)) entry.location = *loc; } - Expand(this, &entry, detailed_name, levels); + Expand(this, &entry, qualified, levels); return entry; } @@ -216,7 +211,7 @@ struct Handler_CclsMemberHierarchy entry.id = *request->params.id; // entry.name is empty as it is known by the client. if (entry.id.id < db->types.size() && - Expand(this, &entry, params.detailedName, params.levels)) + Expand(this, &entry, params.qualified, params.levels)) out.result = std::move(entry); } else { QueryFile* file; @@ -229,18 +224,18 @@ struct Handler_CclsMemberHierarchy FindSymbolsAtLocation(working_file, file, params.position)) { switch (sym.kind) { case SymbolKind::Func: - out.result = BuildInitial(QueryFuncId(sym.id), params.detailedName, + out.result = BuildInitial(QueryFuncId(sym.id), params.qualified, params.levels); break; case SymbolKind::Type: - out.result = BuildInitial(QueryTypeId(sym.id), params.detailedName, + out.result = BuildInitial(QueryTypeId(sym.id), params.qualified, params.levels); break; case SymbolKind::Var: { const QueryVar::Def* def = db->GetVar(sym).AnyDef(); if (def && def->type) out.result = BuildInitial(QueryTypeId(*def->type), - params.detailedName, params.levels); + params.qualified, params.levels); break; } default: diff --git a/src/messages/text_document_definition.cc b/src/messages/text_document_definition.cc index 15216ace..35fec5bd 100644 --- a/src/messages/text_document_definition.cc +++ b/src/messages/text_document_definition.cc @@ -142,20 +142,20 @@ struct Handler_TextDocumentDefinition if (db->symbols[i].kind == SymbolKind::Invalid) continue; - std::string_view name = short_query.size() < query.size() - ? db->GetSymbolDetailedName(i) - : db->GetSymbolShortName(i); - auto pos = name.rfind(short_query); - if (pos == std::string::npos) + std::string_view short_name = db->GetSymbolName(i, false), + name = short_query.size() < query.size() + ? db->GetSymbolName(i, true) + : short_name; + if (short_name != short_query) continue; if (Maybe use = GetDefinitionSpell(db, db->symbols[i])) { std::tuple score{ - int(name.size() - short_query.size()), -pos, + int(name.size() - short_query.size()), 0, use->file != file_id, std::abs(use->range.start.line - position.line)}; // Update the score with qualified name if the qualified name // occurs in |name|. - pos = name.rfind(query); + auto pos = name.rfind(query); if (pos != std::string::npos) { std::get<0>(score) = int(name.size() - query.size()); std::get<1>(score) = -pos; diff --git a/src/messages/workspace_symbol.cc b/src/messages/workspace_symbol.cc index 06140b50..e556ba93 100644 --- a/src/messages/workspace_symbol.cc +++ b/src/messages/workspace_symbol.cc @@ -84,7 +84,7 @@ struct Handler_WorkspaceSymbol : BaseMessageHandler { // Find exact substring matches. for (int i = 0; i < db->symbols.size(); ++i) { - std::string_view detailed_name = db->GetSymbolDetailedName(i); + std::string_view detailed_name = db->GetSymbolName(i, true); if (detailed_name.find(query) != std::string::npos) { // Do not show the same entry twice. if (!inserted_results.insert(std::string(detailed_name)).second) @@ -108,7 +108,7 @@ struct Handler_WorkspaceSymbol : BaseMessageHandler { query_without_space += c; for (int i = 0; i < (int)db->symbols.size(); ++i) { - std::string_view detailed_name = db->GetSymbolDetailedName(i); + std::string_view detailed_name = db->GetSymbolName(i, true); if (CaseFoldingSubsequenceMatch(query_without_space, detailed_name) .first) { // Do not show the same entry twice. @@ -129,12 +129,12 @@ struct Handler_WorkspaceSymbol : BaseMessageHandler { // Sort results with a fuzzy matching algorithm. int longest = 0; for (int i : result_indices) - longest = std::max(longest, int(db->GetSymbolDetailedName(i).size())); + longest = std::max(longest, int(db->GetSymbolName(i, true).size())); FuzzyMatcher fuzzy(query); std::vector> permutation(result_indices.size()); for (int i = 0; i < int(result_indices.size()); i++) { permutation[i] = { - fuzzy.Match(db->GetSymbolDetailedName(result_indices[i])), i}; + fuzzy.Match(db->GetSymbolName(result_indices[i], true)), i}; } std::sort(permutation.begin(), permutation.end(), std::greater>()); diff --git a/src/query.cc b/src/query.cc index 389971b3..e504619b 100644 --- a/src/query.cc +++ b/src/query.cc @@ -35,6 +35,7 @@ std::optional ToQuery(const IdMap& id_map, QueryType::Def result; result.detailed_name = type.detailed_name; + result.qual_name_offset = type.qual_name_offset; result.short_name_offset = type.short_name_offset; result.short_name_size = type.short_name_size; result.kind = type.kind; @@ -60,6 +61,7 @@ std::optional ToQuery(const IdMap& id_map, QueryFunc::Def result; result.detailed_name = func.detailed_name; + result.qual_name_offset = func.qual_name_offset; result.short_name_offset = func.short_name_offset; result.short_name_size = func.short_name_size; result.kind = func.kind; @@ -84,6 +86,7 @@ std::optional ToQuery(const IdMap& id_map, const IndexVar::Def& v QueryVar::Def result; result.detailed_name = var.detailed_name; + result.qual_name_offset = var.qual_name_offset; result.short_name_offset = var.short_name_offset; result.short_name_size = var.short_name_size; if (!var.hover.empty()) @@ -900,8 +903,8 @@ void QueryDatabase::UpdateSymbols(Maybe>* symbol_idx, } } -// For Func, the returned name does not include parameters. -std::string_view QueryDatabase::GetSymbolDetailedName(RawId symbol_idx) const { +std::string_view QueryDatabase::GetSymbolName(RawId symbol_idx, + bool qualified) const { RawId idx = symbols[symbol_idx].id.id; switch (symbols[symbol_idx].kind) { default: @@ -912,40 +915,15 @@ std::string_view QueryDatabase::GetSymbolDetailedName(RawId symbol_idx) const { break; case SymbolKind::Func: if (const auto* def = funcs[idx].AnyDef()) - return def->DetailedName(false); + return def->Name(qualified); break; case SymbolKind::Type: if (const auto* def = types[idx].AnyDef()) - return def->detailed_name; + return def->Name(qualified); break; case SymbolKind::Var: if (const auto* def = vars[idx].AnyDef()) - return def->detailed_name; - break; - } - return ""; -} - -std::string_view QueryDatabase::GetSymbolShortName(RawId symbol_idx) const { - RawId idx = symbols[symbol_idx].id.id; - switch (symbols[symbol_idx].kind) { - default: - break; - case SymbolKind::File: - if (files[idx].def) - return files[idx].def->path; - break; - case SymbolKind::Func: - if (const auto* def = funcs[idx].AnyDef()) - return def->ShortName(); - break; - case SymbolKind::Type: - if (const auto* def = types[idx].AnyDef()) - return def->ShortName(); - break; - case SymbolKind::Var: - if (const auto* def = vars[idx].AnyDef()) - return def->ShortName(); + return def->Name(qualified); break; } return ""; diff --git a/src/query.h b/src/query.h index 0ff4f3ef..7a15c239 100644 --- a/src/query.h +++ b/src/query.h @@ -152,7 +152,7 @@ struct QueryEntity { const Def* AnyDef() const { return const_cast(this)->AnyDef(); } }; -struct QueryType : QueryEntity> { +struct QueryType : QueryEntity> { using DerivedUpdate = MergeableUpdate; using InstancesUpdate = MergeableUpdate; @@ -167,7 +167,7 @@ struct QueryType : QueryEntity> { explicit QueryType(const Usr& usr) : usr(usr) {} }; -struct QueryFunc : QueryEntity> { +struct QueryFunc : QueryEntity> { using DerivedUpdate = MergeableUpdate; Usr usr; @@ -180,7 +180,7 @@ struct QueryFunc : QueryEntity> { explicit QueryFunc(const Usr& usr) : usr(usr) {} }; -struct QueryVar : QueryEntity> { +struct QueryVar : QueryEntity> { Usr usr; Maybe> symbol_idx; std::forward_list def; @@ -288,8 +288,7 @@ struct QueryDatabase { void UpdateSymbols(Maybe>* symbol_idx, SymbolKind kind, Id idx); - std::string_view GetSymbolDetailedName(RawId symbol_idx) const; - std::string_view GetSymbolShortName(RawId symbol_idx) const; + std::string_view GetSymbolName(RawId symbol_idx, bool qualified) const; // Query the indexing structure to look up symbol id for given Usr. Maybe GetQueryFileIdFromPath(const std::string& path); diff --git a/src/query_utils.cc b/src/query_utils.cc index e30b6d43..a016fedc 100644 --- a/src/query_utils.cc +++ b/src/query_utils.cc @@ -302,7 +302,7 @@ std::optional GetSymbolInfo(QueryDatabase* db, lsSymbolInformation info; EachEntityDef(db, sym, [&](const auto& def) { if (use_short_name) - info.name = def.ShortName(); + info.name = def.Name(true); else info.name = def.detailed_name; info.kind = def.kind; diff --git a/src/serializer.cc b/src/serializer.cc index 3e8bd3b9..391a5999 100644 --- a/src/serializer.cc +++ b/src/serializer.cc @@ -210,6 +210,7 @@ void Reflect(TVisitor& visitor, IndexType& value) { REFLECT_MEMBER2("id", value.id); REFLECT_MEMBER2("usr", value.usr); REFLECT_MEMBER2("detailed_name", value.def.detailed_name); + REFLECT_MEMBER2("qual_name_offset", value.def.qual_name_offset); ReflectShortName(visitor, value.def); REFLECT_MEMBER2("kind", value.def.kind); ReflectHoverAndComments(visitor, value.def); @@ -233,6 +234,7 @@ void Reflect(TVisitor& visitor, IndexFunc& value) { REFLECT_MEMBER2("id", value.id); REFLECT_MEMBER2("usr", value.usr); REFLECT_MEMBER2("detailed_name", value.def.detailed_name); + REFLECT_MEMBER2("qual_name_offset", value.def.qual_name_offset); ReflectShortName(visitor, value.def); REFLECT_MEMBER2("kind", value.def.kind); REFLECT_MEMBER2("storage", value.def.storage); @@ -255,6 +257,7 @@ void Reflect(TVisitor& visitor, IndexVar& value) { REFLECT_MEMBER2("id", value.id); REFLECT_MEMBER2("usr", value.usr); REFLECT_MEMBER2("detailed_name", value.def.detailed_name); + REFLECT_MEMBER2("qual_name_offset", value.def.qual_name_offset); ReflectShortName(visitor, value.def); ReflectHoverAndComments(visitor, value.def); REFLECT_MEMBER2("declarations", value.declarations); diff --git a/src/test.cc b/src/test.cc index 2453ed03..f94e447e 100644 --- a/src/test.cc +++ b/src/test.cc @@ -89,8 +89,10 @@ void ParseTestExpectation( active_output_contents = ""; in_output = true; - } else if (in_output) + } else if (in_output) { active_output_contents += line_with_ending; + active_output_contents.push_back('\n'); + } } if (in_output) diff --git a/src/type_printer.cc b/src/type_printer.cc index 4557dada..06346d47 100644 --- a/src/type_printer.cc +++ b/src/type_printer.cc @@ -34,11 +34,14 @@ int GetNameInsertingPosition(const std::string& type_desc, } // namespace // Build a detailed function signature, including argument names. -std::string GetFunctionSignature(IndexFile* db, - NamespaceHelper* ns, - const CXIdxDeclInfo* decl) { +std::tuple GetFunctionSignature( + IndexFile* db, + NamespaceHelper* ns, + const CXIdxDeclInfo* decl) { int num_args = clang_Cursor_getNumArguments(decl->cursor); - std::pair function_name = + int16_t qual_name_offset, short_name_offset, short_name_size; + std::string func_name; + std::tie(func_name, short_name_offset, short_name_size) = ns->QualifiedName(decl->semanticContainer, decl->entityInfo->name); std::vector> args; @@ -52,15 +55,15 @@ std::string GetFunctionSignature(IndexFile* db, } std::string type_desc = ClangCursor(decl->cursor).get_type_description(); - int function_name_offset = GetNameInsertingPosition( + qual_name_offset = GetNameInsertingPosition( type_desc, ::ToString(clang_getTypeSpelling( clang_getCursorResultType(decl->cursor)))); - if (type_desc[function_name_offset] == '(') { + if (type_desc[qual_name_offset] == '(') { // Find positions to insert argument names. // Argument name are before ',' or closing ')'. num_args = 0; - for (int balance = 0, i = function_name_offset; + for (int balance = 0, i = qual_name_offset; i < int(type_desc.size()) && num_args < int(args.size()); i++) { if (type_desc[i] == '(' || type_desc[i] == '[') balance++; @@ -74,9 +77,10 @@ std::string GetFunctionSignature(IndexFile* db, } // Second pass: insert argument names before each comma and closing paren. - int i = function_name_offset; + int i = qual_name_offset; + short_name_offset += qual_name_offset; std::string type_desc_with_names(type_desc.begin(), type_desc.begin() + i); - type_desc_with_names.append(function_name.first); + type_desc_with_names.append(func_name); for (auto& arg : args) { if (arg.first < 0) { LOG_S(ERROR) @@ -98,9 +102,12 @@ std::string GetFunctionSignature(IndexFile* db, type_desc = std::move(type_desc_with_names); } else { // type_desc is either a typedef, or some complicated type we cannot handle. - // Append the function_name in this case. - ConcatTypeAndName(type_desc, function_name.first); + // Append the func_name in this case. + int offset = type_desc.size(); + offset += ConcatTypeAndName(type_desc, func_name); + qual_name_offset = offset; + short_name_offset += offset; } - return type_desc; + return {type_desc, qual_name_offset, short_name_offset, short_name_size}; } diff --git a/src/type_printer.h b/src/type_printer.h index 2e724c69..87b39ca5 100644 --- a/src/type_printer.h +++ b/src/type_printer.h @@ -2,6 +2,7 @@ #include "indexer.h" -std::string GetFunctionSignature(IndexFile* db, - NamespaceHelper* ns, - const CXIdxDeclInfo* decl); +std::tuple GetFunctionSignature( + IndexFile* db, + NamespaceHelper* ns, + const CXIdxDeclInfo* decl);