diff --git a/index_tests/constructors/constructor.cc b/index_tests/constructors/constructor.cc index aa79e7a35..fe0bc3b15 100644 --- a/index_tests/constructors/constructor.cc +++ b/index_tests/constructors/constructor.cc @@ -43,7 +43,7 @@ void foo() { "base": [], "derived": [], "locals": [], - "uses": ["7:7-7:8|1|3|72", "8:17-8:20|1|3|64"], + "uses": ["7:7-7:8|1|3|288", "8:17-8:20|1|3|32"], "callees": [] }, { "id": 1, @@ -59,7 +59,7 @@ void foo() { "derived": [], "locals": [], "uses": [], - "callees": ["7:7-7:8|0|3|72", "7:7-7:8|0|3|72", "8:17-8:20|0|3|64", "8:17-8:20|0|3|64"] + "callees": ["7:7-7:8|0|3|288", "7:7-7:8|0|3|288", "8:17-8:20|0|3|32", "8:17-8:20|0|3|32"] }], "vars": [{ "id": 0, diff --git a/index_tests/constructors/destructor.cc b/index_tests/constructors/destructor.cc index 66f83e62a..a28a33c48 100644 --- a/index_tests/constructors/destructor.cc +++ b/index_tests/constructors/destructor.cc @@ -48,7 +48,7 @@ void foo() { "base": [], "derived": [], "locals": [], - "uses": ["8:7-8:8|2|3|72"], + "uses": ["8:7-8:8|2|3|288"], "callees": [] }, { "id": 1, @@ -80,7 +80,7 @@ void foo() { "derived": [], "locals": [], "uses": [], - "callees": ["8:7-8:8|0|3|72", "8:7-8:8|0|3|72"] + "callees": ["8:7-8:8|0|3|288", "8:7-8:8|0|3|288"] }], "vars": [{ "id": 0, diff --git a/index_tests/constructors/implicit_constructor.cc b/index_tests/constructors/implicit_constructor.cc index a8b9889a9..84c236f7a 100644 --- a/index_tests/constructors/implicit_constructor.cc +++ b/index_tests/constructors/implicit_constructor.cc @@ -42,7 +42,7 @@ void Make() { "base": [], "derived": [], "locals": [], - "uses": ["6:8-6:12|1|3|72", "7:15-7:19|1|3|64"], + "uses": ["6:8-6:12|1|3|288", "7:15-7:19|1|3|32"], "callees": [] }, { "id": 1, @@ -58,7 +58,7 @@ void Make() { "derived": [], "locals": [], "uses": [], - "callees": ["6:8-6:12|0|3|72", "6:8-6:12|0|3|72", "7:15-7:19|0|3|64", "7:15-7:19|0|3|64"] + "callees": ["6:8-6:12|0|3|288", "6:8-6:12|0|3|288", "7:15-7:19|0|3|32", "7:15-7:19|0|3|32"] }], "vars": [{ "id": 0, diff --git a/index_tests/constructors/make_functions.cc b/index_tests/constructors/make_functions.cc index 52a4cc21d..99c4a4d92 100644 --- a/index_tests/constructors/make_functions.cc +++ b/index_tests/constructors/make_functions.cc @@ -233,7 +233,7 @@ OUTPUT: make_functions.cc "base": [], "derived": [], "locals": [], - "uses": ["14:3-14:13|2|3|64", "15:3-15:13|2|3|64", "16:3-16:13|2|3|64"], + "uses": ["14:3-14:13|2|3|32", "15:3-15:13|2|3|32", "16:3-16:13|2|3|32"], "callees": [] }, { "id": 1, @@ -248,7 +248,7 @@ OUTPUT: make_functions.cc "base": [], "derived": [], "locals": [], - "uses": ["17:3-17:14|2|3|64"], + "uses": ["17:3-17:14|2|3|32"], "callees": [] }, { "id": 2, @@ -264,7 +264,7 @@ OUTPUT: make_functions.cc "derived": [], "locals": [], "uses": [], - "callees": ["14:3-14:13|0|3|64", "15:3-15:13|0|3|64", "16:3-16:13|0|3|64", "17:3-17:14|1|3|64"] + "callees": ["14:3-14:13|0|3|32", "15:3-15:13|0|3|32", "16:3-16:13|0|3|32", "17:3-17:14|1|3|32"] }, { "id": 3, "usr": 13131778807733950299, @@ -276,7 +276,7 @@ OUTPUT: make_functions.cc "base": [], "derived": [], "locals": [], - "uses": ["14:3-14:13|-1|1|72"], + "uses": ["14:3-14:13|-1|1|288"], "callees": [] }, { "id": 4, @@ -289,7 +289,7 @@ OUTPUT: make_functions.cc "base": [], "derived": [], "locals": [], - "uses": ["15:3-15:13|-1|1|72"], + "uses": ["15:3-15:13|-1|1|288"], "callees": [] }, { "id": 5, @@ -302,7 +302,7 @@ OUTPUT: make_functions.cc "base": [], "derived": [], "locals": [], - "uses": ["16:3-16:13|-1|1|72"], + "uses": ["16:3-16:13|-1|1|288"], "callees": [] }, { "id": 6, @@ -315,7 +315,7 @@ OUTPUT: make_functions.cc "base": [], "derived": [], "locals": [], - "uses": ["17:3-17:14|-1|1|72"], + "uses": ["17:3-17:14|-1|1|288"], "callees": [] }], "vars": [{ diff --git a/index_tests/lambdas/lambda.cc b/index_tests/lambdas/lambda.cc index 41523796b..9e30b36e8 100644 --- a/index_tests/lambdas/lambda.cc +++ b/index_tests/lambdas/lambda.cc @@ -57,7 +57,7 @@ void foo() { "derived": [], "locals": [], "uses": [], - "callees": ["9:14-9:15|1|3|64", "10:14-10:15|1|3|64", "11:14-11:15|1|3|64"] + "callees": ["9:14-9:15|1|3|32", "10:14-10:15|1|3|32", "11:14-11:15|1|3|32"] }, { "id": 1, "usr": 1328781044864682611, @@ -69,7 +69,7 @@ void foo() { "base": [], "derived": [], "locals": [], - "uses": ["9:14-9:15|0|3|64", "10:14-10:15|0|3|64", "11:14-11:15|0|3|64"], + "uses": ["9:14-9:15|0|3|32", "10:14-10:15|0|3|32", "11:14-11:15|0|3|32"], "callees": [] }], "vars": [{ diff --git a/index_tests/macros/complex.cc b/index_tests/macros/complex.cc index ebf434734..493f7aa96 100644 --- a/index_tests/macros/complex.cc +++ b/index_tests/macros/complex.cc @@ -43,7 +43,7 @@ FOO(make1(), make2); "base": [], "derived": [], "locals": [], - "uses": ["12:5-12:10|1|3|64"], + "uses": ["12:5-12:10|1|3|32"], "callees": [] }, { "id": 1, @@ -64,7 +64,7 @@ FOO(make1(), make2); "derived": [], "locals": [], "uses": [], - "callees": ["12:5-12:10|0|3|64"] + "callees": ["12:5-12:10|0|3|32"] }], "vars": [{ "id": 0, diff --git a/index_tests/multi_file/impl.cc b/index_tests/multi_file/impl.cc index 647414ac6..f0d27151b 100644 --- a/index_tests/multi_file/impl.cc +++ b/index_tests/multi_file/impl.cc @@ -203,7 +203,7 @@ OUTPUT: impl.cc "derived": [], "locals": [], "uses": [], - "callees": ["4:3-4:7|1|3|64"] + "callees": ["4:3-4:7|1|3|32"] }, { "id": 1, "usr": 11650481237659640387, @@ -215,7 +215,7 @@ OUTPUT: impl.cc "base": [], "derived": [], "locals": [], - "uses": ["4:3-4:7|0|3|64"], + "uses": ["4:3-4:7|0|3|32"], "callees": [] }], "vars": [] diff --git a/index_tests/multi_file/simple_impl.cc b/index_tests/multi_file/simple_impl.cc index a2fb851c0..8d831d7f7 100644 --- a/index_tests/multi_file/simple_impl.cc +++ b/index_tests/multi_file/simple_impl.cc @@ -53,7 +53,7 @@ OUTPUT: simple_impl.cc "derived": [], "locals": [], "uses": [], - "callees": ["4:3-4:9|1|3|64"] + "callees": ["4:3-4:9|1|3|32"] }, { "id": 1, "usr": 16236105532929924676, @@ -65,7 +65,7 @@ OUTPUT: simple_impl.cc "base": [], "derived": [], "locals": [], - "uses": ["4:3-4:9|0|3|64"], + "uses": ["4:3-4:9|0|3|32"], "callees": [] }], "vars": [] diff --git a/index_tests/namespaces/namespace_reference.cc b/index_tests/namespaces/namespace_reference.cc index 6ce860f15..5d2194171 100644 --- a/index_tests/namespaces/namespace_reference.cc +++ b/index_tests/namespaces/namespace_reference.cc @@ -70,7 +70,7 @@ void Runner() { "base": [], "derived": [], "locals": [], - "uses": ["7:7-7:13|1|3|64", "9:3-9:9|1|3|64"], + "uses": ["7:7-7:13|1|3|32", "9:3-9:9|1|3|32"], "callees": [] }, { "id": 1, @@ -86,7 +86,7 @@ void Runner() { "derived": [], "locals": [], "uses": [], - "callees": ["7:7-7:13|0|3|64", "9:3-9:9|0|3|64"] + "callees": ["7:7-7:13|0|3|32", "9:3-9:9|0|3|32"] }], "vars": [{ "id": 0, diff --git a/index_tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc b/index_tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc index 4ea8ca9a8..f2fb8c80d 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 @@ -87,7 +87,7 @@ namespace ns { "base": [], "derived": [], "locals": [], - "uses": ["10:21-10:24|0|2|64", "11:22-11:25|0|2|64"], + "uses": ["10:21-10:24|0|2|32", "11:22-11:25|0|2|32"], "callees": [] }], "vars": [{ 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 21809239c..a415c7cca 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 @@ -56,7 +56,7 @@ int b = Foo::foo(); "base": [], "derived": [], "locals": [], - "uses": ["8:19-8:22|-1|1|64", "9:20-9:23|-1|1|64"], + "uses": ["8:19-8:22|-1|1|32", "9:20-9:23|-1|1|32"], "callees": [] }], "vars": [{ 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 602e44a42..b848c07c6 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 @@ -57,7 +57,7 @@ int b = Foo::foo(); "base": [], "derived": [], "locals": [], - "uses": ["9:19-9:22|-1|1|64", "10:20-10:23|-1|1|64"], + "uses": ["9:19-9:22|-1|1|32", "10:20-10:23|-1|1|32"], "callees": [] }], "vars": [{ 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 c8055cfa1..9dea093b3 100644 --- a/index_tests/templates/template_func_usage_folded_into_one.cc +++ b/index_tests/templates/template_func_usage_folded_into_one.cc @@ -41,7 +41,7 @@ int b = foo(); "base": [], "derived": [], "locals": [], - "uses": ["6:9-6:12|-1|1|64", "7:9-7:12|-1|1|64"], + "uses": ["6:9-6:12|-1|1|32", "7:9-7:12|-1|1|32"], "callees": [] }], "vars": [{ diff --git a/index_tests/usage/func_called_from_constructor.cc b/index_tests/usage/func_called_from_constructor.cc index 19f434957..f52ba0f22 100644 --- a/index_tests/usage/func_called_from_constructor.cc +++ b/index_tests/usage/func_called_from_constructor.cc @@ -42,7 +42,7 @@ Foo::Foo() { "base": [], "derived": [], "locals": [], - "uses": ["8:3-8:9|1|3|64"], + "uses": ["8:3-8:9|1|3|32"], "callees": [] }, { "id": 1, @@ -64,7 +64,7 @@ Foo::Foo() { "derived": [], "locals": [], "uses": [], - "callees": ["8:3-8:9|0|3|64"] + "callees": ["8:3-8:9|0|3|32"] }], "vars": [] } diff --git a/index_tests/usage/func_called_from_macro_argument.cc b/index_tests/usage/func_called_from_macro_argument.cc index 68a0d52e6..323478522 100644 --- a/index_tests/usage/func_called_from_macro_argument.cc +++ b/index_tests/usage/func_called_from_macro_argument.cc @@ -28,7 +28,7 @@ void caller() { "base": [], "derived": [], "locals": [], - "uses": ["6:14-6:20|1|3|64"], + "uses": ["6:14-6:20|1|3|32"], "callees": [] }, { "id": 1, @@ -44,7 +44,7 @@ void caller() { "derived": [], "locals": [], "uses": [], - "callees": ["6:14-6:20|0|3|64"] + "callees": ["6:14-6:20|0|3|32"] }], "vars": [{ "id": 0, diff --git a/index_tests/usage/func_called_from_template.cc b/index_tests/usage/func_called_from_template.cc index aca906356..bc8a75ca2 100644 --- a/index_tests/usage/func_called_from_template.cc +++ b/index_tests/usage/func_called_from_template.cc @@ -33,7 +33,7 @@ void foo() { "base": [], "derived": [], "locals": [], - "uses": ["5:3-5:9|1|3|64"], + "uses": ["5:3-5:9|1|3|32"], "callees": [] }, { "id": 1, @@ -48,8 +48,8 @@ void foo() { "base": [], "derived": [], "locals": [], - "uses": ["9:3-9:9|2|3|64"], - "callees": ["5:3-5:9|0|3|64"] + "uses": ["9:3-9:9|2|3|32"], + "callees": ["5:3-5:9|0|3|32"] }, { "id": 2, "usr": 4259594751088586730, @@ -64,7 +64,7 @@ void foo() { "derived": [], "locals": [], "uses": [], - "callees": ["9:3-9:9|1|3|64"] + "callees": ["9:3-9:9|1|3|32"] }], "vars": [] } diff --git a/index_tests/usage/func_called_implicit_ctor.cc b/index_tests/usage/func_called_implicit_ctor.cc index 1ea93d38f..089a4d03f 100644 --- a/index_tests/usage/func_called_implicit_ctor.cc +++ b/index_tests/usage/func_called_implicit_ctor.cc @@ -46,7 +46,7 @@ Wrapper caller() { "base": [], "derived": [], "locals": [], - "uses": ["8:10-8:18|2|3|72"], + "uses": ["8:10-8:18|2|3|288"], "callees": [] }, { "id": 1, @@ -61,7 +61,7 @@ Wrapper caller() { "base": [], "derived": [], "locals": [], - "uses": ["8:10-8:16|2|3|64"], + "uses": ["8:10-8:16|2|3|32"], "callees": [] }, { "id": 2, @@ -77,7 +77,7 @@ Wrapper caller() { "derived": [], "locals": [], "uses": [], - "callees": ["8:10-8:18|0|3|72", "8:10-8:16|1|3|64"] + "callees": ["8:10-8:18|0|3|288", "8:10-8:16|1|3|32"] }], "vars": [] } diff --git a/index_tests/usage/func_usage_addr_func.cc b/index_tests/usage/func_usage_addr_func.cc index 0c6c7d8d3..a0a52344a 100644 --- a/index_tests/usage/func_usage_addr_func.cc +++ b/index_tests/usage/func_usage_addr_func.cc @@ -26,7 +26,7 @@ void user() { "base": [], "derived": [], "locals": [], - "uses": ["7:3-7:10|2|3|64"], + "uses": ["7:3-7:10|2|3|32"], "callees": [] }, { "id": 1, @@ -41,7 +41,7 @@ void user() { "base": [], "derived": [], "locals": [], - "uses": ["6:18-6:22|2|3|64", "7:12-7:16|2|3|64"], + "uses": ["6:18-6:22|2|3|32", "7:12-7:16|2|3|32"], "callees": [] }, { "id": 2, @@ -57,7 +57,7 @@ void user() { "derived": [], "locals": [], "uses": [], - "callees": ["6:18-6:22|1|3|64", "6:18-6:22|1|3|64", "7:3-7:10|0|3|64", "7:12-7:16|1|3|64"] + "callees": ["6:18-6:22|1|3|32", "6:18-6:22|1|3|32", "7:3-7:10|0|3|32", "7:12-7:16|1|3|32"] }], "vars": [{ "id": 0, diff --git a/index_tests/usage/func_usage_addr_method.cc b/index_tests/usage/func_usage_addr_method.cc index a52de0328..d278031b1 100644 --- a/index_tests/usage/func_usage_addr_method.cc +++ b/index_tests/usage/func_usage_addr_method.cc @@ -45,7 +45,7 @@ void user() { "base": [], "derived": [], "locals": [], - "uses": ["6:18-6:22|1|3|64"], + "uses": ["6:18-6:22|1|3|32"], "callees": [] }, { "id": 1, @@ -61,7 +61,7 @@ void user() { "derived": [], "locals": [], "uses": [], - "callees": ["6:18-6:22|0|3|64", "6:18-6:22|0|3|64"] + "callees": ["6:18-6:22|0|3|32", "6:18-6:22|0|3|32"] }], "vars": [{ "id": 0, diff --git a/index_tests/usage/func_usage_call_func.cc b/index_tests/usage/func_usage_call_func.cc index 15ea59e29..7d3a211a3 100644 --- a/index_tests/usage/func_usage_call_func.cc +++ b/index_tests/usage/func_usage_call_func.cc @@ -22,7 +22,7 @@ void caller() { "base": [], "derived": [], "locals": [], - "uses": ["3:3-3:9|1|3|64"], + "uses": ["3:3-3:9|1|3|32"], "callees": [] }, { "id": 1, @@ -38,7 +38,7 @@ void caller() { "derived": [], "locals": [], "uses": [], - "callees": ["3:3-3:9|0|3|64"] + "callees": ["3:3-3:9|0|3|32"] }], "vars": [] } diff --git a/index_tests/usage/func_usage_call_method.cc b/index_tests/usage/func_usage_call_method.cc index a4dac157e..ae3acde80 100644 --- a/index_tests/usage/func_usage_call_method.cc +++ b/index_tests/usage/func_usage_call_method.cc @@ -45,7 +45,7 @@ void user() { "base": [], "derived": [], "locals": [], - "uses": ["7:6-7:10|1|3|64"], + "uses": ["7:6-7:10|1|3|32"], "callees": [] }, { "id": 1, @@ -61,7 +61,7 @@ void user() { "derived": [], "locals": [], "uses": [], - "callees": ["7:6-7:10|0|3|64"] + "callees": ["7:6-7:10|0|3|32"] }], "vars": [{ "id": 0, diff --git a/index_tests/usage/func_usage_class_inline_var_def.cc b/index_tests/usage/func_usage_class_inline_var_def.cc index 9bc5d980c..49471b9cb 100644 --- a/index_tests/usage/func_usage_class_inline_var_def.cc +++ b/index_tests/usage/func_usage_class_inline_var_def.cc @@ -53,7 +53,7 @@ class Foo { "base": [], "derived": [], "locals": [], - "uses": ["6:11-6:17|0|2|64"], + "uses": ["6:11-6:17|0|2|32"], "callees": [] }], "vars": [{ diff --git a/index_tests/usage/func_usage_forward_decl_func.cc b/index_tests/usage/func_usage_forward_decl_func.cc index d6b2cccce..3d1c1e8e9 100644 --- a/index_tests/usage/func_usage_forward_decl_func.cc +++ b/index_tests/usage/func_usage_forward_decl_func.cc @@ -25,7 +25,7 @@ void usage() { "base": [], "derived": [], "locals": [], - "uses": ["4:3-4:6|1|3|64"], + "uses": ["4:3-4:6|1|3|32"], "callees": [] }, { "id": 1, @@ -41,7 +41,7 @@ void usage() { "derived": [], "locals": [], "uses": [], - "callees": ["4:3-4:6|0|3|64"] + "callees": ["4:3-4:6|0|3|32"] }], "vars": [] } diff --git a/index_tests/usage/func_usage_forward_decl_method.cc b/index_tests/usage/func_usage_forward_decl_method.cc index 638802bc2..165eb82dc 100644 --- a/index_tests/usage/func_usage_forward_decl_method.cc +++ b/index_tests/usage/func_usage_forward_decl_method.cc @@ -44,7 +44,7 @@ void usage() { "base": [], "derived": [], "locals": [], - "uses": ["7:6-7:9|1|3|64"], + "uses": ["7:6-7:9|1|3|32"], "callees": [] }, { "id": 1, @@ -60,7 +60,7 @@ void usage() { "derived": [], "locals": [], "uses": [], - "callees": ["7:6-7:9|0|3|64"] + "callees": ["7:6-7:9|0|3|32"] }], "vars": [{ "id": 0, diff --git a/index_tests/usage/func_usage_template_func.cc b/index_tests/usage/func_usage_template_func.cc index 3f0e3a30b..9b631a994 100644 --- a/index_tests/usage/func_usage_template_func.cc +++ b/index_tests/usage/func_usage_template_func.cc @@ -43,7 +43,7 @@ void foo() { "base": [], "derived": [], "locals": [], - "uses": ["5:3-5:9|1|3|64", "6:3-6:9|1|3|64"], + "uses": ["5:3-5:9|1|3|32", "6:3-6:9|1|3|32"], "callees": [] }, { "id": 1, @@ -59,7 +59,7 @@ void foo() { "derived": [], "locals": [], "uses": [], - "callees": ["5:3-5:9|0|3|64", "6:3-6:9|0|3|64"] + "callees": ["5:3-5:9|0|3|32", "6:3-6:9|0|3|32"] }], "vars": [] } diff --git a/index_tests/usage/usage_inside_of_call.cc b/index_tests/usage/usage_inside_of_call.cc index f7c207c9a..29416fb8c 100644 --- a/index_tests/usage/usage_inside_of_call.cc +++ b/index_tests/usage/usage_inside_of_call.cc @@ -64,7 +64,7 @@ void foo() { "base": [], "derived": [], "locals": [], - "uses": ["14:3-14:9|2|3|64"], + "uses": ["14:3-14:9|2|3|32"], "callees": [] }, { "id": 1, @@ -82,7 +82,7 @@ void foo() { "base": [], "derived": [], "locals": [], - "uses": ["14:14-14:17|2|3|64"], + "uses": ["14:14-14:17|2|3|32"], "callees": [] }, { "id": 2, @@ -98,7 +98,7 @@ void foo() { "derived": [], "locals": [], "uses": [], - "callees": ["14:3-14:9|0|3|64", "14:14-14:17|1|3|64"] + "callees": ["14:3-14:9|0|3|32", "14:14-14:17|1|3|32"] }], "vars": [{ "id": 0, diff --git a/index_tests/usage/usage_inside_of_call_simple.cc b/index_tests/usage/usage_inside_of_call_simple.cc index bb40ca2b3..7a5a29dcb 100644 --- a/index_tests/usage/usage_inside_of_call_simple.cc +++ b/index_tests/usage/usage_inside_of_call_simple.cc @@ -28,7 +28,7 @@ void foo() { "base": [], "derived": [], "locals": [], - "uses": ["6:3-6:9|2|3|64"], + "uses": ["6:3-6:9|2|3|32"], "callees": [] }, { "id": 1, @@ -43,7 +43,7 @@ void foo() { "base": [], "derived": [], "locals": [], - "uses": ["6:10-6:13|2|3|64", "6:18-6:21|2|3|64"], + "uses": ["6:10-6:13|2|3|32", "6:18-6:21|2|3|32"], "callees": [] }, { "id": 2, @@ -59,7 +59,7 @@ void foo() { "derived": [], "locals": [], "uses": [], - "callees": ["6:3-6:9|0|3|64", "6:10-6:13|1|3|64", "6:18-6:21|1|3|64"] + "callees": ["6:3-6:9|0|3|32", "6:10-6:13|1|3|32", "6:18-6:21|1|3|32"] }], "vars": [] } diff --git a/index_tests/usage/var_usage_call_function.cc b/index_tests/usage/var_usage_call_function.cc index 825255d04..29de60edd 100644 --- a/index_tests/usage/var_usage_call_function.cc +++ b/index_tests/usage/var_usage_call_function.cc @@ -26,7 +26,7 @@ void caller() { "base": [], "derived": [], "locals": [], - "uses": ["4:13-4:19|1|3|64", "7:3-7:9|1|3|64"], + "uses": ["4:13-4:19|1|3|32", "7:3-7:9|1|3|32"], "callees": [] }, { "id": 1, @@ -42,7 +42,7 @@ void caller() { "derived": [], "locals": [], "uses": [], - "callees": ["4:13-4:19|0|3|64", "4:13-4:19|0|3|64", "7:3-7:9|0|3|64"] + "callees": ["4:13-4:19|0|3|32", "4:13-4:19|0|3|32", "7:3-7:9|0|3|32"] }], "vars": [{ "id": 0, diff --git a/index_tests/usage/var_usage_class_member.cc b/index_tests/usage/var_usage_class_member.cc index 47f1eeaa1..bc064b953 100644 --- a/index_tests/usage/var_usage_class_member.cc +++ b/index_tests/usage/var_usage_class_member.cc @@ -67,7 +67,7 @@ void foo() { "base": [], "derived": [], "locals": [], - "uses": ["14:3-14:9|2|3|64", "15:3-15:9|2|3|64", "17:3-17:9|2|3|64"], + "uses": ["14:3-14:9|2|3|32", "15:3-15:9|2|3|32", "17:3-17:9|2|3|32"], "callees": [] }, { "id": 1, @@ -85,7 +85,7 @@ void foo() { "base": [], "derived": [], "locals": [], - "uses": ["16:3-16:9|2|3|64"], + "uses": ["16:3-16:9|2|3|32"], "callees": [] }, { "id": 2, @@ -101,7 +101,7 @@ void foo() { "derived": [], "locals": [], "uses": [], - "callees": ["14:3-14:9|0|3|64", "15:3-15:9|0|3|64", "16:3-16:9|1|3|64", "17:3-17:9|0|3|64"] + "callees": ["14:3-14:9|0|3|32", "15:3-15:9|0|3|32", "16:3-16:9|1|3|32", "17:3-17:9|0|3|32"] }], "vars": [{ "id": 0, diff --git a/index_tests/usage/var_usage_class_member_static.cc b/index_tests/usage/var_usage_class_member_static.cc index 5051f5976..3cf92e979 100644 --- a/index_tests/usage/var_usage_class_member_static.cc +++ b/index_tests/usage/var_usage_class_member_static.cc @@ -58,7 +58,7 @@ void foo() { "base": [], "derived": [], "locals": [], - "uses": ["8:3-8:9|1|3|64"], + "uses": ["8:3-8:9|1|3|32"], "callees": [] }, { "id": 1, @@ -74,7 +74,7 @@ void foo() { "derived": [], "locals": [], "uses": [], - "callees": ["8:3-8:9|0|3|64"] + "callees": ["8:3-8:9|0|3|32"] }], "vars": [{ "id": 0, diff --git a/src/indexer.h b/src/indexer.h index 81aca123c..e7c588cdc 100644 --- a/src/indexer.h +++ b/src/indexer.h @@ -2,7 +2,6 @@ #include "clang_cursor.h" #include "clang_index.h" -#include "clang_symbol_kind.h" #include "clang_translation_unit.h" #include "clang_utils.h" #include "file_consumer.h" @@ -13,6 +12,7 @@ #include "performance.h" #include "position.h" #include "serializer.h" +#include "symbol.h" #include "utils.h" #include @@ -33,12 +33,6 @@ struct IndexType; struct IndexFunc; struct IndexVar; -// The order matters. In FindSymbolsAtLocation, we want Var/Func ordered in -// front of others. -enum class SymbolKind : uint8_t { Invalid, File, Type, Func, Var }; -MAKE_REFLECT_TYPE_PROXY(SymbolKind); -MAKE_ENUM_HASHABLE(SymbolKind); - using RawId = uint32_t; template diff --git a/src/language_server_api.cc b/src/language_server_api.cc index 88215d6f2..0f4898c57 100644 --- a/src/language_server_api.cc +++ b/src/language_server_api.cc @@ -285,16 +285,25 @@ const lsPosition lsPosition::kZeroPosition = lsPosition(); lsRange::lsRange() {} lsRange::lsRange(lsPosition start, lsPosition end) : start(start), end(end) {} -bool lsRange::operator==(const lsRange& other) const { - return start == other.start && end == other.end; +bool lsRange::operator==(const lsRange& o) const { + return start == o.start && end == o.end; +} + +bool lsRange::operator<(const lsRange& o) const { + return !(start == o.start) ? start < o.start : end < o.end; } lsLocation::lsLocation() {} lsLocation::lsLocation(lsDocumentUri uri, lsRange range) : uri(uri), range(range) {} -bool lsLocation::operator==(const lsLocation& other) const { - return uri == other.uri && range == other.range; +bool lsLocation::operator==(const lsLocation& o) const { + return uri == o.uri && range == o.range; +} + +bool lsLocation::operator<(const lsLocation& o) const { + return std::make_tuple(uri.raw_uri, range) < + std::make_tuple(o.uri.raw_uri, o.range); } bool lsTextEdit::operator==(const lsTextEdit& that) { diff --git a/src/language_server_api.h b/src/language_server_api.h index bb730b1f0..ed98142c1 100644 --- a/src/language_server_api.h +++ b/src/language_server_api.h @@ -159,6 +159,7 @@ struct lsRange { lsRange(lsPosition start, lsPosition end); bool operator==(const lsRange& other) const; + bool operator<(const lsRange& other) const; lsPosition start; lsPosition end; @@ -171,6 +172,7 @@ struct lsLocation { lsLocation(lsDocumentUri uri, lsRange range); bool operator==(const lsLocation& other) const; + bool operator<(const lsLocation& o) const; lsDocumentUri uri; lsRange range; @@ -184,36 +186,6 @@ struct lsLocationEx : lsLocation { }; MAKE_REFLECT_STRUCT(lsLocationEx, uri, range, containerName); -enum class lsSymbolKind : int { - File = 1, - Module = 2, - Namespace = 3, - Package = 4, - Class = 5, - Method = 6, - Property = 7, - Field = 8, - Constructor = 9, - Enum = 10, - Interface = 11, - Function = 12, - Variable = 13, - Constant = 14, - String = 15, - Number = 16, - Boolean = 17, - Array = 18 -}; -MAKE_REFLECT_TYPE_PROXY(lsSymbolKind); - -struct lsSymbolInformation { - std::string_view name; - lsSymbolKind kind; - lsLocation location; - std::string_view containerName; -}; -MAKE_REFLECT_STRUCT(lsSymbolInformation, name, kind, location, containerName); - template struct lsCommand { // Title of the command (ie, 'save') @@ -456,17 +428,6 @@ struct lsWorkspaceEdit { }; MAKE_REFLECT_STRUCT(lsWorkspaceEdit, documentChanges); -// A document highlight kind. -enum class lsDocumentHighlightKind { - // A textual occurrence. - Text = 1, - // Read-access of a symbol, like reading a variable. - Read = 2, - // Write-access of a symbol, like writing to a variable. - Write = 3 -}; -MAKE_REFLECT_TYPE_PROXY(lsDocumentHighlightKind); - struct lsFormattingOptions { // Size of a tab in spaces. int tabSize; @@ -475,18 +436,6 @@ struct lsFormattingOptions { }; MAKE_REFLECT_STRUCT(lsFormattingOptions, tabSize, insertSpaces); -// A document highlight is a range inside a text document which deserves -// special attention. Usually a document highlight is visualized by changing -// the background color of its range. -struct lsDocumentHighlight { - // The range this highlight applies to. - lsRange range; - - // The highlight kind, default is DocumentHighlightKind.Text. - lsDocumentHighlightKind kind = lsDocumentHighlightKind::Text; -}; -MAKE_REFLECT_STRUCT(lsDocumentHighlight, range, kind); - enum class lsDiagnosticSeverity { // Reports an error. Error = 1, diff --git a/src/messages/text_document_highlight.cc b/src/messages/text_document_document_highlight.cc similarity index 86% rename from src/messages/text_document_highlight.cc rename to src/messages/text_document_document_highlight.cc index 5babbc209..2450acabb 100644 --- a/src/messages/text_document_highlight.cc +++ b/src/messages/text_document_document_highlight.cc @@ -1,6 +1,7 @@ #include "message_handler.h" #include "query_utils.h" #include "queue_manager.h" +#include "symbol.h" namespace { struct Ipc_TextDocumentDocumentHighlight @@ -50,8 +51,14 @@ struct TextDocumentDocumentHighlightHandler continue; lsDocumentHighlight highlight; - highlight.kind = lsDocumentHighlightKind::Text; highlight.range = ls_location->range; + if (use.role & Role::Write) + highlight.kind = lsDocumentHighlightKind::Write; + else if (use.role & Role::Read) + highlight.kind = lsDocumentHighlightKind::Read; + else + highlight.kind = lsDocumentHighlightKind::Text; + highlight.role = use.role; out.result.push_back(highlight); } break; diff --git a/src/query_utils.cc b/src/query_utils.cc index 2888bd457..441552413 100644 --- a/src/query_utils.cc +++ b/src/query_utils.cc @@ -426,19 +426,16 @@ std::vector GetLsLocations( QueryDatabase* db, WorkingFiles* working_files, const std::vector& uses) { - std::unordered_set unique_locations; + std::vector ret; for (Use use : uses) { optional location = GetLsLocation(db, working_files, use); - if (!location) - continue; - unique_locations.insert(*location); + if (location) + ret.push_back(*location); } - - std::vector result; - result.reserve(unique_locations.size()); - result.assign(unique_locations.begin(), unique_locations.end()); - return result; + std::sort(ret.begin(), ret.end()); + ret.erase(std::unique(ret.begin(), ret.end()), ret.end()); + return ret; } // Returns a symbol. The symbol will have *NOT* have a location assigned. @@ -491,14 +488,15 @@ optional GetSymbolInfo(QueryDatabase* db, else info.name = func.def->detailed_name; info.containerName = func.def->detailed_name; - info.kind = lsSymbolKind::Function; - - if (func.def->declaring_type) { - QueryType& container = db->types[func.def->declaring_type->id]; - if (container.def) + switch (func.def->kind) { + default: + info.kind = lsSymbolKind::Function; + break; + case ClangSymbolKind::InstanceMethod: + case ClangSymbolKind::StaticMethod: info.kind = lsSymbolKind::Method; + break; } - return info; } case SymbolKind::Var: { diff --git a/src/clang_symbol_kind.h b/src/symbol.h similarity index 51% rename from src/clang_symbol_kind.h rename to src/symbol.h index 3138f6153..e8e906a32 100644 --- a/src/clang_symbol_kind.h +++ b/src/symbol.h @@ -2,7 +2,11 @@ #include "serializer.h" -#include +// The order matters. In FindSymbolsAtLocation, we want Var/Func ordered in +// front of others. +enum class SymbolKind : uint8_t { Invalid, File, Type, Func, Var }; +MAKE_REFLECT_TYPE_PROXY(SymbolKind); +MAKE_ENUM_HASHABLE(SymbolKind); // TODO Rename query.h:SymbolKind to another name // clang/Index/IndexSymbol.h clang::index::SymbolKind @@ -88,3 +92,59 @@ inline uint16_t operator&(Role lhs, Role rhs) { inline Role operator|(Role lhs, Role rhs) { return Role(uint16_t(lhs) | uint16_t(rhs)); } + +// A document highlight kind. +enum class lsDocumentHighlightKind { + // A textual occurrence. + Text = 1, + // Read-access of a symbol, like reading a variable. + Read = 2, + // Write-access of a symbol, like writing to a variable. + Write = 3 +}; +MAKE_REFLECT_TYPE_PROXY(lsDocumentHighlightKind); + +// A document highlight is a range inside a text document which deserves +// special attention. Usually a document highlight is visualized by changing +// the background color of its range. +struct lsDocumentHighlight { + // The range this highlight applies to. + lsRange range; + + // The highlight kind, default is DocumentHighlightKind.Text. + lsDocumentHighlightKind kind = lsDocumentHighlightKind::Text; + + // cquery extension + Role role = Role::None; +}; +MAKE_REFLECT_STRUCT(lsDocumentHighlight, range, kind, role); + +enum class lsSymbolKind : int { + File = 1, + Module = 2, + Namespace = 3, + Package = 4, + Class = 5, + Method = 6, + Property = 7, + Field = 8, + Constructor = 9, + Enum = 10, + Interface = 11, + Function = 12, + Variable = 13, + Constant = 14, + String = 15, + Number = 16, + Boolean = 17, + Array = 18 +}; +MAKE_REFLECT_TYPE_PROXY(lsSymbolKind); + +struct lsSymbolInformation { + std::string_view name; + lsSymbolKind kind; + lsLocation location; + std::string_view containerName; +}; +MAKE_REFLECT_STRUCT(lsSymbolInformation, name, kind, location, containerName);