ui: snippet sizes
* added SnippetMerger class that conducts the merging and snapping of TokenLocations to create snippets. * added parameters for snippet snapping and merging to ApplicationSettings. * added forEachStartTokenLocation() and forEachEndTokenLocation() to TokenLocationLine and TokenLocationFile. * added < and > operators to TokenLocation that compare the location part (not the id).
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "data/search/SearchMatch.h"
|
||||
|
||||
class Graph;
|
||||
class TokenLocation;
|
||||
class TokenLocationCollection;
|
||||
class TokenLocationFile;
|
||||
|
||||
@@ -38,6 +39,7 @@ public:
|
||||
const std::string& filePath, uint firstLineNumber, uint lastLineNumber) const = 0;
|
||||
|
||||
virtual TokenLocationCollection getErrorTokenLocations(std::vector<std::string>* errorMessages) const = 0;
|
||||
virtual std::shared_ptr<TokenLocationFile> getTokenLocationOfParentScope(const TokenLocation* child) const = 0;
|
||||
};
|
||||
|
||||
#endif // STORAGE_ACCESS_H
|
||||
|
||||
@@ -153,3 +153,13 @@ TokenLocationCollection StorageAccessProxy::getErrorTokenLocations(std::vector<s
|
||||
|
||||
return TokenLocationCollection();
|
||||
}
|
||||
|
||||
std::shared_ptr<TokenLocationFile> StorageAccessProxy::getTokenLocationOfParentScope(const TokenLocation* child) const
|
||||
{
|
||||
if (hasSubject())
|
||||
{
|
||||
return m_subject->getTokenLocationOfParentScope(child);
|
||||
}
|
||||
|
||||
return std::make_shared<TokenLocationFile>("");
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ public:
|
||||
|
||||
virtual TokenLocationCollection getErrorTokenLocations(std::vector<std::string>* errorMessages) const;
|
||||
|
||||
virtual std::shared_ptr<TokenLocationFile> getTokenLocationOfParentScope(const TokenLocation* child) const;
|
||||
|
||||
private:
|
||||
StorageAccess* m_subject;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user