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
This commit is contained in:
Christian Kamm
2010-04-01 15:47:52 +02:00
parent 9cbafa9696
commit 5ae67214a1
2 changed files with 7 additions and 1 deletions

View File

@@ -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;
}