forked from qt-creator/qt-creator
QmlJS: Improve performance by avoiding two links in SemanticHighlighter.
Reviewed-by: Roberto Raggi
This commit is contained in:
@@ -154,10 +154,10 @@ public:
|
||||
} // end of anonymous namespace
|
||||
|
||||
|
||||
Check::Check(Document::Ptr doc, const Snapshot &snapshot, const QStringList &importPaths)
|
||||
Check::Check(Document::Ptr doc, const Snapshot &snapshot, const Context *linkedContextNoScope)
|
||||
: _doc(doc)
|
||||
, _snapshot(snapshot)
|
||||
, _link(&_context, doc, snapshot, importPaths)
|
||||
, _context(*linkedContextNoScope)
|
||||
, _scopeBuilder(doc, &_context)
|
||||
, _ignoreTypeErrors(false)
|
||||
{
|
||||
@@ -171,7 +171,6 @@ QList<DiagnosticMessage> Check::operator()()
|
||||
{
|
||||
_messages.clear();
|
||||
Node::accept(_doc->ast(), this);
|
||||
_messages.append(_link.diagnosticMessages());
|
||||
return _messages;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
#include <qmljs/qmljsdocument.h>
|
||||
#include <qmljs/qmljsinterpreter.h>
|
||||
#include <qmljs/qmljslink.h>
|
||||
#include <qmljs/qmljsscopebuilder.h>
|
||||
#include <qmljs/parser/qmljsastvisitor_p.h>
|
||||
|
||||
@@ -46,7 +45,7 @@ class QMLJS_EXPORT Check: protected AST::Visitor
|
||||
Q_DECLARE_TR_FUNCTIONS(QmlJS::Check)
|
||||
|
||||
public:
|
||||
Check(Document::Ptr doc, const Snapshot &snapshot, const QStringList &importPaths);
|
||||
Check(Document::Ptr doc, const Snapshot &snapshot, const Interpreter::Context *linkedContextNoScope);
|
||||
virtual ~Check();
|
||||
|
||||
QList<DiagnosticMessage> operator()();
|
||||
@@ -72,7 +71,6 @@ private:
|
||||
Snapshot _snapshot;
|
||||
|
||||
Interpreter::Context _context;
|
||||
Link _link;
|
||||
ScopeBuilder _scopeBuilder;
|
||||
|
||||
QList<DiagnosticMessage> _messages;
|
||||
|
||||
Reference in New Issue
Block a user