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
+27 -5
View File
@@ -1305,7 +1305,18 @@ void ASTVisitor::RecordDeclRef(
break;
case ST_LocalVariable:
case ST_Parameter:
// Do nothing.
if (clang::VarDecl* varDecl = clang::dyn_cast<clang::VarDecl>(d))
{
ParseLocation declLocation = getParseLocation(varDecl->getSourceRange()); // i think we dont need this since this is the decl/def
std::string name =
declLocation.filePath.str() + "::" +
varDecl->getNameAsString() + "<" +
std::to_string(declLocation.startLineNumber) + ":" +
std::to_string(declLocation.startColumnNumber) + ">";
m_client->onLocalSymbolParsed(
name,
parseLocation);
}
break;
default:
fallback = true;
@@ -1374,6 +1385,21 @@ void ASTVisitor::RecordDeclRef(
contextNameHierarchy,
declNameHierarchy);
break;
case ST_LocalVariable:
case ST_Parameter:
if (clang::VarDecl* varDecl = clang::dyn_cast<clang::VarDecl>(d))
{
ParseLocation declLocation = getParseLocation(varDecl->getSourceRange()); // i think we dont need this since this is the decl/def
std::string name =
declLocation.filePath.str() + "::" +
varDecl->getNameAsString() + "<" +
std::to_string(declLocation.startLineNumber) + ":" +
std::to_string(declLocation.startColumnNumber) + ">";
m_client->onLocalSymbolParsed(
name,
parseLocation);
}
break;
case ST_Max:
switch (refType)
{
@@ -1408,10 +1434,6 @@ void ASTVisitor::RecordDeclRef(
break;
}
break;
case ST_LocalVariable:
case ST_Parameter:
// Do nothing.
break;
default:
fallback = true;
break;