mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-29 11:01:57 +00:00
Use cursor extents for non-type template parameters
This commit is contained in:
parent
332a3b5240
commit
ce6087978f
@ -1072,7 +1072,11 @@ ClangCursor::VisitResult TemplateVisitor(ClangCursor cursor,
|
|||||||
if (ref_type.get_usr().size()) {
|
if (ref_type.get_usr().size()) {
|
||||||
IndexType* ref_type_index =
|
IndexType* ref_type_index =
|
||||||
db->Resolve(db->ToTypeId(ref_type.get_usr()));
|
db->Resolve(db->ToTypeId(ref_type.get_usr()));
|
||||||
ref_type_index->uses.push_back(ref_cursor.get_spelling_range());
|
// The cursor extent includes `type name`, not just `name`. There
|
||||||
|
// seems no way to extract the spelling range of `type` and we do
|
||||||
|
// not want to do subtraction here.
|
||||||
|
// See https://github.com/jacobdufault/cquery/issues/252
|
||||||
|
ref_type_index->uses.push_back(ref_cursor.get_extent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UniqueAdd(ref_index->uses, cursor.get_spelling_range());
|
UniqueAdd(ref_index->uses, cursor.get_spelling_range());
|
||||||
|
Loading…
Reference in New Issue
Block a user