The distinction between QmlJS and QmlJS::Interpreter has always been
weak and the extra namespace just added an unnecessary complication.
Change-Id: I4db8ef4bd91b5f6bf610a9d23fdbf55bd60250fc
Reviewed-on: http://codereview.qt.nokia.com/2743
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
Previously Context was not entirely thread safe and had to be
copied locally. Now it is thread safe and its lifetime
managed by QSharedPointer.
The non-safe parts were moved into ScopeChain in a previous commit.
Change-Id: I851a93de85cbd6391dbea0fe33b011e2e093addb
Reviewed-on: http://codereview.qt.nokia.com/1695
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
System test-cases are (assumed to be) written in javascript when using
an .qtt filename extension. These modificatons ensure that a js editor
is used whenever an attempt is made to open a file that ends with .qtt.
Also add support for recognising testcases to QmlOutlineModel.
Change-Id: Ibcb68126e5123e8069344cf0c05aa2396b967a12
Reviewed-on: http://codereview.qt.nokia.com/2259
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
Reviewed-by: Bill King <bill.king@nokia.com>
astPath -> rangePath
To make it more explicit that it does not return the full ast path.
declaringMember -> rangeAt
Since things like function expressions and declarations and grouped
property bindings are also ranges and returned by this function.
Change-Id: I70cc99f21635b21dd6f3088a6e5782d84f6f108a
Reviewed-on: http://codereview.qt.nokia.com/1045
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
Guard the incremental updates with beginResetModel/endResetModel
This gives better overall performance then passing the incremental
updates to the views.
Tested-by: Lasse Holmstedt
Creating a LookupContext can be sloooow for large projects. We create
one instance for every update in the Outline to get the right icons.
Take a shortcut here and just use the element name directly, ignoring
packages names etc.
This is a hot fix for 2.1, a following patch will change the Icon
retrieval API accordingly.
Reviewed-by: Roberto Raggi
Task-number: QTCREATORBUG-2859
The Outline is only updated (with a delay) if the current text is syntactically valid.
Prevent the outline from changing the text underneath via drag&drop if
the outline model is 'behind'.
Reviewed-by: Christian Kamm
* If possible, create LookupContexts through SemanticInfo; it caches the
linked Context and will be faster.
* Contexts now own their Engine.
Reviewed-by: Lasse Holmstedt
Cut down update times of Outline by a magnitude by only emitting
itemChanged signal if absolutely needed. This doesn't include the change
of the icon, because QIcon is missing a comparison operator ...
E.g. "anchors {}" is represented in the AST as a UiObjectDefinition.
Treat it nevertheless like a property in the outline, such that it
isn't shown in the outline if you deactivate showing bindings.
This reverts commit 62b83fcfd, which was about filtering 'ghost'
elements out like "Rectangle { id }", where id was parsed as a
UiObjectDefinition. Unfortunately, "anchors" also is represented as
an ObjectDefinition ... Anyhow, the original problem does not
occur any more, so we can just revert this.
Previously we're setting the properties of the items one by one, each
time potentially triggering an update of the view. Actually this
uncovered an error in the Filter, which was only reacting to the first
change and therefore didn't take the item type into account on first
load.
Instead, we now use our own QStandardItem class which can be used to
assign all values at once.
The parser represents incomplete script bindings as element definitions,
e.g. for 'Item { id }', 'id' is represented as an UiObjectDefinition.
Catch this in the outline model by explicitly checking whether a
UiObjectDefinition starts with a capital letter.