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
@@ -86,6 +86,12 @@ void CodeController::handleMessage(MessageActivateAll* message)
showContents(message);
}
void CodeController::handleMessage(MessageActivateLocalSymbols* message)
{
CodeView* view = getView();
view->showActiveLocalSymbolIds(message->symbolIds);
}
void CodeController::handleMessage(MessageActivateTokens* message)
{
CodeView* view = getView();
@@ -358,7 +364,7 @@ std::vector<CodeSnippetParams> CodeController::getSnippetsForFile(std::shared_pt
fileLocations->forEachStartTokenLocation(
[&](TokenLocation* startLoc) -> void
{
if (startLoc->getType() == TokenLocation::LOCATION_SCOPE)
if (startLoc->getType() == LOCATION_SCOPE)
{
TokenLocation* endLoc = startLoc->getOtherTokenLocation();
TokenLocation* scopeLoc = scopeLocations->addTokenLocation(
@@ -368,7 +374,7 @@ std::vector<CodeSnippetParams> CodeController::getSnippetsForFile(std::shared_pt
startLoc->getColumnNumber(),
endLoc->getLineNumber(),
endLoc->getColumnNumber());
scopeLoc->setType(TokenLocation::LOCATION_SCOPE);
scopeLoc->setType(LOCATION_SCOPE);
}
}
);