data: showing local symbols

- added local symbols to storage
- added tests for local symbol parsing
- added MessageActivateLocalSymbols to activate local symbols in code view
- TokenLocations now store their LocationType instead of a plain bool "isScope"
- moved LocationType from TokenLocation to separate file, since it is also used in Annotations now.
- added local_symbol in stylesheet to define a style for hovering and activating these elements
- renamed location to token in stylesheet
This commit is contained in:
malte_langkabel
2016-04-12 13:28:37 +02:00
parent a448485b35
commit b9c4bd05cd
38 changed files with 767 additions and 299 deletions
+12
View File
@@ -19,6 +19,7 @@ QtCodeView::QtCodeView(ViewLayout* viewLayout)
, m_setFileStateFunctor(std::bind(&QtCodeView::doSetFileState, this, std::placeholders::_1, std::placeholders::_2))
, m_doShowFirstActiveSnippetFunctor(std::bind(&QtCodeView::doShowFirstActiveSnippet, this, std::placeholders::_1, std::placeholders::_2))
, m_doShowActiveTokenIdsFunctor(std::bind(&QtCodeView::doShowActiveTokenIds, this, std::placeholders::_1))
, m_doShowActiveLocalSymbolIdsFunctor(std::bind(&QtCodeView::doShowActiveLocalSymbolIds, this, std::placeholders::_1))
, m_focusTokenIdsFunctor(std::bind(&QtCodeView::doFocusTokenIds, this, std::placeholders::_1))
, m_defocusTokenIdsFunctor(std::bind(&QtCodeView::doDefocusTokenIds, this))
, m_showContentsFunctor(std::bind(&QtCodeView::doShowContents, this))
@@ -91,6 +92,11 @@ void QtCodeView::showActiveTokenIds(const std::vector<Id>& activeTokenIds)
m_doShowActiveTokenIdsFunctor(activeTokenIds);
}
void QtCodeView::showActiveLocalSymbolIds(const std::vector<Id>& activeLocalSymbolIds)
{
m_doShowActiveLocalSymbolIdsFunctor(activeLocalSymbolIds);
}
void QtCodeView::focusTokenIds(const std::vector<Id>& focusedTokenIds)
{
m_focusTokenIdsFunctor(focusedTokenIds);
@@ -194,6 +200,12 @@ void QtCodeView::doShowActiveTokenIds(const std::vector<Id>& activeTokenIds)
m_widget->showActiveTokenIds();
}
void QtCodeView::doShowActiveLocalSymbolIds(const std::vector<Id>& localSymbolIds)
{
m_widget->setActiveLocalSymbolIds(localSymbolIds);
m_widget->showActiveTokenIds();
}
void QtCodeView::doFocusTokenIds(const std::vector<Id>& focusedTokenIds)
{
m_widget->focusTokenIds(focusedTokenIds);