mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-19 03:55:49 +00:00
Don't show references (e.g. there are references to classes in constructor positions) in textDocument/documentSymbol
This commit is contained in:
parent
b53c41408e
commit
1469723c3c
@ -256,7 +256,10 @@ QueryFile::DefUpdate BuildFileDefUpdate(const IdMap& id_map,
|
|||||||
add_outline(*type.def.extent, id, SymbolKind::Type);
|
add_outline(*type.def.extent, id, SymbolKind::Type);
|
||||||
for (Use decl : type.declarations) {
|
for (Use decl : type.declarations) {
|
||||||
add_all_symbols(decl, id, SymbolKind::Type);
|
add_all_symbols(decl, id, SymbolKind::Type);
|
||||||
add_outline(decl, id, SymbolKind::Type);
|
// Constructor positions have references to the class,
|
||||||
|
// which we do not want to show in textDocument/documentSymbol
|
||||||
|
if (!(decl.role & Role::Reference))
|
||||||
|
add_outline(decl, id, SymbolKind::Type);
|
||||||
}
|
}
|
||||||
for (Use use : type.uses)
|
for (Use use : type.uses)
|
||||||
add_all_symbols(use, id, SymbolKind::Type);
|
add_all_symbols(use, id, SymbolKind::Type);
|
||||||
|
Loading…
Reference in New Issue
Block a user