mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 15:45:08 +00:00
Rename instantiations to instances.
This commit is contained in:
parent
bdd433abd4
commit
bb25640d91
@ -1517,7 +1517,7 @@ void QueryDbMainLoop(
|
||||
QueryType& type = db->types[symbol.idx];
|
||||
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.instantiations), "var", "vars");
|
||||
AddCodeLens(&common, ref.loc.OffsetStartColumn(2), ToQueryLocation(db, type.instances), "var", "vars");
|
||||
break;
|
||||
}
|
||||
case SymbolKind::Func: {
|
||||
|
@ -776,7 +776,7 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
|
||||
// Don't treat enum definition variables as instantiations.
|
||||
bool is_enum_member = decl->semanticContainer && decl->semanticContainer->cursor.kind == CXCursor_EnumDecl;
|
||||
if (!is_enum_member)
|
||||
db->Resolve(var_type.value())->instantiations.push_back(var_id);
|
||||
db->Resolve(var_type.value())->instances.push_back(var_id);
|
||||
|
||||
var_def->def.variable_type = var_type.value();
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ struct IndexedTypeDef {
|
||||
std::vector<IndexTypeId> derived;
|
||||
|
||||
// Declared variables of this type.
|
||||
std::vector<IndexVarId> instantiations;
|
||||
std::vector<IndexVarId> instances;
|
||||
|
||||
// Every usage, useful for things like renames.
|
||||
// NOTE: Do not insert directly! Use AddUsage instead.
|
||||
@ -219,7 +219,7 @@ struct IndexedTypeDef {
|
||||
return
|
||||
def.HasInterestingState() ||
|
||||
!derived.empty() ||
|
||||
!instantiations.empty() ||
|
||||
!instances.empty() ||
|
||||
!uses.empty();
|
||||
}
|
||||
|
||||
|
10
src/query.cc
10
src/query.cc
@ -515,8 +515,8 @@ IndexUpdate::IndexUpdate(const IdMap& previous_id_map, const IdMap& current_id_m
|
||||
types_def_update.push_back(ToQuery(current_id_map, type->def));
|
||||
if (!type->derived.empty())
|
||||
types_derived.push_back(QueryType::DerivedUpdate(current_id_map.ToQuery(type->id), current_id_map.ToQuery(type->derived)));
|
||||
if (!type->instantiations.empty())
|
||||
types_instantiations.push_back(QueryType::InstantiationsUpdate(current_id_map.ToQuery(type->id), current_id_map.ToQuery(type->instantiations)));
|
||||
if (!type->instances.empty())
|
||||
types_instances.push_back(QueryType::InstancesUpdate(current_id_map.ToQuery(type->id), current_id_map.ToQuery(type->instances)));
|
||||
if (!type->uses.empty())
|
||||
types_uses.push_back(QueryType::UsesUpdate(current_id_map.ToQuery(type->id), current_id_map.ToQuery(type->uses)));
|
||||
},
|
||||
@ -527,7 +527,7 @@ IndexUpdate::IndexUpdate(const IdMap& previous_id_map, const IdMap& current_id_m
|
||||
types_def_update.push_back(*current_remapped_def);
|
||||
|
||||
PROCESS_UPDATE_DIFF(QueryTypeId, types_derived, derived, QueryTypeId);
|
||||
PROCESS_UPDATE_DIFF(QueryTypeId, types_instantiations, instantiations, QueryVarId);
|
||||
PROCESS_UPDATE_DIFF(QueryTypeId, types_instances, instances, QueryVarId);
|
||||
PROCESS_UPDATE_DIFF(QueryTypeId, types_uses, uses, QueryLocation);
|
||||
});
|
||||
|
||||
@ -594,7 +594,7 @@ void IndexUpdate::Merge(const IndexUpdate& update) {
|
||||
INDEX_UPDATE_APPEND(types_removed);
|
||||
INDEX_UPDATE_APPEND(types_def_update);
|
||||
INDEX_UPDATE_MERGE(types_derived);
|
||||
INDEX_UPDATE_MERGE(types_instantiations);
|
||||
INDEX_UPDATE_MERGE(types_instances);
|
||||
INDEX_UPDATE_MERGE(types_uses);
|
||||
|
||||
INDEX_UPDATE_APPEND(funcs_removed);
|
||||
@ -674,7 +674,7 @@ void QueryDatabase::ApplyIndexUpdate(IndexUpdate* update) {
|
||||
RemoveUsrs(update->types_removed);
|
||||
ImportOrUpdate(update->types_def_update);
|
||||
HANDLE_MERGEABLE(types_derived, derived, types);
|
||||
HANDLE_MERGEABLE(types_instantiations, instantiations, types);
|
||||
HANDLE_MERGEABLE(types_instances, instances, types);
|
||||
HANDLE_MERGEABLE(types_uses, uses, types);
|
||||
|
||||
RemoveUsrs(update->funcs_removed);
|
||||
|
@ -163,12 +163,12 @@ struct QueryFile {
|
||||
struct QueryType {
|
||||
using DefUpdate = TypeDefDefinitionData<QueryTypeId, QueryFuncId, QueryVarId, QueryLocation>;
|
||||
using DerivedUpdate = MergeableUpdate<QueryTypeId, QueryTypeId>;
|
||||
using InstantiationsUpdate = MergeableUpdate<QueryTypeId, QueryVarId>;
|
||||
using InstancesUpdate = MergeableUpdate<QueryTypeId, QueryVarId>;
|
||||
using UsesUpdate = MergeableUpdate<QueryTypeId, QueryLocation>;
|
||||
|
||||
DefUpdate def;
|
||||
std::vector<QueryTypeId> derived;
|
||||
std::vector<QueryVarId> instantiations;
|
||||
std::vector<QueryVarId> instances;
|
||||
std::vector<QueryLocation> uses;
|
||||
size_t detailed_name_idx = -1;
|
||||
|
||||
@ -219,7 +219,7 @@ struct IndexUpdate {
|
||||
std::vector<Usr> types_removed;
|
||||
std::vector<QueryType::DefUpdate> types_def_update;
|
||||
std::vector<QueryType::DerivedUpdate> types_derived;
|
||||
std::vector<QueryType::InstantiationsUpdate> types_instantiations;
|
||||
std::vector<QueryType::InstancesUpdate> types_instances;
|
||||
std::vector<QueryType::UsesUpdate> types_uses;
|
||||
|
||||
// Function updates.
|
||||
|
@ -136,7 +136,7 @@ void Reflect(TVisitor& visitor, IndexedTypeDef& value) {
|
||||
REFLECT_MEMBER2("types", value.def.types);
|
||||
REFLECT_MEMBER2("funcs", value.def.funcs);
|
||||
REFLECT_MEMBER2("vars", value.def.vars);
|
||||
REFLECT_MEMBER2("instantiations", value.instantiations);
|
||||
REFLECT_MEMBER2("instantiations", value.instances);
|
||||
REFLECT_MEMBER2("uses", value.uses);
|
||||
REFLECT_MEMBER_END();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user