forked from qt-creator/qt-creator
qmljseditor: Improve speed of QML/JS Editor for large files
avoid using extra selections for warnings folding them into the normal semantic update. Extra selections impose a relatively large overhead (and need expensive text cursor operations). Unlike C++ Qml warnings are continuosly recomputed in the current file of the editor, but not listed in the issue panel, unless one explicitly triggers the qml checks. Using the normal sematic update for warnings avoids QTextCursor operations, and uses batched applies. Unfortunately getting the tooltips from the additional formats instead of using the extra selections requires private API, so Ranges are also stored separately. Change-log: [Qml/JS Support] Improved speed of QML/JS Editor for large files with lots of warnings. Change-Id: I1f996231ef35d7cd77a79af58dbae2098fbbc83e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -40,6 +40,8 @@
|
||||
|
||||
#include <QSharedPointer>
|
||||
#include <QModelIndex>
|
||||
#include <QTextLayout>
|
||||
#include <QVector>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QComboBox;
|
||||
@@ -105,6 +107,7 @@ public:
|
||||
QmlJSTools::SemanticInfo semanticInfo() const;
|
||||
bool isSemanticInfoOutdated() const;
|
||||
int editorRevision() const;
|
||||
QVector<QTextLayout::FormatRange> diagnosticRanges() const;
|
||||
|
||||
Internal::QmlOutlineModel *outlineModel() const;
|
||||
QModelIndex outlineModelIndex();
|
||||
@@ -113,7 +116,6 @@ public:
|
||||
|
||||
TextEditor::IAssistInterface *createAssistInterface(TextEditor::AssistKind assistKind,
|
||||
TextEditor::AssistReason reason) const;
|
||||
|
||||
public slots:
|
||||
virtual void setTabSettings(const TextEditor::TabSettings &ts);
|
||||
void reparseDocument();
|
||||
@@ -192,6 +194,7 @@ private:
|
||||
int m_futureSemanticInfoRevision;
|
||||
|
||||
QList<TextEditor::QuickFixOperation::Ptr> m_quickFixes;
|
||||
QVector<QTextLayout::FormatRange> m_diagnosticRanges;
|
||||
|
||||
QmlJS::IContextPane *m_contextPane;
|
||||
int m_oldCursorPosition;
|
||||
|
||||
Reference in New Issue
Block a user