QmlJSEditor: Move semantic info updating to document

Change-Id: I804dbd887af1786e7554ec79f94fc8e59db1de5b
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Eike Ziller
2014-01-24 16:53:16 +01:00
parent ae5ef38e3c
commit f8461fbbdf
10 changed files with 535 additions and 507 deletions

View File

@@ -30,6 +30,9 @@
#ifndef QMLJSEDITORDOCUMENT_P_H
#define QMLJSEDITORDOCUMENT_P_H
#include <qmljs/qmljsdocument.h>
#include <qmljstools/qmljssemanticinfo.h>
#include <QObject>
#include <QTimer>
@@ -37,6 +40,7 @@ namespace QmlJSEditor {
namespace Internal {
class QmlJSEditorDocument;
class SemanticInfoUpdater;
class QmlJSEditorDocumentPrivate : public QObject
{
@@ -44,14 +48,22 @@ class QmlJSEditorDocumentPrivate : public QObject
public:
QmlJSEditorDocumentPrivate(QmlJSEditorDocument *parent);
~QmlJSEditorDocumentPrivate();
public slots:
void invalidateFormatterCache();
void reparseDocument();
void onDocumentUpdated(QmlJS::Document::Ptr doc);
void reupdateSemanticInfo();
void acceptNewSemanticInfo(const QmlJSTools::SemanticInfo &semanticInfo);
public:
QmlJSEditorDocument *m_q;
QTimer *m_updateDocumentTimer;
QTimer *m_updateDocumentTimer; // used to compress multiple document changes
QTimer *m_reupdateSemanticInfoTimer; // used to compress multiple libraryInfo changes
int m_semanticInfoDocRevision; // document revision to which the semantic info is currently updated to
SemanticInfoUpdater *m_semanticInfoUpdater;
QmlJSTools::SemanticInfo m_semanticInfo;
};
} // Internal