mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 15:45:08 +00:00
In OnIndexDeclaration, get_type_description() may return the name of a typedef and there is no (, causing insert
failing
This commit is contained in:
parent
33c3d99925
commit
17f23bf3bf
@ -1161,8 +1161,13 @@ void OnIndexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
|
|||||||
ns->QualifiedName(decl->semanticContainer, func->def.short_name);
|
ns->QualifiedName(decl->semanticContainer, func->def.short_name);
|
||||||
std::string type_desc = decl_cursor.get_type_description();
|
std::string type_desc = decl_cursor.get_type_description();
|
||||||
size_t offset = type_desc.find('(');
|
size_t offset = type_desc.find('(');
|
||||||
|
if (offset != std::string::npos) {
|
||||||
type_desc.insert(offset, qualified_name);
|
type_desc.insert(offset, qualified_name);
|
||||||
func->def.detailed_name = type_desc;
|
func->def.detailed_name = type_desc;
|
||||||
|
} else {
|
||||||
|
// type_desc is probably the name of a typedef.
|
||||||
|
func->def.detailed_name = type_desc + " " + qualified_name;
|
||||||
|
}
|
||||||
|
|
||||||
// Add function usage information. We only want to do it once per
|
// Add function usage information. We only want to do it once per
|
||||||
// definition/declaration. Do it on definition since there should only
|
// definition/declaration. Do it on definition since there should only
|
||||||
|
Loading…
Reference in New Issue
Block a user