mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 07:35:08 +00:00
Fix querydb import overriding good data with bad
This commit is contained in:
parent
151505dadf
commit
103b2dac95
@ -859,7 +859,6 @@ void QueryDbMainLoop(
|
||||
// - start at spelling but end at extent for better mouse tooltip
|
||||
// - goto declaration while in definition of recursive type
|
||||
|
||||
// TODO: Goto definition broken on Buffer::CreateSharedBuffer.
|
||||
optional<QueryableLocation> def_loc = GetDefinitionSpellingOfSymbol(db, ref.idx);
|
||||
|
||||
// We use spelling start and extent end because this causes vscode
|
||||
@ -889,7 +888,7 @@ void QueryDbMainLoop(
|
||||
|
||||
if (def_loc)
|
||||
PushBack(&response.result, GetLsLocation(db, working_files, *def_loc));
|
||||
|
||||
|
||||
if (!response.result.empty())
|
||||
break;
|
||||
}
|
||||
|
@ -638,6 +638,9 @@ void QueryableDatabase::ImportOrUpdate(const std::vector<QueryableTypeDef::DefUp
|
||||
assert(it != usr_to_symbol.end());
|
||||
|
||||
QueryableTypeDef& existing = types[it->second.idx];
|
||||
if (existing.def.definition_spelling && !def.definition_spelling)
|
||||
continue;
|
||||
|
||||
existing.def = def;
|
||||
SetQualifiedNameForWorkspaceSearch(this, &existing.qualified_name_idx, SymbolKind::Type, it->second.idx, def.qualified_name);
|
||||
}
|
||||
@ -652,6 +655,9 @@ void QueryableDatabase::ImportOrUpdate(const std::vector<QueryableFuncDef::DefUp
|
||||
assert(it != usr_to_symbol.end());
|
||||
|
||||
QueryableFuncDef& existing = funcs[it->second.idx];
|
||||
if (existing.def.definition_spelling && !def.definition_spelling)
|
||||
continue;
|
||||
|
||||
existing.def = def;
|
||||
SetQualifiedNameForWorkspaceSearch(this, &existing.qualified_name_idx, SymbolKind::Func, it->second.idx, def.qualified_name);
|
||||
}
|
||||
@ -666,6 +672,9 @@ void QueryableDatabase::ImportOrUpdate(const std::vector<QueryableVarDef::DefUpd
|
||||
assert(it != usr_to_symbol.end());
|
||||
|
||||
QueryableVarDef& existing = vars[it->second.idx];
|
||||
if (existing.def.definition_spelling && !def.definition_spelling)
|
||||
continue;
|
||||
|
||||
existing.def = def;
|
||||
if (def.declaring_type)
|
||||
SetQualifiedNameForWorkspaceSearch(this, &existing.qualified_name_idx, SymbolKind::Var, it->second.idx, def.qualified_name);
|
||||
|
Loading…
Reference in New Issue
Block a user