forked from qt-creator/qt-creator
CppTools: Use cursor range for better outline navigation
Clang provides cursor range for each declaration in symbol outline. Use that information to search for more accurate correspondence between a cursor position in editor and an entry in symbol outline. For example skip indexes with not matching ranges to prevent pure declarations from automatically become parents of everything coming after them. Change-Id: I0ef95c26772050cd6655e830288c46118aba38bb Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -190,6 +190,12 @@ Utils::LineColumn OverviewModel::lineColumnFromIndex(const QModelIndex &sourceIn
|
||||
return lineColumn;
|
||||
}
|
||||
|
||||
OverviewModel::Range OverviewModel::rangeFromIndex(const QModelIndex &sourceIndex) const
|
||||
{
|
||||
Utils::LineColumn lineColumn = lineColumnFromIndex(sourceIndex);
|
||||
return std::make_pair(lineColumn, lineColumn);
|
||||
}
|
||||
|
||||
void OverviewModel::buildTree(SymbolItem *root, bool isRoot)
|
||||
{
|
||||
if (!root)
|
||||
|
||||
Reference in New Issue
Block a user