ui: Added on-demand local reference navigation to code view navigation bar (issue #453, #538)

* show local reference navigation for local symbols and multiple edge references
* shortcut Ctrl/Cmd + T
* iterate with consecutive edge clicks
This commit is contained in:
Eberhard Graether
2018-07-23 03:13:41 +02:00
parent 1df330ff2c
commit 95ebfff19c
24 changed files with 511 additions and 99 deletions
+15 -4
View File
@@ -44,10 +44,6 @@ QtCodeFileSingle::QtCodeFileSingle(QtCodeNavigator* navigator, QWidget* parent)
layout()->addWidget(m_areaWrapper);
}
QtCodeFileSingle::~QtCodeFileSingle()
{
}
QAbstractScrollArea* QtCodeFileSingle::getScrollArea()
{
return m_area;
@@ -234,6 +230,21 @@ void QtCodeFileSingle::findScreenMatches(const std::wstring& query, std::vector<
}
}
std::vector<std::pair<FilePath, Id>> QtCodeFileSingle::getLocationIdsForTokenIds(const std::set<Id>& tokenIds) const
{
if (m_area)
{
std::vector<std::pair<FilePath, Id>> locationIds;
for (Id locationId : m_area->getLocationIdsForTokenIds(tokenIds))
{
locationIds.push_back(std::make_pair(getCurrentFilePath(), locationId));
}
return locationIds;
}
return { };
}
const FilePath& QtCodeFileSingle::getCurrentFilePath() const
{
return m_currentFilePath;