mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-21 23:25:07 +00:00
Remove ToSymbol
This commit is contained in:
parent
c4bd7ef44b
commit
95515643d8
28
src/query.cc
28
src/query.cc
@ -103,7 +103,23 @@ optional<QueryVar::Def> ToQuery(const IdMap& id_map, const IndexVar::Def& var) {
|
||||
result.definition_extent = QueryLocation{
|
||||
*var.definition_extent, id_map.primary_file, SymbolRole::None};
|
||||
result.variable_type = id_map.ToQuery(var.variable_type);
|
||||
result.parent_id = var.parent_id;
|
||||
if (result.parent_id)
|
||||
switch (var.parent_kind) {
|
||||
default:
|
||||
break;
|
||||
case SymbolKind::File:
|
||||
result.parent_id = Id<void>(id_map.primary_file);
|
||||
break;
|
||||
case SymbolKind::Func:
|
||||
result.parent_id = Id<void>(id_map.ToQuery(IndexFuncId(*var.parent_id)));
|
||||
break;
|
||||
case SymbolKind::Type:
|
||||
result.parent_id = Id<void>(id_map.ToQuery(IndexTypeId(*var.parent_id)));
|
||||
break;
|
||||
case SymbolKind::Var:
|
||||
result.parent_id = Id<void>(id_map.ToQuery(IndexVarId(*var.parent_id)));
|
||||
break;
|
||||
}
|
||||
result.parent_kind = var.parent_kind;
|
||||
result.kind = var.kind;
|
||||
result.storage = var.storage;
|
||||
@ -523,16 +539,6 @@ std::vector<Reference> IdMap::ToQuery(const std::vector<Range>& a) const {
|
||||
return ret;
|
||||
}
|
||||
|
||||
SymbolIdx IdMap::ToSymbol(IndexTypeId id) const {
|
||||
return SymbolIdx(SymbolKind::Type, ToQuery(id).id);
|
||||
}
|
||||
SymbolIdx IdMap::ToSymbol(IndexFuncId id) const {
|
||||
return SymbolIdx(SymbolKind::Func, ToQuery(id).id);
|
||||
}
|
||||
SymbolIdx IdMap::ToSymbol(IndexVarId id) const {
|
||||
return SymbolIdx(SymbolKind::Var, ToQuery(id).id);
|
||||
}
|
||||
|
||||
// ----------------------
|
||||
// INDEX THREAD FUNCTIONS
|
||||
// ----------------------
|
||||
|
@ -428,9 +428,6 @@ struct IdMap {
|
||||
std::vector<Reference> ToQuery(const std::vector<Range>& a) const;
|
||||
// clang-format on
|
||||
|
||||
SymbolIdx ToSymbol(IndexTypeId id) const;
|
||||
SymbolIdx ToSymbol(IndexFuncId id) const;
|
||||
SymbolIdx ToSymbol(IndexVarId id) const;
|
||||
|
||||
private:
|
||||
spp::sparse_hash_map<IndexTypeId, QueryTypeId> cached_type_ids_;
|
||||
|
2
third_party/loguru
vendored
2
third_party/loguru
vendored
@ -1 +1 @@
|
||||
Subproject commit bead38889d44d9fdb5c52916d1f26c4d6af09e66
|
||||
Subproject commit 2c35b5e7251ab5d364b1b3164eccef7b5d2293c5
|
Loading…
Reference in New Issue
Block a user