diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index fd4a553e54756a4e904fe906b90d02809cd977d1..67b299755cb7a7be2c5ce7fbcf26a998a538eeba 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -638,7 +638,7 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) : m_semanticRehighlightTimer = new QTimer(this); m_semanticRehighlightTimer->setInterval(UPDATE_DOCUMENT_DEFAULT_INTERVAL); m_semanticRehighlightTimer->setSingleShot(true); - connect(m_semanticRehighlightTimer, SIGNAL(timeout()), this, SLOT(semanticRehighlight())); + connect(m_semanticRehighlightTimer, SIGNAL(timeout()), this, SLOT(forceSemanticRehighlight())); connect(this, SIGNAL(textChanged()), this, SLOT(updateDocument())); connect(this, SIGNAL(textChanged()), this, SLOT(updateUses())); @@ -1212,6 +1212,11 @@ QString QmlJSTextEditor::insertParagraphSeparator(const QTextCursor &) const return QLatin1String("}\n"); } +void QmlJSTextEditor::forceSemanticRehighlight() +{ + m_semanticHighlighter->rehighlight(currentSource(/* force = */ true)); +} + void QmlJSTextEditor::semanticRehighlight() { m_semanticHighlighter->rehighlight(currentSource()); diff --git a/src/plugins/qmljseditor/qmljseditor.h b/src/plugins/qmljseditor/qmljseditor.h index 5aefcab2690a4a368738a6d3e93fd6dc0e40a1bc..6bfb3b4722c9b534f0207ba7f9ad80550c72caa3 100644 --- a/src/plugins/qmljseditor/qmljseditor.h +++ b/src/plugins/qmljseditor/qmljseditor.h @@ -233,6 +233,7 @@ private slots: void renameIdUnderCursor(); void semanticRehighlight(); + void forceSemanticRehighlight(); void updateSemanticInfo(const QmlJSEditor::Internal::SemanticInfo &semanticInfo); protected: