forked from qt-creator/qt-creator
QmlJS: Speed up Link significantly, provide more info on imports.
Link now caches imports. That means importing the same library (say, Qt) from more than one file no longer creates an importing namespace for each one. Instead, a single one is created for the instance of Link. To make this work, the type environment in ScopeChain has been given its own type: Interpreter::TypeEnvironment. That has the added benefit of being able to carry meta-information about imports. You can use TypeEnvironment::importInfo(qmlComponentName) to get information about the import node that caused the import of the component.
This commit is contained in:
@@ -236,7 +236,7 @@ bool Document::parse_helper(int startToken)
|
||||
_ast = parser.rootNode();
|
||||
_diagnosticMessages = parser.diagnosticMessages();
|
||||
|
||||
_bind = new Bind(this);
|
||||
_bind = new Bind(this, &_diagnosticMessages);
|
||||
|
||||
return _parsedCorrectly;
|
||||
}
|
||||
|
Reference in New Issue
Block a user