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:
@@ -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();
|
||||
|
||||
@@ -75,6 +75,7 @@ private:
|
||||
int start;
|
||||
int end;
|
||||
Id tokenId;
|
||||
bool isScope;
|
||||
};
|
||||
|
||||
void createAnnotations(const TokenLocationFile& locationFile);
|
||||
|
||||
Reference in New Issue
Block a user