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
+7 -1
View File
@@ -21,7 +21,8 @@ public:
Id addNode(int type, const NameHierarchy& nameHierarchy, int definitionType);
Id addFile(const std::string& name, const std::string& filePath, const std::string& modificationTime);
Id addFile(const std::string& filePath);
void addSourceLocation(Id elementId, const ParseLocation& location, bool isScope);
Id addLocalSymbol(const std::string& name);
void addSourceLocation(Id elementId, const ParseLocation& location, int type);
void addComponentAccess(Id nodeId , int type);
void addCommentLocation(const ParseLocation& location);
void addError(const std::string& message, bool fatal, const ParseLocation& location);
@@ -40,6 +41,7 @@ private:
std::string serialize(const StorageEdge& edge);
std::string serialize(const StorageNode& node);
std::string serialize(const StorageFile& file);
std::string serialize(const StorageLocalSymbol& localSymbol);
std::unordered_map<std::string, Id> m_fileNamesToIds; // this is used to prevent duplicates (unique)
std::unordered_map<Id, std::shared_ptr<StorageFile>> m_fileIdsToData;
@@ -50,6 +52,10 @@ private:
std::unordered_map<std::string, Id> m_edgeNamesToIds; // this is used to prevent duplicates (unique)
std::map<Id, std::shared_ptr<StorageEdge>> m_edgeIdsToData;
std::unordered_map<std::string, Id> m_localSymbolNamesToIds; // this is used to prevent duplicates (unique)
std::map<Id, std::shared_ptr<StorageLocalSymbol>> m_localSymbolIdsToData;
std::vector<StorageSourceLocation> m_sourceLocations;
std::vector<StorageComponentAccess> m_componentAccesses;
std::vector<StorageCommentLocation> m_commentLocations;