mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-31 09:50:26 +00:00
Remove local variables from documentSymbol
This commit is contained in:
parent
58d6547411
commit
bfd4edf177
12
src/query.cc
12
src/query.cc
@ -275,13 +275,17 @@ QueryFile::DefUpdate BuildFileDefUpdate(const IdMap& id_map, const IndexFile& in
|
|||||||
}
|
}
|
||||||
for (const IndexVar& var : indexed.vars) {
|
for (const IndexVar& var : indexed.vars) {
|
||||||
QueryVarId id = id_map.ToQuery(var.id);
|
QueryVarId id = id_map.ToQuery(var.id);
|
||||||
if (var.def.spell)
|
if (var.def.spell) {
|
||||||
add_all_symbols(*var.def.spell, id, SymbolKind::Var);
|
add_all_symbols(*var.def.spell, id, SymbolKind::Var);
|
||||||
if (var.def.extent)
|
if (var.def.extent && (var.def.spell->kind != SymbolKind::Func ||
|
||||||
add_outline(*var.def.extent, id, SymbolKind::Var);
|
var.def.storage == StorageClass::Static))
|
||||||
|
add_outline(*var.def.extent, id, SymbolKind::Var);
|
||||||
|
}
|
||||||
for (Use decl : var.declarations) {
|
for (Use decl : var.declarations) {
|
||||||
add_all_symbols(decl, id, SymbolKind::Var);
|
add_all_symbols(decl, id, SymbolKind::Var);
|
||||||
add_outline(decl, id, SymbolKind::Var);
|
if (decl.kind != SymbolKind::Func ||
|
||||||
|
var.def.storage == StorageClass::Static)
|
||||||
|
add_outline(decl, id, SymbolKind::Var);
|
||||||
}
|
}
|
||||||
for (Use use : var.uses)
|
for (Use use : var.uses)
|
||||||
add_all_symbols(use, id, SymbolKind::Var);
|
add_all_symbols(use, id, SymbolKind::Var);
|
||||||
|
Loading…
Reference in New Issue
Block a user