logic: Fixed qualifier locations not used in reference navigation and only highlighted on hovering
This commit is contained in:
@@ -1365,7 +1365,7 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getSourceLocationsF
|
||||
for (const StorageSourceLocation& sourceLocation: m_sqliteIndexStorage.getAllByIds<StorageSourceLocation>(locationIds))
|
||||
{
|
||||
const LocationType type = intToLocationType(sourceLocation.type);
|
||||
if (type != LOCATION_TOKEN && type != LOCATION_SCOPE && type != LOCATION_QUALIFIER && type != LOCATION_LOCAL_SYMBOL)
|
||||
if (type != LOCATION_TOKEN && type != LOCATION_SCOPE && type != LOCATION_LOCAL_SYMBOL)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -1429,7 +1429,7 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getSourceLocationsF
|
||||
}
|
||||
|
||||
const LocationType type = intToLocationType(location.type);
|
||||
if (type != LOCATION_TOKEN && type != LOCATION_SCOPE && type != LOCATION_QUALIFIER && type != LOCATION_LOCAL_SYMBOL)
|
||||
if (type != LOCATION_TOKEN && type != LOCATION_SCOPE && type != LOCATION_LOCAL_SYMBOL)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -337,7 +337,22 @@ bool QtCodeField::annotateText(
|
||||
|
||||
if (annotation.locationType == LOCATION_QUALIFIER)
|
||||
{
|
||||
// never show qualifier locations active
|
||||
annotation.isActive = false;
|
||||
|
||||
// only show qualifiers focused when mouse over
|
||||
if (annotation.isFocused)
|
||||
{
|
||||
bool isHovered = false;
|
||||
for (const Annotation* a : m_hoveredAnnotations)
|
||||
{
|
||||
if (&annotation == a)
|
||||
{
|
||||
isHovered = true;
|
||||
}
|
||||
}
|
||||
annotation.isFocused = isHovered;
|
||||
}
|
||||
}
|
||||
|
||||
if (wasFocused != annotation.isFocused || wasActive != annotation.isActive)
|
||||
|
||||
@@ -230,7 +230,8 @@ void QtCodeNavigator::addFile(std::shared_ptr<SourceLocationFile> locationFile,
|
||||
locationFile->forEachStartSourceLocation(
|
||||
[&](SourceLocation* location)
|
||||
{
|
||||
if (location->isScopeLocation() || location->getType() == LOCATION_SIGNATURE || location->getType() == LOCATION_COMMENT)
|
||||
if (location->isScopeLocation() || location->getType() == LOCATION_SIGNATURE ||
|
||||
location->getType() == LOCATION_COMMENT || location->getType() == LOCATION_QUALIFIER)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user