logic: name qualifiers of symbols are clickable now

This commit is contained in:
mlangkabel
2017-10-11 11:08:01 +02:00
parent 896fbf09b6
commit cf984ca245
216 changed files with 11261 additions and 15182 deletions
+3 -3
View File
@@ -9,11 +9,11 @@ DefinitionKind intToDefinitionKind(int definitionKind)
{
switch (definitionKind)
{
case 0:
case DEFINITION_NONE:
return DEFINITION_NONE;
case 1:
case DEFINITION_IMPLICIT:
return DEFINITION_IMPLICIT;
case 2:
case DEFINITION_EXPLICIT:
return DEFINITION_EXPLICIT;
}
return DEFINITION_NONE;
+10 -22
View File
@@ -2,38 +2,26 @@
int locationTypeToInt(LocationType type)
{
switch (type)
{
case LOCATION_TOKEN:
return 0;
case LOCATION_SCOPE:
return 1;
case LOCATION_LOCAL_SYMBOL:
return 2;
case LOCATION_ERROR:
return 3;
case LOCATION_FULLTEXT_SEARCH:
return 4;
case LOCATION_SCREEN_SEARCH:
return 5;
}
return type;
}
LocationType intToLocationType(int value)
{
switch (value)
{
case 0:
case LOCATION_TOKEN:
return LOCATION_TOKEN;
case 1:
case LOCATION_SCOPE:
return LOCATION_SCOPE;
case 2:
case LOCATION_QUALIFIER:
return LOCATION_QUALIFIER;
case LOCATION_LOCAL_SYMBOL:
return LOCATION_LOCAL_SYMBOL;
case 3:
return LOCATION_ERROR;
case 4:
case LOCATION_ERROR:
return LOCATION_ERROR;
case LOCATION_FULLTEXT_SEARCH:
return LOCATION_FULLTEXT_SEARCH;
case 5:
case LOCATION_SCREEN_SEARCH:
return LOCATION_SCREEN_SEARCH;
}
return LOCATION_TOKEN;
+7 -6
View File
@@ -3,12 +3,13 @@
enum LocationType
{
LOCATION_TOKEN,
LOCATION_SCOPE,
LOCATION_LOCAL_SYMBOL,
LOCATION_ERROR,
LOCATION_FULLTEXT_SEARCH,
LOCATION_SCREEN_SEARCH
LOCATION_TOKEN = 0,
LOCATION_SCOPE = 1,
LOCATION_QUALIFIER = 2,
LOCATION_LOCAL_SYMBOL = 3,
LOCATION_ERROR = 4,
LOCATION_FULLTEXT_SEARCH = 5,
LOCATION_SCREEN_SEARCH = 6
};
int locationTypeToInt(LocationType type);
+4
View File
@@ -46,8 +46,12 @@ public:
ReferenceKind referenceKind, const NameHierarchy& referencedName, const NameHierarchy& contextName,
const ParseLocation& location) = 0;
virtual void recordQualifierLocation(
const NameHierarchy& qualifierName, const ParseLocation& location) = 0;
virtual void onError(const ParseLocation& location, const std::string& message, const std::string& commandline,
bool fatal, bool indexed) = 0;
virtual void onLocalSymbolParsed(const std::string& name, const ParseLocation& location) = 0;
virtual void onFileParsed(const FileInfo& fileInfo) = 0;
virtual void onCommentParsed(const ParseLocation& location) = 0;
+6
View File
@@ -67,6 +67,12 @@ void ParserClientImpl::recordReference(
addSourceLocation(edgeId, location, locationTypeToInt(LOCATION_TOKEN));
}
void ParserClientImpl::recordQualifierLocation(const NameHierarchy& qualifierName, const ParseLocation& location)
{
Id nodeId = addNodeHierarchy(qualifierName, Node::NODE_NON_INDEXED);
addSourceLocation(nodeId, location, locationTypeToInt(LOCATION_QUALIFIER));
}
void ParserClientImpl::onError(
const ParseLocation& location, const std::string& message, const std::string& commandline,bool fatal, bool indexed)
{
+4
View File
@@ -36,8 +36,12 @@ public:
ReferenceKind referenceKind, const NameHierarchy& referencedName, const NameHierarchy& contextName,
const ParseLocation& location);
virtual void recordQualifierLocation(
const NameHierarchy& qualifierName, const ParseLocation& location);
virtual void onError(const ParseLocation& location, const std::string& message, const std::string& commandline,
bool fatal, bool indexed);
virtual void onLocalSymbolParsed(const std::string& name, const ParseLocation& location);
virtual void onFileParsed(const FileInfo& fileInfo);
virtual void onCommentParsed(const ParseLocation& location);
+7 -1
View File
@@ -1264,6 +1264,12 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getSourceLocationsF
auto it = locationIdToElementIdMap.find(sourceLocation.id);
if (it != locationIdToElementIdMap.end())
{
LocationType type = intToLocationType(sourceLocation.type);
if (type == LOCATION_QUALIFIER)
{
continue;
}
FilePath path = getFileNodePath(sourceLocation.fileNodeId);
if (path.empty())
{
@@ -1281,7 +1287,7 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getSourceLocationsF
if (!path.empty())
{
collection->addSourceLocation(
intToLocationType(sourceLocation.type),
type,
sourceLocation.id,
std::vector<Id>(1, it->second),
path,
@@ -5,7 +5,7 @@
#include "utility/logging/logging.h"
#include "utility/text/TextAccess.h"
const size_t SqliteIndexStorage::s_storageVersion = 13;
const size_t SqliteIndexStorage::s_storageVersion = 14;
SqliteIndexStorage::SqliteIndexStorage(const FilePath& dbFilePath)
: SqliteStorage(dbFilePath.canonical())