Skip to content
Snippets Groups Projects
Commit 5ae67214 authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlJSEditor: Don't trigger a reparse when dependencies change.

A semantic rehighlight suffices. This should avoid some parsing cycles
introduced earlier.

Reviewed-by: Roberto Raggi
parent 9cbafa96
No related branches found
No related tags found
No related merge requests found
......@@ -635,6 +635,11 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) :
m_updateUsesTimer->setSingleShot(true);
connect(m_updateUsesTimer, SIGNAL(timeout()), this, SLOT(updateUsesNow()));
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(this, SIGNAL(textChanged()), this, SLOT(updateDocument()));
connect(this, SIGNAL(textChanged()), this, SLOT(updateUses()));
......@@ -753,7 +758,7 @@ void QmlJSTextEditor::onDocumentUpdated(QmlJS::Document::Ptr doc)
|| doc->documentRevision() != document()->revision()) {
// didn't get the currently open, or an up to date document.
// trigger a semantic rehighlight anyway, after a time
updateDocument();
m_semanticRehighlightTimer->start();
return;
}
......
......@@ -260,6 +260,7 @@ private:
QTimer *m_updateDocumentTimer;
QTimer *m_updateUsesTimer;
QTimer *m_semanticRehighlightTimer;
QComboBox *m_methodCombo;
ModelManagerInterface *m_modelManager;
QTextCharFormat m_occurrencesFormat;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment