data: Saving TokenLocations of scopes separately

This change parses the TokenLocations of scopes of classes, structs, functions, methods, namespaces and enums and
saves them in Storage with type LOCATION_SCOPE. The TokenLocations of these nodes are just their name declarations now.
Scope locations are displayed in blue color in the code view.
This commit is contained in:
Eberhard Graether
2014-07-28 17:54:36 +02:00
parent 182e18840e
commit 96df63055a
18 changed files with 261 additions and 114 deletions
+6
View File
@@ -292,6 +292,8 @@ void QtCodeSnippet::createAnnotations(const TokenLocationFile& locationFile)
}
annotation.tokenId = location->getTokenId();
annotation.isScope = location->getType() == TokenLocation::LOCATION_SCOPE;
m_annotations.push_back(annotation);
}
);
@@ -311,6 +313,10 @@ void QtCodeSnippet::annotateText()
{
color = ApplicationSettings::getInstance()->getCodeActiveLinkColor();
}
else if (annotation.isScope)
{
color = ApplicationSettings::getInstance()->getCodeScopeColor();
}
else
{
color = ApplicationSettings::getInstance()->getCodeLinkColor();
+1
View File
@@ -75,6 +75,7 @@ private:
int start;
int end;
Id tokenId;
bool isScope;
};
void createAnnotations(const TokenLocationFile& locationFile);