From 0985613d16e0f5f0cc2a08e2718b4bb31cde1bf4 Mon Sep 17 00:00:00 2001 From: Chao Shen Date: Sat, 23 Dec 2017 10:10:23 +0800 Subject: [PATCH] Add is_global and is_member. --- src/indexer.cc | 28 +++++++++++++++---- src/indexer.h | 6 ++++ src/message_handler.cc | 2 +- src/query.cc | 2 ++ src/serializer.cc | 2 ++ tests/constructors/constructor.cc | 4 +++ tests/constructors/destructor.cc | 2 ++ tests/constructors/implicit_constructor.cc | 4 +++ tests/constructors/make_functions.cc | 4 +++ .../declaration_vs_definition/class_member.cc | 2 ++ .../class_member_static.cc | 2 ++ .../func_associated_function_params.cc | 4 +++ tests/enums/enum_class_decl.cc | 4 +++ tests/enums/enum_decl.cc | 4 +++ tests/enums/enum_inherit.cc | 4 +++ tests/enums/enum_usage.cc | 6 ++++ tests/foobar.cc | 4 +++ tests/lambdas/lambda.cc | 6 ++++ tests/macros/complex.cc | 4 +++ tests/macros/foo.cc | 6 ++++ tests/multi_file/funky_enum.cc | 6 ++++ tests/multi_file/impl.cc | 10 +++++++ tests/namespaces/namespace_alias.cc | 6 ++++ tests/namespaces/namespace_reference.cc | 4 +++ tests/objective-c/class.m | 6 ++++ tests/outline/outline.cc | 6 ++++ tests/outline/outline2.cc | 6 ++++ tests/outline/static_function_in_type.cc | 2 ++ tests/preprocessor/include_guard.cc | 2 ++ .../implicit_variable_instantiation.cc | 6 ++++ ...ass_template_func_usage_folded_into_one.cc | 4 +++ ...ace_template_type_usage_folded_into_one.cc | 4 +++ ...mplate_class_func_usage_folded_into_one.cc | 4 +++ ...ass_template_func_usage_folded_into_one.cc | 4 +++ ...mplate_class_type_usage_folded_into_one.cc | 4 +++ ...emplate_class_var_usage_folded_into_one.cc | 6 ++++ .../template_func_usage_folded_into_one.cc | 4 +++ .../template_type_usage_folded_into_one.cc | 4 +++ .../template_var_usage_folded_into_one.cc | 6 ++++ tests/types/anonymous_struct.cc | 8 ++++++ tests/unions/union_decl.cc | 4 +++ tests/unions/union_usage.cc | 6 ++++ .../usage/func_called_from_macro_argument.cc | 2 ++ tests/usage/func_usage_addr_func.cc | 2 ++ tests/usage/func_usage_addr_method.cc | 2 ++ tests/usage/func_usage_call_method.cc | 2 ++ .../usage/func_usage_class_inline_var_def.cc | 2 ++ tests/usage/func_usage_forward_decl_method.cc | 2 ++ .../usage/type_usage_as_template_parameter.cc | 6 ++++ ...ype_usage_as_template_parameter_complex.cc | 4 +++ ...type_usage_as_template_parameter_simple.cc | 2 ++ tests/usage/type_usage_declare_extern.cc | 2 ++ tests/usage/type_usage_declare_field.cc | 4 +++ tests/usage/type_usage_declare_local.cc | 4 +++ tests/usage/type_usage_declare_param.cc | 4 +++ .../type_usage_declare_param_prototype.cc | 2 ++ tests/usage/type_usage_declare_qualifiers.cc | 12 ++++++++ tests/usage/type_usage_declare_static.cc | 2 ++ tests/usage/type_usage_various.cc | 4 +++ tests/usage/usage_inside_of_call.cc | 6 ++++ tests/usage/var_usage_call_function.cc | 2 ++ tests/usage/var_usage_class_member.cc | 6 ++++ tests/usage/var_usage_class_member_static.cc | 2 ++ tests/usage/var_usage_cstyle_cast.cc | 2 ++ tests/usage/var_usage_extern.cc | 2 ++ tests/usage/var_usage_func_parameter.cc | 2 ++ tests/usage/var_usage_local.cc | 2 ++ tests/usage/var_usage_shadowed_local.cc | 4 +++ tests/usage/var_usage_shadowed_parameter.cc | 4 +++ tests/usage/var_usage_static.cc | 2 ++ tests/vars/class_member.cc | 2 ++ tests/vars/class_static_member.cc | 2 ++ tests/vars/class_static_member_decl_only.cc | 2 ++ tests/vars/deduce_auto_type.cc | 4 +++ tests/vars/function_local.cc | 2 ++ tests/vars/function_param.cc | 4 +++ tests/vars/function_shadow_local.cc | 4 +++ tests/vars/function_shadow_param.cc | 4 +++ tests/vars/global_variable.cc | 2 ++ tests/vars/global_variable_decl_only.cc | 2 ++ tests/vars/type_instance_on_using_type.cc | 2 ++ 81 files changed, 328 insertions(+), 6 deletions(-) diff --git a/src/indexer.cc b/src/indexer.cc index 538f4e54..12bbd2a7 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -53,7 +53,7 @@ Range ResolveExtent(const CXCursor& cx_cursor, CXFile* cx_file = nullptr) { return Resolve(cx_range, cx_file); } -bool IsLocalSemanticContainer(CXCursorKind kind) { +bool IsScopeSemanticContainer(CXCursorKind kind) { switch (kind) { case CXCursor_Namespace: case CXCursor_TranslationUnit: @@ -91,7 +91,7 @@ struct NamespaceHelper { std::vector namespaces; std::string qualifier; while (cursor.get_kind() != CXCursor_TranslationUnit && - !IsLocalSemanticContainer(cursor.get_kind())) { + !IsScopeSemanticContainer(cursor.get_kind())) { auto it = container_cursor_to_qualified_name.find(cursor); if (it != container_cursor_to_qualified_name.end()) { qualifier = it->second; @@ -600,6 +600,19 @@ optional FindType(ClangCursor cursor) { return result; } +bool IsGlobalContainer(const CXIdxContainerInfo* container) { + if (!container) + return false; + + switch (container->cursor.kind) { + case CXCursor_Namespace: + case CXCursor_TranslationUnit: + return true; + default: + return false; + } +} + bool IsTypeDefinition(const CXIdxContainerInfo* container) { if (!container) return false; @@ -1046,9 +1059,13 @@ void OnIndexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) { var->def.detailed_name = type_name + " " + std::move(qualified_name); } - var->def.is_local = - !decl->semanticContainer || - IsLocalSemanticContainer(decl->semanticContainer->cursor.kind); + bool is_system = clang_Location_isInSystemHeader( + clang_indexLoc_getCXSourceLocation(decl->loc)); + var->def.is_global = + !is_system && IsGlobalContainer(decl->semanticContainer); + var->def.is_member = + !is_system && IsTypeDefinition(decl->semanticContainer); + var->def.is_local = !is_system && !var->def.is_global && !var->def.is_member; //} @@ -1465,6 +1482,7 @@ void OnIndexReference(CXClientData client_data, const CXIdxEntityRefInfo* ref) { clang_getTypeSpelling(clang_getCursorType(referenced.cx_cursor))); var->def.detailed_name = type_name + " " + var->def.short_name; var->def.is_local = false; + var->def.is_member = true; UniqueAdd(var->uses, ResolveSpelling(referenced.cx_cursor)); AddDeclInitializerUsages(db, referenced.cx_cursor); // TODO Use proper semantic_container and lexical_container. diff --git a/src/indexer.h b/src/indexer.h index f8f38b6b..6ba4dbf0 100644 --- a/src/indexer.h +++ b/src/indexer.h @@ -379,6 +379,10 @@ struct VarDefDefinitionData { bool is_local = false; // Is this a macro, ie, #define FOO? bool is_macro = false; + // Is this a global variable? + bool is_global = false; + // Is this a member variable of struct/union/class/enum? + bool is_member = false; bool operator==( const VarDefDefinitionData& other) const { @@ -414,6 +418,8 @@ void Reflect(TVisitor& visitor, REFLECT_MEMBER(declaring_type); REFLECT_MEMBER(is_local); REFLECT_MEMBER(is_macro); + REFLECT_MEMBER(is_global); + REFLECT_MEMBER(is_member); REFLECT_MEMBER_END(); } diff --git a/src/message_handler.cc b/src/message_handler.cc index 8bec99a5..95a57e10 100644 --- a/src/message_handler.cc +++ b/src/message_handler.cc @@ -106,7 +106,7 @@ void EmitSemanticHighlighting(QueryDatabase* db, QueryVar* var = &db->vars[sym.idx.idx]; if (!var->def) continue; // applies to for loop - if (!var->def->is_local && !var->def->declaring_type) + if (!var->def->is_local && !var->def->is_global && !var->def->is_member) continue; // applies to for loop is_type_member = var->def->declaring_type.has_value(); detailed_name = var->def->short_name; diff --git a/src/query.cc b/src/query.cc index 6bd94689..a80aa308 100644 --- a/src/query.cc +++ b/src/query.cc @@ -71,6 +71,8 @@ optional ToQuery(const IdMap& id_map, const IndexVar::Def& var) { result.declaring_type = id_map.ToQuery(var.declaring_type); result.is_local = var.is_local; result.is_macro = var.is_macro; + result.is_global = var.is_global; + result.is_member = var.is_member; return result; } diff --git a/src/serializer.cc b/src/serializer.cc index e98b3c60..d4c4cfdb 100644 --- a/src/serializer.cc +++ b/src/serializer.cc @@ -149,6 +149,8 @@ void Reflect(TVisitor& visitor, IndexVar& value) { REFLECT_MEMBER2("declaring_type", value.def.declaring_type); REFLECT_MEMBER2("is_local", value.def.is_local); REFLECT_MEMBER2("is_macro", value.def.is_macro); + REFLECT_MEMBER2("is_global", value.def.is_global); + REFLECT_MEMBER2("is_member", value.def.is_member); REFLECT_MEMBER2("uses", value.uses); REFLECT_MEMBER_END(); } diff --git a/tests/constructors/constructor.cc b/tests/constructors/constructor.cc index ed8a8677..50818dd5 100644 --- a/tests/constructors/constructor.cc +++ b/tests/constructors/constructor.cc @@ -70,6 +70,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["7:7-7:8"] }, { "id": 1, @@ -81,6 +83,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["8:8-8:10"] }] } diff --git a/tests/constructors/destructor.cc b/tests/constructors/destructor.cc index 38150b00..233d9562 100644 --- a/tests/constructors/destructor.cc +++ b/tests/constructors/destructor.cc @@ -91,6 +91,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["8:7-8:8"] }] } diff --git a/tests/constructors/implicit_constructor.cc b/tests/constructors/implicit_constructor.cc index d21b1d21..44485c27 100644 --- a/tests/constructors/implicit_constructor.cc +++ b/tests/constructors/implicit_constructor.cc @@ -69,6 +69,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["6:8-6:12"] }, { "id": 1, @@ -80,6 +82,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["7:8-7:12"] }] } diff --git a/tests/constructors/make_functions.cc b/tests/constructors/make_functions.cc index 7be5898a..403c420e 100644 --- a/tests/constructors/make_functions.cc +++ b/tests/constructors/make_functions.cc @@ -307,6 +307,8 @@ OUTPUT: make_functions.cc "definition_extent": "4:15-4:29", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:25-4:29"] }, { "id": 1, @@ -317,6 +319,8 @@ OUTPUT: make_functions.cc "definition_extent": "9:16-9:28", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["9:24-9:28"] }] } diff --git a/tests/declaration_vs_definition/class_member.cc b/tests/declaration_vs_definition/class_member.cc index 2c4e5845..75b3b61d 100644 --- a/tests/declaration_vs_definition/class_member.cc +++ b/tests/declaration_vs_definition/class_member.cc @@ -33,6 +33,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["2:7-2:10"] }] } diff --git a/tests/declaration_vs_definition/class_member_static.cc b/tests/declaration_vs_definition/class_member_static.cc index 77b92ee6..a148eb40 100644 --- a/tests/declaration_vs_definition/class_member_static.cc +++ b/tests/declaration_vs_definition/class_member_static.cc @@ -36,6 +36,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["2:14-2:17", "5:10-5:13"] }] } diff --git a/tests/declaration_vs_definition/func_associated_function_params.cc b/tests/declaration_vs_definition/func_associated_function_params.cc index 3e55be9a..e2633c0d 100644 --- a/tests/declaration_vs_definition/func_associated_function_params.cc +++ b/tests/declaration_vs_definition/func_associated_function_params.cc @@ -50,6 +50,8 @@ OUTPUT: "definition_extent": "5:9-5:14", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["5:13-5:14"] }, { "id": 1, @@ -60,6 +62,8 @@ OUTPUT: "definition_extent": "5:16-5:21", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["5:20-5:21"] }] } diff --git a/tests/enums/enum_class_decl.cc b/tests/enums/enum_class_decl.cc index a027e3e2..55923746 100644 --- a/tests/enums/enum_class_decl.cc +++ b/tests/enums/enum_class_decl.cc @@ -35,6 +35,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["2:3-2:4"] }, { "id": 1, @@ -47,6 +49,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["3:3-3:4"] }] } diff --git a/tests/enums/enum_decl.cc b/tests/enums/enum_decl.cc index 3ecd6dd6..718aec49 100644 --- a/tests/enums/enum_decl.cc +++ b/tests/enums/enum_decl.cc @@ -35,6 +35,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["2:3-2:4"] }, { "id": 1, @@ -47,6 +49,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["3:3-3:4"] }] } diff --git a/tests/enums/enum_inherit.cc b/tests/enums/enum_inherit.cc index afddfb32..569bacd6 100644 --- a/tests/enums/enum_inherit.cc +++ b/tests/enums/enum_inherit.cc @@ -35,6 +35,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["2:3-2:4"] }, { "id": 1, @@ -47,6 +49,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["3:3-3:4"] }] } diff --git a/tests/enums/enum_usage.cc b/tests/enums/enum_usage.cc index f58e3d4e..90e7fbd9 100644 --- a/tests/enums/enum_usage.cc +++ b/tests/enums/enum_usage.cc @@ -37,6 +37,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["2:3-2:4", "6:14-6:15"] }, { "id": 1, @@ -49,6 +51,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["3:3-3:4"] }, { "id": 2, @@ -60,6 +64,8 @@ OUTPUT: "variable_type": 0, "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["6:5-6:6"] }] } diff --git a/tests/foobar.cc b/tests/foobar.cc index 40dffd4e..a9fe9304 100644 --- a/tests/foobar.cc +++ b/tests/foobar.cc @@ -81,6 +81,8 @@ OUTPUT: "variable_type": 3, "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["9:15-9:16"] }, { "id": 1, @@ -92,6 +94,8 @@ OUTPUT: "variable_type": 2, "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["10:8-10:9"] }] } diff --git a/tests/lambdas/lambda.cc b/tests/lambdas/lambda.cc index 20efdcc1..aa5bb971 100644 --- a/tests/lambdas/lambda.cc +++ b/tests/lambdas/lambda.cc @@ -66,6 +66,8 @@ OUTPUT: "definition_extent": "2:3-2:8", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["2:7-2:8", "5:7-5:8", "4:24-4:25"] }, { "id": 1, @@ -77,6 +79,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:8-4:19", "9:3-9:14", "10:3-10:14", "11:3-11:14"] }, { "id": 2, @@ -87,6 +91,8 @@ OUTPUT: "definition_extent": "4:27-4:32", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:31-4:32", "6:7-6:8"] }] } diff --git a/tests/macros/complex.cc b/tests/macros/complex.cc index d924fce1..f32275a5 100644 --- a/tests/macros/complex.cc +++ b/tests/macros/complex.cc @@ -62,6 +62,8 @@ OUTPUT: "definition_extent": "9:1-9:20", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["9:11-9:16", "12:14-12:19"] }, { "id": 1, @@ -73,6 +75,8 @@ OUTPUT: "definition_extent": "1:9-3:32", "is_local": false, "is_macro": true, + "is_global": false, + "is_member": false, "uses": ["1:9-1:12", "12:1-12:4"] }] } diff --git a/tests/macros/foo.cc b/tests/macros/foo.cc index e01c0333..85616211 100644 --- a/tests/macros/foo.cc +++ b/tests/macros/foo.cc @@ -53,6 +53,8 @@ OUTPUT: "definition_extent": "8:1-8:10", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["8:5-8:6"] }, { "id": 1, @@ -64,6 +66,8 @@ OUTPUT: "definition_extent": "1:9-1:12", "is_local": false, "is_macro": true, + "is_global": false, + "is_member": false, "uses": ["1:9-1:10", "8:9-8:10"] }, { "id": 2, @@ -75,6 +79,8 @@ OUTPUT: "definition_extent": "2:9-2:46", "is_local": false, "is_macro": true, + "is_global": false, + "is_member": false, "uses": ["2:9-2:17", "5:3-5:11"] }] } diff --git a/tests/multi_file/funky_enum.cc b/tests/multi_file/funky_enum.cc index 896a4179..555c60fb 100644 --- a/tests/multi_file/funky_enum.cc +++ b/tests/multi_file/funky_enum.cc @@ -37,6 +37,8 @@ OUTPUT: funky_enum.h "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:1-4:2"] }, { "id": 1, @@ -50,6 +52,8 @@ OUTPUT: funky_enum.h "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["5:1-5:2"] }, { "id": 2, @@ -63,6 +67,8 @@ OUTPUT: funky_enum.h "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["6:1-6:2"] }] } diff --git a/tests/multi_file/impl.cc b/tests/multi_file/impl.cc index 7d7f0185..4a94ec23 100644 --- a/tests/multi_file/impl.cc +++ b/tests/multi_file/impl.cc @@ -114,6 +114,8 @@ OUTPUT: header.h "declaring_type": 4, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["15:13-15:14"] }, { "id": 1, @@ -127,6 +129,8 @@ OUTPUT: header.h "declaring_type": 4, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["15:16-15:17"] }, { "id": 2, @@ -140,6 +144,8 @@ OUTPUT: header.h "declaring_type": 4, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["15:19-15:20"] }, { "id": 3, @@ -151,6 +157,8 @@ OUTPUT: header.h "definition_extent": "17:1-17:9", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["17:5-17:9"] }, { "id": 4, @@ -162,6 +170,8 @@ OUTPUT: header.h "definition_extent": "18:1-18:16", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["18:12-18:16"] }] } diff --git a/tests/namespaces/namespace_alias.cc b/tests/namespaces/namespace_alias.cc index 14c586f4..4119ed8b 100644 --- a/tests/namespaces/namespace_alias.cc +++ b/tests/namespaces/namespace_alias.cc @@ -44,6 +44,8 @@ OUTPUT: "definition_extent": "4:14-4:26", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:18-4:21", "12:26-12:29", "13:16-13:19"] }, { "id": 1, @@ -54,6 +56,8 @@ OUTPUT: "definition_extent": "12:3-12:29", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["12:7-12:8"] }, { "id": 2, @@ -64,6 +68,8 @@ OUTPUT: "definition_extent": "13:3-13:19", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["13:7-13:8"] }] } diff --git a/tests/namespaces/namespace_reference.cc b/tests/namespaces/namespace_reference.cc index 51122324..2b60797a 100644 --- a/tests/namespaces/namespace_reference.cc +++ b/tests/namespaces/namespace_reference.cc @@ -55,6 +55,8 @@ OUTPUT: "definition_extent": "2:3-2:10", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["2:7-2:10", "7:18-7:21", "9:10-9:13"] }, { "id": 1, @@ -65,6 +67,8 @@ OUTPUT: "definition_extent": "3:15-3:20", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["3:19-3:20"] }] } diff --git a/tests/objective-c/class.m b/tests/objective-c/class.m index daffc987..4c987032 100644 --- a/tests/objective-c/class.m +++ b/tests/objective-c/class.m @@ -138,6 +138,8 @@ OUTPUT: "declaration": "4:29-4:34", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:29-4:34", "16:12-16:17"] }, { "id": 1, @@ -149,6 +151,8 @@ OUTPUT: "definition_extent": "4:29-4:34", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:29-4:34"] }, { "id": 2, @@ -160,6 +164,8 @@ OUTPUT: "definition_extent": "14:3-14:35", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["14:11-14:19", "15:4-15:12", "16:3-16:11"] }] } diff --git a/tests/outline/outline.cc b/tests/outline/outline.cc index 8634dddc..0a6f60ba 100644 --- a/tests/outline/outline.cc +++ b/tests/outline/outline.cc @@ -58,6 +58,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:7-4:8"] }, { "id": 1, @@ -70,6 +72,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["5:7-5:8"] }, { "id": 2, @@ -83,6 +87,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["6:20-6:26"] }] } diff --git a/tests/outline/outline2.cc b/tests/outline/outline2.cc index 0e41ee6e..58385fb5 100644 --- a/tests/outline/outline2.cc +++ b/tests/outline/outline2.cc @@ -102,6 +102,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["7:15-7:24"] }, { "id": 1, @@ -115,6 +117,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["8:15-8:23"] }, { "id": 2, @@ -128,6 +132,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["9:28-9:32"] }] } diff --git a/tests/outline/static_function_in_type.cc b/tests/outline/static_function_in_type.cc index 3dc9dd40..1edb682f 100644 --- a/tests/outline/static_function_in_type.cc +++ b/tests/outline/static_function_in_type.cc @@ -119,6 +119,8 @@ OUTPUT: static_function_in_type.cc "variable_type": 1, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["5:29-5:30"] }] } diff --git a/tests/preprocessor/include_guard.cc b/tests/preprocessor/include_guard.cc index 3e5414fd..5ff2a37f 100644 --- a/tests/preprocessor/include_guard.cc +++ b/tests/preprocessor/include_guard.cc @@ -20,6 +20,8 @@ OUTPUT: "definition_extent": "2:9-2:12", "is_local": false, "is_macro": true, + "is_global": false, + "is_member": false, "uses": ["2:9-2:12"] }] } diff --git a/tests/templates/implicit_variable_instantiation.cc b/tests/templates/implicit_variable_instantiation.cc index fbb36025..a9867b01 100644 --- a/tests/templates/implicit_variable_instantiation.cc +++ b/tests/templates/implicit_variable_instantiation.cc @@ -61,6 +61,8 @@ OUTPUT: "declaring_type": 1, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["6:30-6:40", "10:37-10:47", "13:26-13:36", "14:27-14:37"] }, { "id": 1, @@ -71,6 +73,8 @@ OUTPUT: "definition_extent": "13:3-13:36", "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["13:7-13:10"] }, { "id": 2, @@ -81,6 +85,8 @@ OUTPUT: "definition_extent": "14:3-14:37", "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["14:7-14:11"] }] } diff --git a/tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc b/tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc index 057fc3e9..ceea291a 100644 --- a/tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc +++ b/tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc @@ -57,6 +57,8 @@ OUTPUT: "definition_extent": "10:3-10:33", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["10:7-10:8"] }, { "id": 1, @@ -67,6 +69,8 @@ OUTPUT: "definition_extent": "11:3-11:35", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["11:7-11:8"] }] } diff --git a/tests/templates/namespace_template_type_usage_folded_into_one.cc b/tests/templates/namespace_template_type_usage_folded_into_one.cc index e25c7987..1e5d0841 100644 --- a/tests/templates/namespace_template_type_usage_folded_into_one.cc +++ b/tests/templates/namespace_template_type_usage_folded_into_one.cc @@ -37,6 +37,8 @@ OUTPUT: "variable_type": 0, "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["5:12-5:13"] }, { "id": 1, @@ -48,6 +50,8 @@ OUTPUT: "variable_type": 0, "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["6:13-6:14"] }] } diff --git a/tests/templates/template_class_func_usage_folded_into_one.cc b/tests/templates/template_class_func_usage_folded_into_one.cc index 94984b0c..bb1dbfb0 100644 --- a/tests/templates/template_class_func_usage_folded_into_one.cc +++ b/tests/templates/template_class_func_usage_folded_into_one.cc @@ -54,6 +54,8 @@ OUTPUT: "definition_extent": "8:1-8:24", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["8:5-8:6"] }, { "id": 1, @@ -64,6 +66,8 @@ OUTPUT: "definition_extent": "9:1-9:25", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["9:5-9:6"] }] } diff --git a/tests/templates/template_class_template_func_usage_folded_into_one.cc b/tests/templates/template_class_template_func_usage_folded_into_one.cc index e536edf0..e554d720 100644 --- a/tests/templates/template_class_template_func_usage_folded_into_one.cc +++ b/tests/templates/template_class_template_func_usage_folded_into_one.cc @@ -55,6 +55,8 @@ OUTPUT: "definition_extent": "9:1-9:31", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["9:5-9:6"] }, { "id": 1, @@ -65,6 +67,8 @@ OUTPUT: "definition_extent": "10:1-10:33", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["10:5-10:6"] }] } diff --git a/tests/templates/template_class_type_usage_folded_into_one.cc b/tests/templates/template_class_type_usage_folded_into_one.cc index 3f9a070c..c7faaacb 100644 --- a/tests/templates/template_class_type_usage_folded_into_one.cc +++ b/tests/templates/template_class_type_usage_folded_into_one.cc @@ -100,6 +100,8 @@ OUTPUT: "variable_type": 3, "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["9:15-9:16"] }, { "id": 1, @@ -111,6 +113,8 @@ OUTPUT: "variable_type": 3, "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["10:15-10:16"] }] } diff --git a/tests/templates/template_class_var_usage_folded_into_one.cc b/tests/templates/template_class_var_usage_folded_into_one.cc index a0812d0c..114d81c0 100644 --- a/tests/templates/template_class_var_usage_folded_into_one.cc +++ b/tests/templates/template_class_var_usage_folded_into_one.cc @@ -35,6 +35,8 @@ OUTPUT: "declaration": "3:24-3:27", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["3:24-3:27", "6:19-6:22", "7:20-7:23"] }, { "id": 1, @@ -45,6 +47,8 @@ OUTPUT: "definition_extent": "6:1-6:22", "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["6:5-6:6"] }, { "id": 2, @@ -55,6 +59,8 @@ OUTPUT: "definition_extent": "7:1-7:23", "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["7:5-7:6"] }] } diff --git a/tests/templates/template_func_usage_folded_into_one.cc b/tests/templates/template_func_usage_folded_into_one.cc index 6dedd16b..998add0c 100644 --- a/tests/templates/template_func_usage_folded_into_one.cc +++ b/tests/templates/template_func_usage_folded_into_one.cc @@ -40,6 +40,8 @@ OUTPUT: "definition_extent": "6:1-6:19", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["6:5-6:6"] }, { "id": 1, @@ -50,6 +52,8 @@ OUTPUT: "definition_extent": "7:1-7:20", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["7:5-7:6"] }] } diff --git a/tests/templates/template_type_usage_folded_into_one.cc b/tests/templates/template_type_usage_folded_into_one.cc index e158b47a..0a8d0896 100644 --- a/tests/templates/template_type_usage_folded_into_one.cc +++ b/tests/templates/template_type_usage_folded_into_one.cc @@ -35,6 +35,8 @@ OUTPUT: "variable_type": 0, "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["4:10-4:11"] }, { "id": 1, @@ -46,6 +48,8 @@ OUTPUT: "variable_type": 0, "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["5:11-5:12"] }] } diff --git a/tests/templates/template_var_usage_folded_into_one.cc b/tests/templates/template_var_usage_folded_into_one.cc index 05b94efd..af241b7e 100644 --- a/tests/templates/template_var_usage_folded_into_one.cc +++ b/tests/templates/template_var_usage_folded_into_one.cc @@ -86,6 +86,8 @@ OUTPUT: "definition_extent": "5:1-5:12", "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["5:3-5:6", "7:7-7:10", "8:7-8:10"] }, { "id": 1, @@ -97,6 +99,8 @@ OUTPUT: "variable_type": 0, "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["7:3-7:4"] }, { "id": 2, @@ -108,6 +112,8 @@ OUTPUT: "variable_type": 1, "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["8:3-8:4"] }] } diff --git a/tests/types/anonymous_struct.cc b/tests/types/anonymous_struct.cc index 1f030dba..598af845 100644 --- a/tests/types/anonymous_struct.cc +++ b/tests/types/anonymous_struct.cc @@ -48,6 +48,8 @@ OUTPUT: "declaring_type": 1, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["2:18-2:19"] }, { "id": 1, @@ -59,6 +61,8 @@ OUTPUT: "declaring_type": 1, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["2:21-2:22"] }, { "id": 2, @@ -70,6 +74,8 @@ OUTPUT: "declaring_type": 1, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["2:24-2:25"] }, { "id": 3, @@ -81,6 +87,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["3:9-3:10"] }] } diff --git a/tests/unions/union_decl.cc b/tests/unions/union_decl.cc index 250dd375..951a91bc 100644 --- a/tests/unions/union_decl.cc +++ b/tests/unions/union_decl.cc @@ -34,6 +34,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["2:7-2:8"] }, { "id": 1, @@ -45,6 +47,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["3:8-3:9"] }] } diff --git a/tests/unions/union_usage.cc b/tests/unions/union_usage.cc index be804f0b..7e44fb9b 100644 --- a/tests/unions/union_usage.cc +++ b/tests/unions/union_usage.cc @@ -57,6 +57,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["2:7-2:8", "9:5-9:6"] }, { "id": 1, @@ -68,6 +70,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["3:8-3:9"] }, { "id": 2, @@ -79,6 +83,8 @@ OUTPUT: "variable_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["6:5-6:6", "9:3-9:4"] }] } diff --git a/tests/usage/func_called_from_macro_argument.cc b/tests/usage/func_called_from_macro_argument.cc index a3833bbf..36bbbd68 100644 --- a/tests/usage/func_called_from_macro_argument.cc +++ b/tests/usage/func_called_from_macro_argument.cc @@ -56,6 +56,8 @@ OUTPUT: "definition_extent": "1:9-1:24", "is_local": false, "is_macro": true, + "is_global": false, + "is_member": false, "uses": ["1:9-1:19", "6:3-6:13"] }] } diff --git a/tests/usage/func_usage_addr_func.cc b/tests/usage/func_usage_addr_func.cc index d203a39c..f6c23d75 100644 --- a/tests/usage/func_usage_addr_func.cc +++ b/tests/usage/func_usage_addr_func.cc @@ -68,6 +68,8 @@ OUTPUT: "definition_extent": "6:3-6:22", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["6:10-6:11"] }] } diff --git a/tests/usage/func_usage_addr_method.cc b/tests/usage/func_usage_addr_method.cc index d301ed82..b02cf64e 100644 --- a/tests/usage/func_usage_addr_method.cc +++ b/tests/usage/func_usage_addr_method.cc @@ -71,6 +71,8 @@ OUTPUT: "definition_extent": "6:3-6:22", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["6:8-6:9"] }] } diff --git a/tests/usage/func_usage_call_method.cc b/tests/usage/func_usage_call_method.cc index 21523e1c..c684be39 100644 --- a/tests/usage/func_usage_call_method.cc +++ b/tests/usage/func_usage_call_method.cc @@ -72,6 +72,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["6:8-6:9", "7:3-7:4"] }] } diff --git a/tests/usage/func_usage_class_inline_var_def.cc b/tests/usage/func_usage_class_inline_var_def.cc index e08e8a1c..177901e7 100644 --- a/tests/usage/func_usage_class_inline_var_def.cc +++ b/tests/usage/func_usage_class_inline_var_def.cc @@ -52,6 +52,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["6:7-6:8"] }] } diff --git a/tests/usage/func_usage_forward_decl_method.cc b/tests/usage/func_usage_forward_decl_method.cc index 8d494b8c..9a6be8c0 100644 --- a/tests/usage/func_usage_forward_decl_method.cc +++ b/tests/usage/func_usage_forward_decl_method.cc @@ -71,6 +71,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["6:8-6:9", "7:3-7:4"] }] } diff --git a/tests/usage/type_usage_as_template_parameter.cc b/tests/usage/type_usage_as_template_parameter.cc index 83e29e38..65867a38 100644 --- a/tests/usage/type_usage_as_template_parameter.cc +++ b/tests/usage/type_usage_as_template_parameter.cc @@ -70,6 +70,8 @@ OUTPUT: "variable_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["6:25-6:27"] }, { "id": 1, @@ -81,6 +83,8 @@ OUTPUT: "variable_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["7:22-7:24"] }, { "id": 2, @@ -92,6 +96,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["10:18-10:23"] }] } diff --git a/tests/usage/type_usage_as_template_parameter_complex.cc b/tests/usage/type_usage_as_template_parameter_complex.cc index 39aa9128..df879e8d 100644 --- a/tests/usage/type_usage_as_template_parameter_complex.cc +++ b/tests/usage/type_usage_as_template_parameter_complex.cc @@ -210,6 +210,8 @@ OUTPUT: "variable_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["15:43-15:44"] }, { "id": 1, @@ -221,6 +223,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["54:39-54:44"] }] } diff --git a/tests/usage/type_usage_as_template_parameter_simple.cc b/tests/usage/type_usage_as_template_parameter_simple.cc index 7c689a7d..cdc78060 100644 --- a/tests/usage/type_usage_as_template_parameter_simple.cc +++ b/tests/usage/type_usage_as_template_parameter_simple.cc @@ -48,6 +48,8 @@ OUTPUT: "variable_type": 0, "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["6:22-6:25"] }] } diff --git a/tests/usage/type_usage_declare_extern.cc b/tests/usage/type_usage_declare_extern.cc index 60b12a32..36c91add 100644 --- a/tests/usage/type_usage_declare_extern.cc +++ b/tests/usage/type_usage_declare_extern.cc @@ -31,6 +31,8 @@ OUTPUT: "variable_type": 0, "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["3:10-3:11"] }] } diff --git a/tests/usage/type_usage_declare_field.cc b/tests/usage/type_usage_declare_field.cc index 1701224e..c514c881 100644 --- a/tests/usage/type_usage_declare_field.cc +++ b/tests/usage/type_usage_declare_field.cc @@ -64,6 +64,8 @@ OUTPUT: "declaring_type": 2, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["5:16-5:17"] }, { "id": 1, @@ -76,6 +78,8 @@ OUTPUT: "declaring_type": 2, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["6:19-6:20"] }] } diff --git a/tests/usage/type_usage_declare_local.cc b/tests/usage/type_usage_declare_local.cc index 22da87bf..d38a6938 100644 --- a/tests/usage/type_usage_declare_local.cc +++ b/tests/usage/type_usage_declare_local.cc @@ -64,6 +64,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["5:16-5:17"] }, { "id": 1, @@ -75,6 +77,8 @@ OUTPUT: "variable_type": 1, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["6:19-6:20"] }] } diff --git a/tests/usage/type_usage_declare_param.cc b/tests/usage/type_usage_declare_param.cc index 55c240f5..5b26075e 100644 --- a/tests/usage/type_usage_declare_param.cc +++ b/tests/usage/type_usage_declare_param.cc @@ -61,6 +61,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:23-4:24"] }, { "id": 1, @@ -72,6 +74,8 @@ OUTPUT: "variable_type": 1, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:42-4:43"] }] } diff --git a/tests/usage/type_usage_declare_param_prototype.cc b/tests/usage/type_usage_declare_param_prototype.cc index 45d9d1d3..f79873ea 100644 --- a/tests/usage/type_usage_declare_param_prototype.cc +++ b/tests/usage/type_usage_declare_param_prototype.cc @@ -57,6 +57,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:15-4:16"] }] } diff --git a/tests/usage/type_usage_declare_qualifiers.cc b/tests/usage/type_usage_declare_qualifiers.cc index 3035bb73..c392a474 100644 --- a/tests/usage/type_usage_declare_qualifiers.cc +++ b/tests/usage/type_usage_declare_qualifiers.cc @@ -52,6 +52,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["3:16-3:18"] }, { "id": 1, @@ -63,6 +65,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["3:32-3:34"] }, { "id": 2, @@ -74,6 +78,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:8-4:10"] }, { "id": 3, @@ -85,6 +91,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["5:9-5:11"] }, { "id": 4, @@ -96,6 +104,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["6:15-6:17"] }, { "id": 5, @@ -107,6 +117,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["7:21-7:23"] }] } diff --git a/tests/usage/type_usage_declare_static.cc b/tests/usage/type_usage_declare_static.cc index 83acc17b..029f72a8 100644 --- a/tests/usage/type_usage_declare_static.cc +++ b/tests/usage/type_usage_declare_static.cc @@ -31,6 +31,8 @@ OUTPUT: "variable_type": 0, "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["2:13-2:14"] }] } diff --git a/tests/usage/type_usage_various.cc b/tests/usage/type_usage_various.cc index ba91da37..41ff8da6 100644 --- a/tests/usage/type_usage_various.cc +++ b/tests/usage/type_usage_various.cc @@ -61,6 +61,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["6:7-6:8"] }, { "id": 1, @@ -71,6 +73,8 @@ OUTPUT: "variable_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["10:12-10:15"] }] } diff --git a/tests/usage/usage_inside_of_call.cc b/tests/usage/usage_inside_of_call.cc index 6253fb56..8333fd44 100644 --- a/tests/usage/usage_inside_of_call.cc +++ b/tests/usage/usage_inside_of_call.cc @@ -97,6 +97,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["6:14-6:24", "10:10-10:20", "14:45-14:55"] }, { "id": 1, @@ -108,6 +110,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["7:7-7:16", "14:28-14:37"] }, { "id": 2, @@ -118,6 +122,8 @@ OUTPUT: "definition_extent": "13:3-13:12", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["13:7-13:8", "14:10-14:11"] }] } diff --git a/tests/usage/var_usage_call_function.cc b/tests/usage/var_usage_call_function.cc index 4142699c..2515e751 100644 --- a/tests/usage/var_usage_call_function.cc +++ b/tests/usage/var_usage_call_function.cc @@ -53,6 +53,8 @@ OUTPUT: "definition_extent": "4:3-4:19", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:8-4:9", "5:3-5:4"] }] } diff --git a/tests/usage/var_usage_class_member.cc b/tests/usage/var_usage_class_member.cc index 52e1a165..8e6562d7 100644 --- a/tests/usage/var_usage_class_member.cc +++ b/tests/usage/var_usage_class_member.cc @@ -99,6 +99,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["3:7-3:8", "12:5-12:6", "13:5-13:6", "14:12-14:13", "15:12-15:13", "16:13-16:14"] }, { "id": 1, @@ -110,6 +112,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:7-4:8", "17:12-17:13"] }, { "id": 2, @@ -121,6 +125,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["11:7-11:8", "12:3-12:4", "13:3-13:4", "14:10-14:11", "15:10-15:11", "16:11-16:12", "17:10-17:11"] }] } diff --git a/tests/usage/var_usage_class_member_static.cc b/tests/usage/var_usage_class_member_static.cc index 65a9d277..4dc2f4c7 100644 --- a/tests/usage/var_usage_class_member_static.cc +++ b/tests/usage/var_usage_class_member_static.cc @@ -70,6 +70,8 @@ OUTPUT: "declaration": "2:14-2:15", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["2:14-2:15", "8:15-8:16"] }] } diff --git a/tests/usage/var_usage_cstyle_cast.cc b/tests/usage/var_usage_cstyle_cast.cc index 00148c10..a8360c68 100644 --- a/tests/usage/var_usage_cstyle_cast.cc +++ b/tests/usage/var_usage_cstyle_cast.cc @@ -54,6 +54,8 @@ OUTPUT: "declaring_type": 1, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["4:28-4:38", "7:23-7:33"] }] } diff --git a/tests/usage/var_usage_extern.cc b/tests/usage/var_usage_extern.cc index 27a0221e..e9b26ee7 100644 --- a/tests/usage/var_usage_extern.cc +++ b/tests/usage/var_usage_extern.cc @@ -33,6 +33,8 @@ OUTPUT: "declaration": "1:12-1:13", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["1:12-1:13", "4:3-4:4"] }] } diff --git a/tests/usage/var_usage_func_parameter.cc b/tests/usage/var_usage_func_parameter.cc index e9279741..f08be720 100644 --- a/tests/usage/var_usage_func_parameter.cc +++ b/tests/usage/var_usage_func_parameter.cc @@ -32,6 +32,8 @@ OUTPUT: "definition_extent": "1:10-1:15", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["1:14-1:15", "2:3-2:4"] }] } diff --git a/tests/usage/var_usage_local.cc b/tests/usage/var_usage_local.cc index e750a3bf..b6965a91 100644 --- a/tests/usage/var_usage_local.cc +++ b/tests/usage/var_usage_local.cc @@ -33,6 +33,8 @@ OUTPUT: "definition_extent": "2:3-2:8", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["2:7-2:8", "3:3-3:4"] }] } diff --git a/tests/usage/var_usage_shadowed_local.cc b/tests/usage/var_usage_shadowed_local.cc index 97123d06..8d7cba52 100644 --- a/tests/usage/var_usage_shadowed_local.cc +++ b/tests/usage/var_usage_shadowed_local.cc @@ -38,6 +38,8 @@ OUTPUT: "definition_extent": "2:3-2:8", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["2:7-2:8", "3:3-3:4", "8:3-8:4"] }, { "id": 1, @@ -48,6 +50,8 @@ OUTPUT: "definition_extent": "5:5-5:10", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["5:9-5:10", "6:5-6:6"] }] } diff --git a/tests/usage/var_usage_shadowed_parameter.cc b/tests/usage/var_usage_shadowed_parameter.cc index 9f4b1a18..b1723266 100644 --- a/tests/usage/var_usage_shadowed_parameter.cc +++ b/tests/usage/var_usage_shadowed_parameter.cc @@ -38,6 +38,8 @@ OUTPUT: "definition_extent": "1:10-1:15", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["1:14-1:15", "2:3-2:4", "7:3-7:4"] }, { "id": 1, @@ -48,6 +50,8 @@ OUTPUT: "definition_extent": "4:5-4:10", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:9-4:10", "5:5-5:6"] }] } diff --git a/tests/usage/var_usage_static.cc b/tests/usage/var_usage_static.cc index 96bd34be..dc6228ad 100644 --- a/tests/usage/var_usage_static.cc +++ b/tests/usage/var_usage_static.cc @@ -35,6 +35,8 @@ OUTPUT: "definition_extent": "1:1-1:13", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["1:12-1:13", "4:3-4:4"] }] } diff --git a/tests/vars/class_member.cc b/tests/vars/class_member.cc index 57bcdce1..52cdd34c 100644 --- a/tests/vars/class_member.cc +++ b/tests/vars/class_member.cc @@ -33,6 +33,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["2:8-2:14"] }] } diff --git a/tests/vars/class_static_member.cc b/tests/vars/class_static_member.cc index 0077e7a6..6b2875fd 100644 --- a/tests/vars/class_static_member.cc +++ b/tests/vars/class_static_member.cc @@ -36,6 +36,8 @@ OUTPUT: "declaring_type": 0, "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["2:15-2:21", "4:11-4:17"] }] } diff --git a/tests/vars/class_static_member_decl_only.cc b/tests/vars/class_static_member_decl_only.cc index 9de79129..5b14140d 100644 --- a/tests/vars/class_static_member_decl_only.cc +++ b/tests/vars/class_static_member_decl_only.cc @@ -30,6 +30,8 @@ OUTPUT: "declaration": "2:14-2:20", "is_local": false, "is_macro": false, + "is_global": false, + "is_member": true, "uses": ["2:14-2:20"] }] } diff --git a/tests/vars/deduce_auto_type.cc b/tests/vars/deduce_auto_type.cc index af558b4f..24136f55 100644 --- a/tests/vars/deduce_auto_type.cc +++ b/tests/vars/deduce_auto_type.cc @@ -50,6 +50,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["3:8-3:9"] }, { "id": 1, @@ -61,6 +63,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:9-4:10"] }] } diff --git a/tests/vars/function_local.cc b/tests/vars/function_local.cc index 9780c529..3afd2180 100644 --- a/tests/vars/function_local.cc +++ b/tests/vars/function_local.cc @@ -48,6 +48,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:8-4:9"] }] } diff --git a/tests/vars/function_param.cc b/tests/vars/function_param.cc index 0925f735..206c3839 100644 --- a/tests/vars/function_param.cc +++ b/tests/vars/function_param.cc @@ -46,6 +46,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["3:15-3:17"] }, { "id": 1, @@ -57,6 +59,8 @@ OUTPUT: "variable_type": 0, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["3:24-3:26"] }] } diff --git a/tests/vars/function_shadow_local.cc b/tests/vars/function_shadow_local.cc index c49194c7..822e5e07 100644 --- a/tests/vars/function_shadow_local.cc +++ b/tests/vars/function_shadow_local.cc @@ -38,6 +38,8 @@ OUTPUT: "definition_extent": "2:3-2:8", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["2:7-2:8", "3:3-3:4", "8:3-8:4"] }, { "id": 1, @@ -48,6 +50,8 @@ OUTPUT: "definition_extent": "5:5-5:10", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["5:9-5:10", "6:5-6:6"] }] } diff --git a/tests/vars/function_shadow_param.cc b/tests/vars/function_shadow_param.cc index d249011f..ad221784 100644 --- a/tests/vars/function_shadow_param.cc +++ b/tests/vars/function_shadow_param.cc @@ -32,6 +32,8 @@ OUTPUT: "definition_extent": "1:10-1:15", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["1:14-1:15"] }, { "id": 1, @@ -42,6 +44,8 @@ OUTPUT: "definition_extent": "2:5-2:14", "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["2:9-2:10"] }] } diff --git a/tests/vars/global_variable.cc b/tests/vars/global_variable.cc index 574601ac..11dd012e 100644 --- a/tests/vars/global_variable.cc +++ b/tests/vars/global_variable.cc @@ -15,6 +15,8 @@ OUTPUT: "definition_extent": "1:1-1:22", "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["1:12-1:18"] }] } diff --git a/tests/vars/global_variable_decl_only.cc b/tests/vars/global_variable_decl_only.cc index 3d4071f3..ad908f1a 100644 --- a/tests/vars/global_variable_decl_only.cc +++ b/tests/vars/global_variable_decl_only.cc @@ -14,6 +14,8 @@ OUTPUT: "declaration": "1:12-1:18", "is_local": false, "is_macro": false, + "is_global": true, + "is_member": false, "uses": ["1:12-1:18"] }] } diff --git a/tests/vars/type_instance_on_using_type.cc b/tests/vars/type_instance_on_using_type.cc index 1ee851ae..217238fa 100644 --- a/tests/vars/type_instance_on_using_type.cc +++ b/tests/vars/type_instance_on_using_type.cc @@ -68,6 +68,8 @@ OUTPUT: "variable_type": 1, "is_local": true, "is_macro": false, + "is_global": false, + "is_member": false, "uses": ["4:5-4:6"] }] }