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:
Ivan Donchevskii
2018-06-01 09:18:45 +02:00
parent 92530fd05d
commit b0c0119345
7 changed files with 48 additions and 5 deletions

View File

@@ -54,6 +54,7 @@ public:
bool isGenerated(const QModelIndex &sourceIndex) const override;
Utils::Link linkFromIndex(const QModelIndex &sourceIndex) const override;
Utils::LineColumn lineColumnFromIndex(const QModelIndex &sourceIndex) const override;
Range rangeFromIndex(const QModelIndex &sourceIndex) const override;
private:
CPlusPlus::Symbol *symbolFromIndex(const QModelIndex &index) const;