mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-21 23:25:07 +00:00
Fix short_name_size when getNameAsString does not return a prefix (#784)
This commit is contained in:
parent
4cd308d7fd
commit
0ada56ef3b
@ -534,7 +534,9 @@ public:
|
|||||||
// e.g. operator type-parameter-1
|
// e.g. operator type-parameter-1
|
||||||
i = 0;
|
i = 0;
|
||||||
def.short_name_offset = 0;
|
def.short_name_offset = 0;
|
||||||
} else if (short_name.empty() || (i >= 2 && name[i - 2] == ':')) {
|
def.short_name_size = name.size();
|
||||||
|
} else {
|
||||||
|
if (short_name.empty() || (i >= 2 && name[i - 2] == ':')) {
|
||||||
// Don't replace name with qualified name in ns::name Cls::*name
|
// Don't replace name with qualified name in ns::name Cls::*name
|
||||||
def.short_name_offset = i;
|
def.short_name_offset = i;
|
||||||
} else {
|
} else {
|
||||||
@ -543,6 +545,7 @@ public:
|
|||||||
}
|
}
|
||||||
// name may be empty while short_name is not.
|
// name may be empty while short_name is not.
|
||||||
def.short_name_size = name.empty() ? 0 : short_name.size();
|
def.short_name_size = name.empty() ? 0 : short_name.size();
|
||||||
|
}
|
||||||
for (int paren = 0; i; i--) {
|
for (int paren = 0; i; i--) {
|
||||||
// Skip parentheses in "(anon struct)::name"
|
// Skip parentheses in "(anon struct)::name"
|
||||||
if (name[i - 1] == ')')
|
if (name[i - 1] == ')')
|
||||||
|
Loading…
Reference in New Issue
Block a user