CppEditor: Fix race condition for highlighting of local usages

Starting a renaming action involves looking up local usages. In this
case, a different code path than normal updates the editor's extra
selections, in order to make sure that the occurrence to be edited is
rendered in a special way. We must therefore prevent the normal handler
from taking action, as it would overwrite abovementioned special
selection.

Change-Id: Ia811b49b3023a0a366a43a69cc01e6b2b370acb5
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-01-14 16:13:29 +01:00
parent ab963bd4f1
commit 12c0aadc82
4 changed files with 15 additions and 5 deletions

View File

@@ -805,6 +805,11 @@ bool CppEditorWidget::isSemanticInfoValid() const
return isSemanticInfoValidExceptLocalUses() && d->m_lastSemanticInfo.localUsesUpdated;
}
bool CppEditorWidget::isRenaming() const
{
return d->m_localRenaming.isActive();
}
SemanticInfo CppEditorWidget::semanticInfo() const
{
return d->m_lastSemanticInfo;