mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-19 12:05:50 +00:00
Don't count the '~' in type usages for destructors.
This commit is contained in:
parent
dcc71f2470
commit
5415f4be50
@ -1039,9 +1039,11 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
|
||||
// Mark a type reference at the ctor/dtor location.
|
||||
if (decl->entityInfo->kind == CXIdxEntity_CXXConstructor)
|
||||
UniqueAdd(declaring_type_def->uses, decl_loc_spelling);
|
||||
// TODO/FIXME: +1 on dtor start range.
|
||||
if (decl->entityInfo->kind == CXIdxEntity_CXXDestructor)
|
||||
UniqueAdd(declaring_type_def->uses, decl_loc_spelling);
|
||||
if (decl->entityInfo->kind == CXIdxEntity_CXXDestructor) {
|
||||
Range dtor_type_range = decl_loc_spelling;
|
||||
dtor_type_range.start.column += 1; // Don't count the leading ~
|
||||
UniqueAdd(declaring_type_def->uses, dtor_type_range);
|
||||
}
|
||||
|
||||
// Add function to declaring type.
|
||||
UniqueAdd(declaring_type_def->def.funcs, func_id);
|
||||
|
@ -25,7 +25,7 @@ OUTPUT:
|
||||
"definition_extent": "1:1-5:2",
|
||||
"funcs": [0, 1],
|
||||
"instances": [0],
|
||||
"uses": ["1:7-1:10", "3:3-3:6", "4:3-4:7", "8:3-8:6"]
|
||||
"uses": ["1:7-1:10", "3:3-3:6", "4:4-4:7", "8:3-8:6"]
|
||||
}],
|
||||
"funcs": [{
|
||||
"id": 0,
|
||||
|
Loading…
Reference in New Issue
Block a user