mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 23:55:08 +00:00
Move most of the information in document outline to containerName. This makes searching nicer.
This commit is contained in:
parent
f907d1d1b9
commit
671a54c7af
@ -560,7 +560,9 @@ optional<lsSymbolInformation> GetSymbolInfo(QueryDatabase* db, WorkingFiles* wor
|
|||||||
return nullopt;
|
return nullopt;
|
||||||
|
|
||||||
lsSymbolInformation info;
|
lsSymbolInformation info;
|
||||||
info.name = type->def.detailed_name;
|
info.name = type->def.short_name;
|
||||||
|
if (type->def.detailed_name != type->def.short_name)
|
||||||
|
info.containerName = type->def.detailed_name;
|
||||||
info.kind = lsSymbolKind::Class;
|
info.kind = lsSymbolKind::Class;
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
@ -570,15 +572,14 @@ optional<lsSymbolInformation> GetSymbolInfo(QueryDatabase* db, WorkingFiles* wor
|
|||||||
return nullopt;
|
return nullopt;
|
||||||
|
|
||||||
lsSymbolInformation info;
|
lsSymbolInformation info;
|
||||||
info.name = func->def.detailed_name;
|
info.name = func->def.short_name;
|
||||||
|
info.containerName = func->def.detailed_name;
|
||||||
info.kind = lsSymbolKind::Function;
|
info.kind = lsSymbolKind::Function;
|
||||||
|
|
||||||
if (func->def.declaring_type.has_value()) {
|
if (func->def.declaring_type.has_value()) {
|
||||||
optional<QueryType>& container = db->types[func->def.declaring_type->id];
|
optional<QueryType>& container = db->types[func->def.declaring_type->id];
|
||||||
if (container) {
|
if (container)
|
||||||
info.kind = lsSymbolKind::Method;
|
info.kind = lsSymbolKind::Method;
|
||||||
info.containerName = container->def.detailed_name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
@ -589,7 +590,8 @@ optional<lsSymbolInformation> GetSymbolInfo(QueryDatabase* db, WorkingFiles* wor
|
|||||||
return nullopt;
|
return nullopt;
|
||||||
|
|
||||||
lsSymbolInformation info;
|
lsSymbolInformation info;
|
||||||
info.name += var->def.detailed_name;
|
info.name += var->def.short_name;
|
||||||
|
info.containerName = var->def.detailed_name;
|
||||||
info.kind = lsSymbolKind::Variable;
|
info.kind = lsSymbolKind::Variable;
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user