From d3bd31604e43d6ff27c45ebda17f88e05e646229 Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Sat, 20 May 2017 18:26:50 -0700 Subject: [PATCH] Code lens improvements - Hide declaration from list of refs on types and variables (so now they will show as '0 refs') - Let the user hide code lens on parameter and function-local variables --- src/command_line.cc | 39 ++++++++++--------- src/indexer.cc | 19 ++++++++- src/indexer.h | 4 ++ src/language_server_api.h | 5 +++ src/query.cc | 1 + src/serializer.cc | 1 + tests/constructors/constructor.cc | 2 + tests/constructors/destructor.cc | 1 + .../declaration_vs_definition/class_member.cc | 1 + .../class_member_static.cc | 1 + tests/enums/enum_class_decl.cc | 2 + tests/enums/enum_decl.cc | 2 + tests/enums/enum_inherit.cc | 2 + tests/enums/enum_usage.cc | 3 ++ tests/foobar.cc | 2 + tests/multi_file/funky_enum.cc | 3 ++ tests/multi_file/impl.cc | 5 +++ tests/namespaces/namespace_reference.cc | 2 + tests/outline/outline.cc | 3 ++ tests/outline/outline2.cc | 3 ++ .../implicit_variable_instantiation.cc | 3 ++ ...ass_template_func_usage_folded_into_one.cc | 2 + ...ace_template_type_usage_folded_into_one.cc | 2 + ...mplate_class_func_usage_folded_into_one.cc | 2 + ...ass_template_func_usage_folded_into_one.cc | 2 + ...mplate_class_type_usage_folded_into_one.cc | 2 + ...emplate_class_var_usage_folded_into_one.cc | 3 ++ .../template_func_usage_folded_into_one.cc | 2 + .../template_type_usage_folded_into_one.cc | 2 + .../template_var_usage_folded_into_one.cc | 3 ++ tests/types/anonymous_struct.cc | 4 ++ tests/unions/union_decl.cc | 2 + tests/unions/union_usage.cc | 3 ++ tests/usage/func_usage_addr_func.cc | 1 + tests/usage/func_usage_addr_method.cc | 1 + tests/usage/func_usage_call_method.cc | 1 + .../usage/func_usage_class_inline_var_def.cc | 1 + tests/usage/func_usage_forward_decl_method.cc | 1 + .../usage/type_usage_as_template_parameter.cc | 3 ++ ...ype_usage_as_template_parameter_complex.cc | 2 + ...type_usage_as_template_parameter_simple.cc | 1 + tests/usage/type_usage_declare_extern.cc | 1 + tests/usage/type_usage_declare_field.cc | 2 + tests/usage/type_usage_declare_local.cc | 2 + tests/usage/type_usage_declare_param.cc | 2 + .../type_usage_declare_param_prototype.cc | 1 + tests/usage/type_usage_declare_qualifiers.cc | 6 +++ tests/usage/type_usage_declare_static.cc | 1 + tests/usage/type_usage_various.cc | 2 + tests/usage/usage_inside_of_call.cc | 3 ++ tests/usage/var_usage_call_function.cc | 1 + tests/usage/var_usage_class_member.cc | 3 ++ tests/usage/var_usage_class_member_static.cc | 1 + tests/usage/var_usage_cstyle_cast.cc | 1 + tests/usage/var_usage_extern.cc | 1 + tests/usage/var_usage_func_parameter.cc | 1 + tests/usage/var_usage_local.cc | 1 + tests/usage/var_usage_shadowed_local.cc | 2 + tests/usage/var_usage_shadowed_parameter.cc | 2 + tests/usage/var_usage_static.cc | 1 + tests/vars/class_member.cc | 1 + tests/vars/class_static_member.cc | 1 + tests/vars/class_static_member_decl_only.cc | 1 + tests/vars/deduce_auto_type.cc | 2 + tests/vars/function_local.cc | 1 + tests/vars/function_param.cc | 2 + tests/vars/function_shadow_local.cc | 2 + tests/vars/function_shadow_param.cc | 2 + tests/vars/global_variable.cc | 1 + tests/vars/global_variable_decl_only.cc | 1 + tests/vars/type_instance_on_using_type.cc | 1 + 71 files changed, 174 insertions(+), 19 deletions(-) diff --git a/src/command_line.cc b/src/command_line.cc index 1bc06ccd..246fff95 100644 --- a/src/command_line.cc +++ b/src/command_line.cc @@ -647,12 +647,13 @@ struct CommonCodeLensParams { }; void AddCodeLens( - CommonCodeLensParams* common, - QueryLocation loc, - const std::vector& uses, - const char* singular, - const char* plural, - bool exclude_loc = false) { + const char* singular, + const char* plural, + CommonCodeLensParams* common, + QueryLocation loc, + const std::vector& uses, + optional excluded, + bool force_display) { TCodeLens code_lens; optional range = GetLsRange(common->working_file, loc.range); if (!range) @@ -666,7 +667,7 @@ void AddCodeLens( // Add unique uses. std::unordered_set unique_uses; for (const QueryLocation& use : uses) { - if (exclude_loc && use == loc) + if (excluded == use) continue; optional location = GetLsLocation(common->db, common->working_files, use); if (!location) @@ -684,7 +685,7 @@ void AddCodeLens( else code_lens.command->title += plural; - if (exclude_loc || unique_uses.size() > 0) + if (force_display || unique_uses.size() > 0) common->result->push_back(code_lens); } @@ -2155,9 +2156,9 @@ bool QueryDbMainLoop( optional& type = db->types[symbol.idx]; if (!type) continue; - AddCodeLens(&common, ref.loc.OffsetStartColumn(0), type->uses, "ref", "refs"); - AddCodeLens(&common, ref.loc.OffsetStartColumn(1), ToQueryLocation(db, type->derived), "derived", "derived"); - AddCodeLens(&common, ref.loc.OffsetStartColumn(2), ToQueryLocation(db, type->instances), "var", "vars"); + AddCodeLens("ref", "refs", &common, ref.loc.OffsetStartColumn(0), type->uses, type->def.definition_spelling, true /*force_display*/); + AddCodeLens("derived", "derived", &common, ref.loc.OffsetStartColumn(1), ToQueryLocation(db, type->derived), nullopt, false /*force_display*/); + AddCodeLens("var", "vars", &common, ref.loc.OffsetStartColumn(2), ToQueryLocation(db, type->instances), nullopt, false /*force_display*/); break; } case SymbolKind::Func: { @@ -2170,18 +2171,17 @@ bool QueryDbMainLoop( std::vector base_callers = GetCallersForAllBaseFunctions(db, *func); std::vector derived_callers = GetCallersForAllDerivedFunctions(db, *func); if (base_callers.empty() && derived_callers.empty()) { - // set exclude_loc to true to force the code lens to show up - AddCodeLens(&common, ref.loc.OffsetStartColumn(offset++), ToQueryLocation(db, func->callers), "call", "calls", true /*exclude_loc*/); + AddCodeLens("call", "calls", &common, ref.loc.OffsetStartColumn(offset++), ToQueryLocation(db, func->callers), nullopt, true /*force_display*/); } else { - AddCodeLens(&common, ref.loc.OffsetStartColumn(offset++), ToQueryLocation(db, func->callers), "direct call", "direct calls"); + AddCodeLens("direct call", "direct calls", &common, ref.loc.OffsetStartColumn(offset++), ToQueryLocation(db, func->callers), nullopt, false /*force_display*/); if (!base_callers.empty()) - AddCodeLens(&common, ref.loc.OffsetStartColumn(offset++), ToQueryLocation(db, base_callers), "base call", "base calls"); + AddCodeLens("base call", "base calls", &common, ref.loc.OffsetStartColumn(offset++), ToQueryLocation(db, base_callers), nullopt, false /*force_display*/); if (!derived_callers.empty()) - AddCodeLens(&common, ref.loc.OffsetStartColumn(offset++), ToQueryLocation(db, derived_callers), "derived call", "derived calls"); + AddCodeLens("derived call", "derived calls", &common, ref.loc.OffsetStartColumn(offset++), ToQueryLocation(db, derived_callers), nullopt, false /*force_display*/); } - AddCodeLens(&common, ref.loc.OffsetStartColumn(offset++), ToQueryLocation(db, func->derived), "derived", "derived"); + AddCodeLens("derived", "derived", &common, ref.loc.OffsetStartColumn(offset++), ToQueryLocation(db, func->derived), nullopt, false /*force_display*/); // "Base" optional base_loc = GetBaseDefinitionOrDeclarationSpelling(db, *func); @@ -2210,7 +2210,10 @@ bool QueryDbMainLoop( if (!var) continue; - AddCodeLens(&common, ref.loc.OffsetStartColumn(0), var->uses, "ref", "refs", true /*exclude_loc*/); + if (var->def.is_local && !config->codeLensOnLocalVariables) + continue; + + AddCodeLens("ref", "refs", &common, ref.loc.OffsetStartColumn(0), var->uses, var->def.definition_spelling, true /*force_display*/); break; } case SymbolKind::File: diff --git a/src/indexer.cc b/src/indexer.cc index dddb65e7..d27d0960 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -107,7 +107,7 @@ struct IndexParam { IndexFile* ConsumeFile(IndexParam* param, CXFile file) { bool is_first_ownership = false; IndexFile* db = param->file_consumer->TryConsumeFile(file, &is_first_ownership); - + // Mark dependency in primary file. If primary_file is null that means we're // doing a re-index in which case the dependency has already been established // in a previous index run. @@ -130,6 +130,20 @@ IndexFile* ConsumeFile(IndexParam* param, CXFile file) { return db; } +bool IsLocalSemanticContainer(CXCursorKind kind) { + switch (kind) { + case CXCursor_Namespace: + case CXCursor_TranslationUnit: + case CXCursor_StructDecl: + case CXCursor_UnionDecl: + case CXCursor_ClassDecl: + case CXCursor_EnumDecl: + return false; + default: + return true; + } +} + } // namespace @@ -806,6 +820,9 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) { std::string type_name = clang::ToString(clang_getTypeSpelling(clang_getCursorType(decl->cursor))); var_def->def.detailed_name = type_name + " " + ns->QualifiedName(decl->semanticContainer, var_def->def.short_name); + + var_def->def.is_local = !decl->semanticContainer || IsLocalSemanticContainer(decl->semanticContainer->cursor.kind); + //} if (decl->isDefinition) { diff --git a/src/indexer.h b/src/indexer.h index 6dbe5dc8..b0a3c348 100644 --- a/src/indexer.h +++ b/src/indexer.h @@ -404,6 +404,9 @@ struct VarDefDefinitionData { // Type which declares this one (ie, it is a method) optional declaring_type; + // Is this a "local" variable, ie, a parameter or function variable? + bool is_local = false; + VarDefDefinitionData() {} // For reflection. VarDefDefinitionData(const std::string& usr) : usr(usr) {} @@ -448,6 +451,7 @@ void Reflect(TVisitor& visitor, REFLECT_MEMBER(definition_extent); REFLECT_MEMBER(variable_type); REFLECT_MEMBER(declaring_type); + REFLECT_MEMBER(is_local); REFLECT_MEMBER_END(); } diff --git a/src/language_server_api.h b/src/language_server_api.h index 34c6d519..1568258b 100644 --- a/src/language_server_api.h +++ b/src/language_server_api.h @@ -74,6 +74,9 @@ struct IndexerConfig { // If false, the index will not be loaded from a previous run. bool enableCacheRead = true; + // Enables code lens on parameter and function variables. + bool codeLensOnLocalVariables = true; + // Version of the client. int clientVersion = 0; }; @@ -86,6 +89,8 @@ MAKE_REFLECT_STRUCT(IndexerConfig, indexerCount, enableIndexing, enableCacheWrite, enableCacheRead, + codeLensOnLocalVariables, + clientVersion); diff --git a/src/query.cc b/src/query.cc index c8870fad..330bdccf 100644 --- a/src/query.cc +++ b/src/query.cc @@ -54,6 +54,7 @@ QueryVar::DefUpdate ToQuery(const IdMap& id_map, const IndexVar::Def& var) { result.definition_extent = id_map.ToQuery(var.definition_extent); result.variable_type = id_map.ToQuery(var.variable_type); result.declaring_type = id_map.ToQuery(var.declaring_type); + result.is_local = var.is_local; return result; } diff --git a/src/serializer.cc b/src/serializer.cc index 59085700..2094d8ee 100644 --- a/src/serializer.cc +++ b/src/serializer.cc @@ -172,6 +172,7 @@ void Reflect(TVisitor& visitor, IndexVar& value) { REFLECT_MEMBER2("definition_extent", value.def.definition_extent); REFLECT_MEMBER2("variable_type", value.def.variable_type); REFLECT_MEMBER2("declaring_type", value.def.declaring_type); + REFLECT_MEMBER2("is_local", value.def.is_local); REFLECT_MEMBER2("uses", value.uses); REFLECT_MEMBER_END(); } diff --git a/tests/constructors/constructor.cc b/tests/constructors/constructor.cc index 896a09ad..57fb1dc3 100644 --- a/tests/constructors/constructor.cc +++ b/tests/constructors/constructor.cc @@ -48,6 +48,7 @@ OUTPUT: "definition_spelling": "7:7-7:8", "definition_extent": "7:3-7:8", "variable_type": 0, + "is_local": true, "uses": ["7:7-7:8"] }, { "id": 1, @@ -57,6 +58,7 @@ OUTPUT: "definition_spelling": "8:8-8:10", "definition_extent": "8:3-8:22", "variable_type": 0, + "is_local": true, "uses": ["8:8-8:10"] }] } diff --git a/tests/constructors/destructor.cc b/tests/constructors/destructor.cc index 1cefe882..bbe4e416 100644 --- a/tests/constructors/destructor.cc +++ b/tests/constructors/destructor.cc @@ -61,6 +61,7 @@ OUTPUT: "definition_spelling": "8:7-8:8", "definition_extent": "8:3-8:8", "variable_type": 0, + "is_local": true, "uses": ["8:7-8:8"] }] } diff --git a/tests/declaration_vs_definition/class_member.cc b/tests/declaration_vs_definition/class_member.cc index 5716e0ba..3e2412c0 100644 --- a/tests/declaration_vs_definition/class_member.cc +++ b/tests/declaration_vs_definition/class_member.cc @@ -23,6 +23,7 @@ OUTPUT: "definition_spelling": "2:7-2:10", "definition_extent": "2:3-2:10", "declaring_type": 0, + "is_local": false, "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 bb71cea4..fffa5ab6 100644 --- a/tests/declaration_vs_definition/class_member_static.cc +++ b/tests/declaration_vs_definition/class_member_static.cc @@ -26,6 +26,7 @@ OUTPUT: "definition_spelling": "5:10-5:13", "definition_extent": "5:1-5:13", "declaring_type": 0, + "is_local": false, "uses": ["2:14-2:17", "5:10-5:13"] }] } diff --git a/tests/enums/enum_class_decl.cc b/tests/enums/enum_class_decl.cc index a64669c0..d1a5aa30 100644 --- a/tests/enums/enum_class_decl.cc +++ b/tests/enums/enum_class_decl.cc @@ -25,6 +25,7 @@ OUTPUT: "definition_extent": "2:3-2:4", "variable_type": 0, "declaring_type": 0, + "is_local": false, "uses": ["2:3-2:4"] }, { "id": 1, @@ -35,6 +36,7 @@ OUTPUT: "definition_extent": "3:3-3:9", "variable_type": 0, "declaring_type": 0, + "is_local": false, "uses": ["3:3-3:4"] }] } diff --git a/tests/enums/enum_decl.cc b/tests/enums/enum_decl.cc index cbf5deb9..c0ddcc9d 100644 --- a/tests/enums/enum_decl.cc +++ b/tests/enums/enum_decl.cc @@ -25,6 +25,7 @@ OUTPUT: "definition_extent": "2:3-2:4", "variable_type": 0, "declaring_type": 0, + "is_local": false, "uses": ["2:3-2:4"] }, { "id": 1, @@ -35,6 +36,7 @@ OUTPUT: "definition_extent": "3:3-3:9", "variable_type": 0, "declaring_type": 0, + "is_local": false, "uses": ["3:3-3:4"] }] } diff --git a/tests/enums/enum_inherit.cc b/tests/enums/enum_inherit.cc index b7db7867..b7320f7a 100644 --- a/tests/enums/enum_inherit.cc +++ b/tests/enums/enum_inherit.cc @@ -25,6 +25,7 @@ OUTPUT: "definition_extent": "2:3-2:4", "variable_type": 0, "declaring_type": 0, + "is_local": false, "uses": ["2:3-2:4"] }, { "id": 1, @@ -35,6 +36,7 @@ OUTPUT: "definition_extent": "3:3-3:9", "variable_type": 0, "declaring_type": 0, + "is_local": false, "uses": ["3:3-3:4"] }] } diff --git a/tests/enums/enum_usage.cc b/tests/enums/enum_usage.cc index aff847a4..b79b218a 100644 --- a/tests/enums/enum_usage.cc +++ b/tests/enums/enum_usage.cc @@ -28,6 +28,7 @@ OUTPUT: "definition_extent": "2:3-2:4", "variable_type": 0, "declaring_type": 0, + "is_local": false, "uses": ["2:3-2:4", "6:14-6:15"] }, { "id": 1, @@ -38,6 +39,7 @@ OUTPUT: "definition_extent": "3:3-3:9", "variable_type": 0, "declaring_type": 0, + "is_local": false, "uses": ["3:3-3:4"] }, { "id": 2, @@ -47,6 +49,7 @@ OUTPUT: "definition_spelling": "6:5-6:6", "definition_extent": "6:1-6:15", "variable_type": 0, + "is_local": false, "uses": ["6:5-6:6"] }] } diff --git a/tests/foobar.cc b/tests/foobar.cc index e2c8d3d6..b2e0dea8 100644 --- a/tests/foobar.cc +++ b/tests/foobar.cc @@ -54,6 +54,7 @@ OUTPUT: "definition_spelling": "9:15-9:16", "definition_extent": "9:1-9:16", "variable_type": 3, + "is_local": false, "uses": ["9:15-9:16"] }, { "id": 1, @@ -63,6 +64,7 @@ OUTPUT: "definition_spelling": "10:8-10:9", "definition_extent": "10:1-10:9", "variable_type": 2, + "is_local": false, "uses": ["10:8-10:9"] }] } diff --git a/tests/multi_file/funky_enum.cc b/tests/multi_file/funky_enum.cc index eb2c4ff3..f17e49a3 100644 --- a/tests/multi_file/funky_enum.cc +++ b/tests/multi_file/funky_enum.cc @@ -22,6 +22,7 @@ OUTPUT: funky_enum.h "definition_extent": "4:1-4:2", "variable_type": 0, "declaring_type": 0, + "is_local": false, "uses": ["4:1-4:2"] }, { "id": 1, @@ -32,6 +33,7 @@ OUTPUT: funky_enum.h "definition_extent": "5:1-5:2", "variable_type": 0, "declaring_type": 0, + "is_local": false, "uses": ["5:1-5:2"] }, { "id": 2, @@ -42,6 +44,7 @@ OUTPUT: funky_enum.h "definition_extent": "6:1-6:2", "variable_type": 0, "declaring_type": 0, + "is_local": false, "uses": ["6:1-6:2"] }] } diff --git a/tests/multi_file/impl.cc b/tests/multi_file/impl.cc index 85e9cd4e..2a9ffb5b 100644 --- a/tests/multi_file/impl.cc +++ b/tests/multi_file/impl.cc @@ -69,6 +69,7 @@ OUTPUT: header.h "definition_extent": "15:13-15:14", "variable_type": 4, "declaring_type": 4, + "is_local": false, "uses": ["15:13-15:14"] }, { "id": 1, @@ -79,6 +80,7 @@ OUTPUT: header.h "definition_extent": "15:16-15:17", "variable_type": 4, "declaring_type": 4, + "is_local": false, "uses": ["15:16-15:17"] }, { "id": 2, @@ -89,6 +91,7 @@ OUTPUT: header.h "definition_extent": "15:19-15:20", "variable_type": 4, "declaring_type": 4, + "is_local": false, "uses": ["15:19-15:20"] }, { "id": 3, @@ -97,6 +100,7 @@ OUTPUT: header.h "detailed_name": "int Foo4", "definition_spelling": "17:5-17:9", "definition_extent": "17:1-17:9", + "is_local": false, "uses": ["17:5-17:9"] }, { "id": 4, @@ -105,6 +109,7 @@ OUTPUT: header.h "detailed_name": "int Foo5", "definition_spelling": "18:12-18:16", "definition_extent": "18:1-18:16", + "is_local": false, "uses": ["18:12-18:16"] }] } diff --git a/tests/namespaces/namespace_reference.cc b/tests/namespaces/namespace_reference.cc index 17566a6a..c161d7b4 100644 --- a/tests/namespaces/namespace_reference.cc +++ b/tests/namespaces/namespace_reference.cc @@ -36,6 +36,7 @@ OUTPUT: "detailed_name": "int ns::Foo", "definition_spelling": "2:7-2:10", "definition_extent": "2:3-2:10", + "is_local": false, "uses": ["2:7-2:10", "7:18-7:21", "9:10-9:13"] }, { "id": 1, @@ -44,6 +45,7 @@ OUTPUT: "detailed_name": "int a", "definition_spelling": "3:19-3:20", "definition_extent": "3:15-3:20", + "is_local": true, "uses": ["3:19-3:20"] }] } diff --git a/tests/outline/outline.cc b/tests/outline/outline.cc index 340dfed0..42db8304 100644 --- a/tests/outline/outline.cc +++ b/tests/outline/outline.cc @@ -33,6 +33,7 @@ OUTPUT: "definition_spelling": "4:7-4:8", "definition_extent": "4:3-4:8", "declaring_type": 0, + "is_local": false, "uses": ["4:7-4:8"] }, { "id": 1, @@ -42,6 +43,7 @@ OUTPUT: "definition_spelling": "5:7-5:8", "definition_extent": "5:3-5:8", "declaring_type": 0, + "is_local": false, "uses": ["5:7-5:8"] }, { "id": 2, @@ -52,6 +54,7 @@ OUTPUT: "definition_extent": "6:3-6:26", "variable_type": 1, "declaring_type": 0, + "is_local": false, "uses": ["6:20-6:26"] }] } diff --git a/tests/outline/outline2.cc b/tests/outline/outline2.cc index 5724aa5f..12402466 100644 --- a/tests/outline/outline2.cc +++ b/tests/outline/outline2.cc @@ -51,6 +51,7 @@ OUTPUT: "definition_extent": "7:3-7:24", "variable_type": 1, "declaring_type": 0, + "is_local": false, "uses": ["7:15-7:24"] }, { "id": 1, @@ -61,6 +62,7 @@ OUTPUT: "definition_extent": "8:3-8:23", "variable_type": 1, "declaring_type": 0, + "is_local": false, "uses": ["8:15-8:23"] }, { "id": 2, @@ -71,6 +73,7 @@ OUTPUT: "definition_extent": "9:3-9:32", "variable_type": 2, "declaring_type": 0, + "is_local": false, "uses": ["9:28-9:32"] }] } diff --git a/tests/templates/implicit_variable_instantiation.cc b/tests/templates/implicit_variable_instantiation.cc index b556e3fe..6a72d0e7 100644 --- a/tests/templates/implicit_variable_instantiation.cc +++ b/tests/templates/implicit_variable_instantiation.cc @@ -46,6 +46,7 @@ OUTPUT: "definition_extent": "9:3-10:47", "variable_type": 0, "declaring_type": 1, + "is_local": false, "uses": ["6:30-6:40", "10:37-10:47", "13:26-13:36", "14:27-14:37"] }, { "id": 1, @@ -54,6 +55,7 @@ OUTPUT: "detailed_name": "int ns::Foo", "definition_spelling": "13:7-13:10", "definition_extent": "13:3-13:36", + "is_local": false, "uses": ["13:7-13:10"] }, { "id": 2, @@ -62,6 +64,7 @@ OUTPUT: "detailed_name": "int ns::Foo2", "definition_spelling": "14:7-14:11", "definition_extent": "14:3-14:37", + "is_local": 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 50fdea22..31f4ac70 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 @@ -41,6 +41,7 @@ OUTPUT: "detailed_name": "int ns::a", "definition_spelling": "10:7-10:8", "definition_extent": "10:3-10:33", + "is_local": false, "uses": ["10:7-10:8"] }, { "id": 1, @@ -49,6 +50,7 @@ OUTPUT: "detailed_name": "int ns::b", "definition_spelling": "11:7-11:8", "definition_extent": "11:3-11:35", + "is_local": 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 a9e52526..58fe24de 100644 --- a/tests/templates/namespace_template_type_usage_folded_into_one.cc +++ b/tests/templates/namespace_template_type_usage_folded_into_one.cc @@ -27,6 +27,7 @@ OUTPUT: "definition_spelling": "5:12-5:13", "definition_extent": "5:3-5:13", "variable_type": 0, + "is_local": false, "uses": ["5:12-5:13"] }, { "id": 1, @@ -36,6 +37,7 @@ OUTPUT: "definition_spelling": "6:13-6:14", "definition_extent": "6:3-6:14", "variable_type": 0, + "is_local": 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 423c421d..603f28a5 100644 --- a/tests/templates/template_class_func_usage_folded_into_one.cc +++ b/tests/templates/template_class_func_usage_folded_into_one.cc @@ -38,6 +38,7 @@ OUTPUT: "detailed_name": "int a", "definition_spelling": "8:5-8:6", "definition_extent": "8:1-8:24", + "is_local": false, "uses": ["8:5-8:6"] }, { "id": 1, @@ -46,6 +47,7 @@ OUTPUT: "detailed_name": "int b", "definition_spelling": "9:5-9:6", "definition_extent": "9:1-9:25", + "is_local": 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 efea301a..31708202 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 @@ -39,6 +39,7 @@ OUTPUT: "detailed_name": "int a", "definition_spelling": "9:5-9:6", "definition_extent": "9:1-9:31", + "is_local": false, "uses": ["9:5-9:6"] }, { "id": 1, @@ -47,6 +48,7 @@ OUTPUT: "detailed_name": "int b", "definition_spelling": "10:5-10:6", "definition_extent": "10:1-10:33", + "is_local": 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 289b330b..f8e7d23a 100644 --- a/tests/templates/template_class_type_usage_folded_into_one.cc +++ b/tests/templates/template_class_type_usage_folded_into_one.cc @@ -73,6 +73,7 @@ OUTPUT: "definition_spelling": "9:15-9:16", "definition_extent": "9:1-9:16", "variable_type": 3, + "is_local": false, "uses": ["9:15-9:16"] }, { "id": 1, @@ -82,6 +83,7 @@ OUTPUT: "definition_spelling": "10:15-10:16", "definition_extent": "10:1-10:16", "variable_type": 3, + "is_local": 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 ae224965..fbf61273 100644 --- a/tests/templates/template_class_var_usage_folded_into_one.cc +++ b/tests/templates/template_class_var_usage_folded_into_one.cc @@ -24,6 +24,7 @@ OUTPUT: "short_name": "var", "detailed_name": "const int Foo::var", "declaration": "3:24-3:27", + "is_local": false, "uses": ["3:24-3:27", "6:19-6:22", "7:20-7:23"] }, { "id": 1, @@ -32,6 +33,7 @@ OUTPUT: "detailed_name": "int a", "definition_spelling": "6:5-6:6", "definition_extent": "6:1-6:22", + "is_local": false, "uses": ["6:5-6:6"] }, { "id": 2, @@ -40,6 +42,7 @@ OUTPUT: "detailed_name": "int b", "definition_spelling": "7:5-7:6", "definition_extent": "7:1-7:23", + "is_local": 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 dad74234..8a377f72 100644 --- a/tests/templates/template_func_usage_folded_into_one.cc +++ b/tests/templates/template_func_usage_folded_into_one.cc @@ -28,6 +28,7 @@ OUTPUT: "detailed_name": "int a", "definition_spelling": "6:5-6:6", "definition_extent": "6:1-6:19", + "is_local": false, "uses": ["6:5-6:6"] }, { "id": 1, @@ -36,6 +37,7 @@ OUTPUT: "detailed_name": "int b", "definition_spelling": "7:5-7:6", "definition_extent": "7:1-7:20", + "is_local": 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 a8b745ed..1f7bb6e9 100644 --- a/tests/templates/template_type_usage_folded_into_one.cc +++ b/tests/templates/template_type_usage_folded_into_one.cc @@ -25,6 +25,7 @@ OUTPUT: "definition_spelling": "4:10-4:11", "definition_extent": "4:1-4:11", "variable_type": 0, + "is_local": false, "uses": ["4:10-4:11"] }, { "id": 1, @@ -34,6 +35,7 @@ OUTPUT: "definition_spelling": "5:11-5:12", "definition_extent": "5:1-5:12", "variable_type": 0, + "is_local": 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 2bbe34bd..3246e14d 100644 --- a/tests/templates/template_var_usage_folded_into_one.cc +++ b/tests/templates/template_var_usage_folded_into_one.cc @@ -59,6 +59,7 @@ OUTPUT: "detailed_name": "T var", "definition_spelling": "5:3-5:6", "definition_extent": "5:1-5:10", + "is_local": false, "uses": ["5:3-5:6", "7:9-7:12", "8:9-8:12"] }, { "id": 1, @@ -67,6 +68,7 @@ OUTPUT: "detailed_name": "int a", "definition_spelling": "7:5-7:6", "definition_extent": "7:1-7:15", + "is_local": false, "uses": ["7:5-7:6"] }, { "id": 2, @@ -75,6 +77,7 @@ OUTPUT: "detailed_name": "int b", "definition_spelling": "8:5-8:6", "definition_extent": "8:1-8:15", + "is_local": false, "uses": ["8:5-8:6"] }] } diff --git a/tests/types/anonymous_struct.cc b/tests/types/anonymous_struct.cc index b1091372..145af704 100644 --- a/tests/types/anonymous_struct.cc +++ b/tests/types/anonymous_struct.cc @@ -33,6 +33,7 @@ OUTPUT: "definition_spelling": "2:18-2:19", "definition_extent": "2:12-2:19", "declaring_type": 1, + "is_local": false, "uses": ["2:18-2:19"] }, { "id": 1, @@ -42,6 +43,7 @@ OUTPUT: "definition_spelling": "2:21-2:22", "definition_extent": "2:12-2:22", "declaring_type": 1, + "is_local": false, "uses": ["2:21-2:22"] }, { "id": 2, @@ -51,6 +53,7 @@ OUTPUT: "definition_spelling": "2:24-2:25", "definition_extent": "2:12-2:25", "declaring_type": 1, + "is_local": false, "uses": ["2:24-2:25"] }, { "id": 3, @@ -60,6 +63,7 @@ OUTPUT: "definition_spelling": "3:9-3:10", "definition_extent": "3:3-3:13", "declaring_type": 0, + "is_local": false, "uses": ["3:9-3:10"] }] } diff --git a/tests/unions/union_decl.cc b/tests/unions/union_decl.cc index f72c3bcd..2bf9e6c0 100644 --- a/tests/unions/union_decl.cc +++ b/tests/unions/union_decl.cc @@ -24,6 +24,7 @@ OUTPUT: "definition_spelling": "2:7-2:8", "definition_extent": "2:3-2:8", "declaring_type": 0, + "is_local": false, "uses": ["2:7-2:8"] }, { "id": 1, @@ -33,6 +34,7 @@ OUTPUT: "definition_spelling": "3:8-3:9", "definition_extent": "3:3-3:9", "declaring_type": 0, + "is_local": false, "uses": ["3:8-3:9"] }] } diff --git a/tests/unions/union_usage.cc b/tests/unions/union_usage.cc index 4d501722..82b6b772 100644 --- a/tests/unions/union_usage.cc +++ b/tests/unions/union_usage.cc @@ -41,6 +41,7 @@ OUTPUT: "definition_spelling": "2:7-2:8", "definition_extent": "2:3-2:12", "declaring_type": 0, + "is_local": false, "uses": ["2:7-2:8", "9:5-9:6"] }, { "id": 1, @@ -50,6 +51,7 @@ OUTPUT: "definition_spelling": "3:8-3:9", "definition_extent": "3:3-3:13", "declaring_type": 0, + "is_local": false, "uses": ["3:8-3:9"] }, { "id": 2, @@ -59,6 +61,7 @@ OUTPUT: "definition_spelling": "6:5-6:6", "definition_extent": "6:1-6:6", "variable_type": 0, + "is_local": false, "uses": ["6:5-6:6", "9:3-9:4"] }] } diff --git a/tests/usage/func_usage_addr_func.cc b/tests/usage/func_usage_addr_func.cc index 0bf2261f..cf49d619 100644 --- a/tests/usage/func_usage_addr_func.cc +++ b/tests/usage/func_usage_addr_func.cc @@ -42,6 +42,7 @@ OUTPUT: "detailed_name": "void (*)() x", "definition_spelling": "6:8-6:9", "definition_extent": "6:3-6:17", + "is_local": true, "uses": ["6:8-6:9"] }] } diff --git a/tests/usage/func_usage_addr_method.cc b/tests/usage/func_usage_addr_method.cc index 9ec5b89b..8d50398f 100644 --- a/tests/usage/func_usage_addr_method.cc +++ b/tests/usage/func_usage_addr_method.cc @@ -44,6 +44,7 @@ OUTPUT: "detailed_name": "void (Foo::*)() x", "definition_spelling": "6:8-6:9", "definition_extent": "6:3-6:22", + "is_local": true, "uses": ["6:8-6:9"] }] } diff --git a/tests/usage/func_usage_call_method.cc b/tests/usage/func_usage_call_method.cc index 3c99f60b..e6637294 100644 --- a/tests/usage/func_usage_call_method.cc +++ b/tests/usage/func_usage_call_method.cc @@ -46,6 +46,7 @@ OUTPUT: "definition_spelling": "6:8-6:9", "definition_extent": "6:3-6:19", "variable_type": 0, + "is_local": true, "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 460af4b2..dd2ffe89 100644 --- a/tests/usage/func_usage_class_inline_var_def.cc +++ b/tests/usage/func_usage_class_inline_var_def.cc @@ -36,6 +36,7 @@ OUTPUT: "definition_spelling": "6:7-6:8", "definition_extent": "6:3-6:19", "declaring_type": 0, + "is_local": 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 4f612e6d..1777937c 100644 --- a/tests/usage/func_usage_forward_decl_method.cc +++ b/tests/usage/func_usage_forward_decl_method.cc @@ -45,6 +45,7 @@ OUTPUT: "definition_spelling": "6:8-6:9", "definition_extent": "6:3-6:19", "variable_type": 0, + "is_local": true, "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 57a4e41e..f6c2d6a8 100644 --- a/tests/usage/type_usage_as_template_parameter.cc +++ b/tests/usage/type_usage_as_template_parameter.cc @@ -43,6 +43,7 @@ OUTPUT: "definition_spelling": "6:25-6:27", "definition_extent": "6:1-6:27", "variable_type": 0, + "is_local": false, "uses": ["6:25-6:27"] }, { "id": 1, @@ -52,6 +53,7 @@ OUTPUT: "definition_spelling": "7:22-7:24", "definition_extent": "7:1-7:24", "variable_type": 0, + "is_local": false, "uses": ["7:22-7:24"] }, { "id": 2, @@ -61,6 +63,7 @@ OUTPUT: "definition_spelling": "10:18-10:23", "definition_extent": "10:3-10:23", "variable_type": 0, + "is_local": true, "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 022d843a..06c7a904 100644 --- a/tests/usage/type_usage_as_template_parameter_complex.cc +++ b/tests/usage/type_usage_as_template_parameter_complex.cc @@ -143,6 +143,7 @@ OUTPUT: "detailed_name": "unique_ptr, S2> f", "declaration": "15:43-15:44", "variable_type": 0, + "is_local": false, "uses": ["15:43-15:44"] }, { "id": 1, @@ -152,6 +153,7 @@ OUTPUT: "definition_spelling": "54:39-54:44", "definition_extent": "54:3-54:44", "variable_type": 0, + "is_local": true, "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 e7cd25fc..d8636ab2 100644 --- a/tests/usage/type_usage_as_template_parameter_simple.cc +++ b/tests/usage/type_usage_as_template_parameter_simple.cc @@ -30,6 +30,7 @@ OUTPUT: "definition_spelling": "6:22-6:25", "definition_extent": "6:1-6:25", "variable_type": 0, + "is_local": 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 efaeec8a..d769e8ec 100644 --- a/tests/usage/type_usage_declare_extern.cc +++ b/tests/usage/type_usage_declare_extern.cc @@ -21,6 +21,7 @@ OUTPUT: "detailed_name": "T t", "declaration": "3:10-3:11", "variable_type": 0, + "is_local": 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 064eb2ff..e79e3b71 100644 --- a/tests/usage/type_usage_declare_field.cc +++ b/tests/usage/type_usage_declare_field.cc @@ -42,6 +42,7 @@ OUTPUT: "definition_extent": "5:3-5:17", "variable_type": 0, "declaring_type": 2, + "is_local": false, "uses": ["5:16-5:17"] }, { "id": 1, @@ -52,6 +53,7 @@ OUTPUT: "definition_extent": "6:3-6:20", "variable_type": 1, "declaring_type": 2, + "is_local": false, "uses": ["6:19-6:20"] }] } diff --git a/tests/usage/type_usage_declare_local.cc b/tests/usage/type_usage_declare_local.cc index dd0b2ead..8886a234 100644 --- a/tests/usage/type_usage_declare_local.cc +++ b/tests/usage/type_usage_declare_local.cc @@ -40,6 +40,7 @@ OUTPUT: "definition_spelling": "5:16-5:17", "definition_extent": "5:3-5:17", "variable_type": 0, + "is_local": true, "uses": ["5:16-5:17"] }, { "id": 1, @@ -49,6 +50,7 @@ OUTPUT: "definition_spelling": "6:19-6:20", "definition_extent": "6:3-6:20", "variable_type": 1, + "is_local": true, "uses": ["6:19-6:20"] }] } diff --git a/tests/usage/type_usage_declare_param.cc b/tests/usage/type_usage_declare_param.cc index f6b8f9db..28bfadeb 100644 --- a/tests/usage/type_usage_declare_param.cc +++ b/tests/usage/type_usage_declare_param.cc @@ -37,6 +37,7 @@ OUTPUT: "definition_spelling": "4:23-4:24", "definition_extent": "4:10-4:24", "variable_type": 0, + "is_local": true, "uses": ["4:23-4:24"] }, { "id": 1, @@ -46,6 +47,7 @@ OUTPUT: "definition_spelling": "4:42-4:43", "definition_extent": "4:26-4:43", "variable_type": 1, + "is_local": true, "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 f11532c0..82280ec4 100644 --- a/tests/usage/type_usage_declare_param_prototype.cc +++ b/tests/usage/type_usage_declare_param_prototype.cc @@ -34,6 +34,7 @@ OUTPUT: "definition_spelling": "4:15-4:16", "definition_extent": "4:10-4:16", "variable_type": 0, + "is_local": true, "uses": ["4:15-4:16"] }] } diff --git a/tests/usage/type_usage_declare_qualifiers.cc b/tests/usage/type_usage_declare_qualifiers.cc index 9983c073..93a2fc72 100644 --- a/tests/usage/type_usage_declare_qualifiers.cc +++ b/tests/usage/type_usage_declare_qualifiers.cc @@ -35,6 +35,7 @@ OUTPUT: "definition_spelling": "3:16-3:18", "definition_extent": "3:10-3:18", "variable_type": 0, + "is_local": true, "uses": ["3:16-3:18"] }, { "id": 1, @@ -44,6 +45,7 @@ OUTPUT: "definition_spelling": "3:32-3:34", "definition_extent": "3:20-3:34", "variable_type": 0, + "is_local": true, "uses": ["3:32-3:34"] }, { "id": 2, @@ -53,6 +55,7 @@ OUTPUT: "definition_spelling": "4:8-4:10", "definition_extent": "4:3-4:10", "variable_type": 0, + "is_local": true, "uses": ["4:8-4:10"] }, { "id": 3, @@ -62,6 +65,7 @@ OUTPUT: "definition_spelling": "5:9-5:11", "definition_extent": "5:3-5:11", "variable_type": 0, + "is_local": true, "uses": ["5:9-5:11"] }, { "id": 4, @@ -71,6 +75,7 @@ OUTPUT: "definition_spelling": "6:15-6:17", "definition_extent": "6:3-6:17", "variable_type": 0, + "is_local": true, "uses": ["6:15-6:17"] }, { "id": 5, @@ -80,6 +85,7 @@ OUTPUT: "definition_spelling": "7:21-7:23", "definition_extent": "7:3-7:23", "variable_type": 0, + "is_local": true, "uses": ["7:21-7:23"] }] } diff --git a/tests/usage/type_usage_declare_static.cc b/tests/usage/type_usage_declare_static.cc index 1374b055..25c9acf5 100644 --- a/tests/usage/type_usage_declare_static.cc +++ b/tests/usage/type_usage_declare_static.cc @@ -17,6 +17,7 @@ OUTPUT: "definition_spelling": "2:13-2:14", "definition_extent": "2:1-2:14", "variable_type": 0, + "is_local": false, "uses": ["2:13-2:14"] }] } diff --git a/tests/usage/type_usage_various.cc b/tests/usage/type_usage_various.cc index fe4dc2d6..bc31d216 100644 --- a/tests/usage/type_usage_various.cc +++ b/tests/usage/type_usage_various.cc @@ -41,6 +41,7 @@ OUTPUT: "definition_spelling": "6:7-6:8", "definition_extent": "6:3-6:8", "variable_type": 0, + "is_local": true, "uses": ["6:7-6:8"] }, { "id": 1, @@ -49,6 +50,7 @@ OUTPUT: "detailed_name": "Foo foo", "declaration": "10:12-10:15", "variable_type": 0, + "is_local": 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 3feb1714..457061bc 100644 --- a/tests/usage/usage_inside_of_call.cc +++ b/tests/usage/usage_inside_of_call.cc @@ -59,6 +59,7 @@ OUTPUT: "definition_spelling": "10:10-10:20", "definition_extent": "10:1-10:24", "declaring_type": 0, + "is_local": false, "uses": ["6:14-6:24", "10:10-10:20", "14:45-14:55"] }, { "id": 1, @@ -68,6 +69,7 @@ OUTPUT: "definition_spelling": "7:7-7:16", "definition_extent": "7:3-7:16", "declaring_type": 0, + "is_local": false, "uses": ["7:7-7:16", "14:28-14:37"] }, { "id": 2, @@ -76,6 +78,7 @@ OUTPUT: "detailed_name": "int a", "definition_spelling": "13:7-13:8", "definition_extent": "13:3-13:12", + "is_local": true, "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 2d411d1d..ef9ede0f 100644 --- a/tests/usage/var_usage_call_function.cc +++ b/tests/usage/var_usage_call_function.cc @@ -34,6 +34,7 @@ OUTPUT: "detailed_name": "void (*)() x", "definition_spelling": "4:8-4:9", "definition_extent": "4:3-4:19", + "is_local": true, "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 71c0de6b..28d4ad30 100644 --- a/tests/usage/var_usage_class_member.cc +++ b/tests/usage/var_usage_class_member.cc @@ -62,6 +62,7 @@ OUTPUT: "definition_spelling": "3:7-3:8", "definition_extent": "3:3-3:8", "declaring_type": 0, + "is_local": 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, @@ -71,6 +72,7 @@ OUTPUT: "definition_spelling": "4:7-4:8", "definition_extent": "4:3-4:8", "declaring_type": 0, + "is_local": false, "uses": ["4:7-4:8", "17:12-17:13"] }, { "id": 2, @@ -80,6 +82,7 @@ OUTPUT: "definition_spelling": "11:7-11:8", "definition_extent": "11:3-11:8", "variable_type": 0, + "is_local": true, "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 b0f35acd..426d4628 100644 --- a/tests/usage/var_usage_class_member_static.cc +++ b/tests/usage/var_usage_class_member_static.cc @@ -42,6 +42,7 @@ OUTPUT: "short_name": "x", "detailed_name": "int Foo::x", "declaration": "2:14-2:15", + "is_local": 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 924c4631..5523406d 100644 --- a/tests/usage/var_usage_cstyle_cast.cc +++ b/tests/usage/var_usage_cstyle_cast.cc @@ -39,6 +39,7 @@ OUTPUT: "definition_extent": "7:1-7:33", "variable_type": 0, "declaring_type": 1, + "is_local": false, "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 2095d452..51d925e0 100644 --- a/tests/usage/var_usage_extern.cc +++ b/tests/usage/var_usage_extern.cc @@ -20,6 +20,7 @@ OUTPUT: "short_name": "a", "detailed_name": "int a", "declaration": "1:12-1:13", + "is_local": 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 3f8be1b9..8cb0ea7c 100644 --- a/tests/usage/var_usage_func_parameter.cc +++ b/tests/usage/var_usage_func_parameter.cc @@ -19,6 +19,7 @@ OUTPUT: "detailed_name": "int a", "definition_spelling": "1:14-1:15", "definition_extent": "1:10-1:15", + "is_local": true, "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 1654fc8a..de997431 100644 --- a/tests/usage/var_usage_local.cc +++ b/tests/usage/var_usage_local.cc @@ -20,6 +20,7 @@ OUTPUT: "detailed_name": "int x", "definition_spelling": "2:7-2:8", "definition_extent": "2:3-2:8", + "is_local": true, "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 cdb4a511..8f5693ba 100644 --- a/tests/usage/var_usage_shadowed_local.cc +++ b/tests/usage/var_usage_shadowed_local.cc @@ -25,6 +25,7 @@ OUTPUT: "detailed_name": "int a", "definition_spelling": "2:7-2:8", "definition_extent": "2:3-2:8", + "is_local": true, "uses": ["2:7-2:8", "3:3-3:4", "8:3-8:4"] }, { "id": 1, @@ -33,6 +34,7 @@ OUTPUT: "detailed_name": "int a", "definition_spelling": "5:9-5:10", "definition_extent": "5:5-5:10", + "is_local": true, "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 174a652c..3251e5fb 100644 --- a/tests/usage/var_usage_shadowed_parameter.cc +++ b/tests/usage/var_usage_shadowed_parameter.cc @@ -25,6 +25,7 @@ OUTPUT: "detailed_name": "int a", "definition_spelling": "1:14-1:15", "definition_extent": "1:10-1:15", + "is_local": true, "uses": ["1:14-1:15", "2:3-2:4", "7:3-7:4"] }, { "id": 1, @@ -33,6 +34,7 @@ OUTPUT: "detailed_name": "int a", "definition_spelling": "4:9-4:10", "definition_extent": "4:5-4:10", + "is_local": true, "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 ae18e5aa..557bcbe4 100644 --- a/tests/usage/var_usage_static.cc +++ b/tests/usage/var_usage_static.cc @@ -22,6 +22,7 @@ OUTPUT: "detailed_name": "int a", "definition_spelling": "1:12-1:13", "definition_extent": "1:1-1:13", + "is_local": 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 7c43eb5d..f47a7fab 100644 --- a/tests/vars/class_member.cc +++ b/tests/vars/class_member.cc @@ -24,6 +24,7 @@ OUTPUT: "definition_extent": "2:3-2:14", "variable_type": 0, "declaring_type": 0, + "is_local": false, "uses": ["2:8-2:14"] }] } diff --git a/tests/vars/class_static_member.cc b/tests/vars/class_static_member.cc index 8dc62938..aece86cb 100644 --- a/tests/vars/class_static_member.cc +++ b/tests/vars/class_static_member.cc @@ -27,6 +27,7 @@ OUTPUT: "definition_extent": "4:1-4:27", "variable_type": 0, "declaring_type": 0, + "is_local": false, "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 e2dc728c..d960173d 100644 --- a/tests/vars/class_static_member_decl_only.cc +++ b/tests/vars/class_static_member_decl_only.cc @@ -19,6 +19,7 @@ OUTPUT: "short_name": "member", "detailed_name": "int Foo::member", "declaration": "2:14-2:20", + "is_local": false, "uses": ["2:14-2:20"] }] } diff --git a/tests/vars/deduce_auto_type.cc b/tests/vars/deduce_auto_type.cc index f6df559c..1065faf6 100644 --- a/tests/vars/deduce_auto_type.cc +++ b/tests/vars/deduce_auto_type.cc @@ -33,6 +33,7 @@ OUTPUT: "definition_spelling": "3:8-3:9", "definition_extent": "3:3-3:21", "variable_type": 0, + "is_local": true, "uses": ["3:8-3:9"] }, { "id": 1, @@ -42,6 +43,7 @@ OUTPUT: "definition_spelling": "4:9-4:10", "definition_extent": "4:3-4:22", "variable_type": 0, + "is_local": true, "uses": ["4:9-4:10"] }] } diff --git a/tests/vars/function_local.cc b/tests/vars/function_local.cc index 1cd12f0e..4016064d 100644 --- a/tests/vars/function_local.cc +++ b/tests/vars/function_local.cc @@ -29,6 +29,7 @@ OUTPUT: "definition_spelling": "4:8-4:9", "definition_extent": "4:3-4:9", "variable_type": 0, + "is_local": true, "uses": ["4:8-4:9"] }] } diff --git a/tests/vars/function_param.cc b/tests/vars/function_param.cc index b40e5829..cddc5d52 100644 --- a/tests/vars/function_param.cc +++ b/tests/vars/function_param.cc @@ -27,6 +27,7 @@ OUTPUT: "definition_spelling": "3:15-3:17", "definition_extent": "3:10-3:17", "variable_type": 0, + "is_local": true, "uses": ["3:15-3:17"] }, { "id": 1, @@ -36,6 +37,7 @@ OUTPUT: "definition_spelling": "3:24-3:26", "definition_extent": "3:19-3:26", "variable_type": 0, + "is_local": true, "uses": ["3:24-3:26"] }] } diff --git a/tests/vars/function_shadow_local.cc b/tests/vars/function_shadow_local.cc index a28fdbfe..a5a5ef65 100644 --- a/tests/vars/function_shadow_local.cc +++ b/tests/vars/function_shadow_local.cc @@ -25,6 +25,7 @@ OUTPUT: "detailed_name": "int a", "definition_spelling": "2:7-2:8", "definition_extent": "2:3-2:8", + "is_local": true, "uses": ["2:7-2:8", "3:3-3:4", "8:3-8:4"] }, { "id": 1, @@ -33,6 +34,7 @@ OUTPUT: "detailed_name": "int a", "definition_spelling": "5:9-5:10", "definition_extent": "5:5-5:10", + "is_local": true, "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 6ea78ccd..ae26806c 100644 --- a/tests/vars/function_shadow_param.cc +++ b/tests/vars/function_shadow_param.cc @@ -19,6 +19,7 @@ OUTPUT: "detailed_name": "int p", "definition_spelling": "1:14-1:15", "definition_extent": "1:10-1:15", + "is_local": true, "uses": ["1:14-1:15"] }, { "id": 1, @@ -27,6 +28,7 @@ OUTPUT: "detailed_name": "int p", "definition_spelling": "2:7-2:8", "definition_extent": "2:3-2:8", + "is_local": true, "uses": ["2:7-2:8"] }] } diff --git a/tests/vars/global_variable.cc b/tests/vars/global_variable.cc index 9c01be9d..20f793a0 100644 --- a/tests/vars/global_variable.cc +++ b/tests/vars/global_variable.cc @@ -9,6 +9,7 @@ OUTPUT: "detailed_name": "int global", "definition_spelling": "1:12-1:18", "definition_extent": "1:1-1:22", + "is_local": 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 f66005c2..ca76a576 100644 --- a/tests/vars/global_variable_decl_only.cc +++ b/tests/vars/global_variable_decl_only.cc @@ -8,6 +8,7 @@ OUTPUT: "short_name": "global", "detailed_name": "int global", "declaration": "1:12-1:18", + "is_local": 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 3f87c118..06085203 100644 --- a/tests/vars/type_instance_on_using_type.cc +++ b/tests/vars/type_instance_on_using_type.cc @@ -44,6 +44,7 @@ OUTPUT: "definition_spelling": "4:5-4:6", "definition_extent": "4:3-4:6", "variable_type": 1, + "is_local": true, "uses": ["4:5-4:6"] }] }