Commit Graph

72 Commits

Author SHA1 Message Date
Christian Kamm
f87dc61986 QmlJS: Split Context and ScopeChain.
Context is created by Link and has information about imports
for all Documents in a Snapshot.

ScopeChain represents how lookup is done at a specific place in
a Document.

Change-Id: I874102d57bbaf1a497fa3f27633bed6ee75dcf10
Reviewed-on: http://codereview.qt.nokia.com/1694
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-08-08 12:05:03 +02:00
Christian Kamm
8b778b266b QmlJS: Rename Interpreter::Engine -> ValueOwner
Also move to a separate file.

Change-Id: I05910e8cf04a533b5d09a1c16e612e3b99b1d606
Reviewed-on: http://codereview.qt.nokia.com/1039
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-07-05 08:44:16 +02:00
Christian Kamm
33a130e222 QmlJS: Fix completion inside grouped propery bindings.
Task-number: QTCREATORBUG-3541
Change-Id: Ida8e59b65836c8515fbfbd2a9e4737d9ae04e76c
Reviewed-on: http://codereview.qt.nokia.com/639
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-06-23 11:47:07 +02:00
Fawzi Mohamed
fe564852ad Qmljs: added scope for blocks in UiScriptBindings and UiPublicMember
correctly insert the scope for code blocks in UiScriptBindings and
UiPublicMember, and improve find usages for types (correctly detecting
variables in the same scope)

Change-Id: Iaaf1a59f041f3831fbe04243b220fb85fde76479
Reviewed-on: http://codereview.qt.nokia.com/335
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2011-06-07 13:04:21 +02:00
Fawzi Mohamed
96129accb5 Qml Editor: accept imports with absolute paths
qmljs code model now correctly handles absolute paths in imports

Change-Id: I6a4bcfbe9a8d9ab70b5fcac1df36ba9802ff5efe
Reviewed-on: http://codereview.qt.nokia.com/256
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2011-05-31 10:54:36 +02:00
Christian Kamm
d67b7d17dc QmlJS: Refactor ObjectValue members.
* property -> lookupMember
* setProperty -> setMember
* removeProperty -> removeMember

Change-Id: I638479ee2b90b684283e714630bdcab237f6b3f2
Done-with: Fawzi Mohamed
Reviewed-on: http://codereview.qt.nokia.com/77
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-05-24 11:55:03 +02:00
Tobias Hunger
aa2acec14c Fix/add copyright headers
Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
2011-05-06 15:17:05 +02:00
hjk
8397663964 Update license. 2011-04-13 11:49:28 +02:00
Christian Kamm
dd1de1b82f qmldump: Make Creator able to read qmldump's new output.
Task-number: QTCREATORBUG-3048
2011-02-09 10:42:48 +01:00
con
d1023c7614 It's 2011 now.
Reviewed-by: hjk
2011-01-12 09:46:24 +01:00
Christian Kamm
5de7be5f91 LanguageUtils: Add FakeMetaObject and ComponentVersion. 2011-01-04 15:58:21 +01:00
con
b1bcf081d8 Merge branch '2.1'
Conflicts:
	src/plugins/coreplugin/basemode.cpp
	src/plugins/coreplugin/basemode.h
	src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp
	src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.h
	src/plugins/debugger/cdb/cdbsymbolpathlisteditor.cpp
	src/plugins/debugger/debuggeragents.cpp
	src/plugins/debugger/debuggeruiswitcher.cpp
	src/plugins/debugger/debuggeruiswitcher.h
	src/plugins/projectexplorer/buildconfigdialog.cpp
	src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp
	src/plugins/qmldesigner/components/propertyeditor/colorwidget.h
	src/plugins/qmldesigner/designercore/include/enumeratormetainfo.h
	src/plugins/qmldesigner/designercore/include/modelutilities.h
	src/plugins/qmldesigner/designercore/include/nodeinstance.h
	src/plugins/qmldesigner/designercore/include/propertymetainfo.h
	src/plugins/qmldesigner/designercore/instances/graphicsscenenodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/graphicsscenenodeinstance.h
	src/plugins/qmldesigner/designercore/instances/graphicsviewnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/graphicswidgetnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/graphicswidgetnodeinstance.h
	src/plugins/qmldesigner/designercore/instances/nodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/qmlviewnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/widgetnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/widgetnodeinstance.h
	src/plugins/qmldesigner/designercore/metainfo/enumeratormetainfo.cpp
	src/plugins/qmldesigner/designercore/metainfo/propertymetainfo.cpp
	src/plugins/qmldesigner/designercore/model/modelutilities.cpp
	src/plugins/snippets/inputwidget.cpp
	src/plugins/snippets/snippetscompletion.cpp
	src/plugins/snippets/snippetscompletion.h
	src/plugins/snippets/snippetspec.cpp
	src/plugins/snippets/snippetsplugin.cpp
	src/plugins/snippets/snippetswindow.cpp
	src/plugins/snippets/snippetswindow.h
	src/plugins/texteditor/snippetsparser.cpp
	src/tools/qml/qmldom/main.cpp
	tests/manual/trk/runner.cpp
	tests/manual/trk/trkolddevice.cpp
	tests/manual/trk/trkolddevice.h
	tests/manual/trk/trkserver.cpp
2010-12-17 17:00:53 +01:00
con
04e32b0049 License headers. 2010-12-17 16:03:42 +01:00
Christian Kamm
05831a8ea5 QmlJS: Fix binding and scoping function expressions.
Reviewed-by: Erik Verbruggen
2010-11-25 15:06:44 +01:00
Christian Kamm
34093064fe QmlJS: Make evaluator understand expression statements.
Reviewed-by: Erik Verbruggen
2010-11-25 15:06:44 +01:00
Christian Kamm
93967104f3 QmlJS: Reactivate instantiating component scope detection.
* Bind::usesQmlPrototype is now significantly more performant
* type environments are no longer hashed by filename, but rather
  by Document *
* duplicate scope builds are avoided

Task-number: QTCREATORBUG-2835
Reviewed-by: Erik Verbruggen
2010-11-25 15:06:44 +01:00
Christian Kamm
6c9f32ba60 QmlJS: Also bind FunctionExpressions.
Reviewed-by: Erik Verbruggen
2010-11-16 15:27:26 +01:00
Christian Kamm
b2369973a4 QmlJS: Fix a performance problem.
In order to determine all components that instantiate a given component,
Bind::usesQmlPrototype was called on each document in the snapshot.
That, in turn, had to iterate over all object definitions inside the
document, resolving their prototype references.

All in all, it lead to a very large amount of fairly expensive lookups
that were slowing down Creator considerably.

Reviewed-by: Erik Verbruggen
2010-10-20 14:54:07 +02:00
Christian Kamm
a30c016189 QmlJS: Fix several crashes when UiQualifiedId::name is 0.
Task-number: QTCREATORBUG-2737
Reviewed-by: Kai Koehne
2010-10-14 15:15:56 +02:00
Christian Kamm
2fff849ae1 QmlJS: Fix initializer of property declaration not being visited in Bind
This lead to the semantic checker reporting incorrect errors in these
initializers.

Task-number: QTCREATORBUG-2340
Reviewed-by: Roberto Raggi
2010-09-28 15:50:42 +02:00
Christian Kamm
c7b3e3c81c 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.
2010-09-16 15:51:21 +02:00
Christian Kamm
97c07292aa Qml: Make import classification in Bind less verbose. 2010-09-16 15:51:21 +02:00
Christian Kamm
8df6dd6d7d QmlJS: Add initial documentation for the base classes of the code model. 2010-09-15 15:26:34 +02:00
Christian Kamm
898098c1f2 QmlJS: Allow lookups on const Contexts. Pass const Contexts where ok.
In preparation for caching Contexts.

Reviewed-by: Erik Verbruggen
2010-08-25 11:53:23 +02:00
Christian Kamm
8519ca11c3 QmlJS: Allow 'follow symbol' to jump to the target of a file import.
Task-number: QTCREATORBUG-1736
2010-07-16 11:17:10 +02:00
Christian Kamm
4ecf0349c5 QmlJS: Make 'follow symbol' work on JS functions.
Task-number: QTCREATORBUG-1757
2010-07-16 10:50:28 +02:00
Christian Kamm
a34676238f QmlJS: Remove unused Bind::currentObjectValue.
The function was not used and made no sense.
2010-06-22 13:36:54 +02:00
Christian Kamm
ea5ca79900 QmlJS: Add ComponentVersion class to simplify dealing with versions. 2010-06-09 14:36:53 +02:00
Christian Kamm
0d5d6344bd QmlJS: Collect import version numbers in Bind. 2010-06-09 14:36:53 +02:00
Christian Kamm
28ec223314 QmlJS: Fix completion for grouped property bindings.
Task-number: QTCREATORBUG-1388
Reviewed-by: Roberto Raggi
2010-05-12 14:11:23 +02:00
Christian Kamm
9af4f2c64f QmlJS: Remove unused function environment from binder.
This used to contain all functions declared in Script blocks. With them
gone, there's no reason to keep it.
2010-04-28 10:01:36 +02:00
Lasse Holmstedt
4d0ac7c77e qml inspector now shows correct categories for custom properties
Also, a class name is added in qmjs::bind so that we have a class name
for custom properties defined inside a component.
2010-04-23 09:58:29 +02:00
Christian Kamm
3096b2a06f QmlJS: Set importing scopes for scripts correctly.
They had not yet been updated to the new way of importing javascript.

Reviewed-by: Erik Verbruggen
2010-04-22 16:36:43 +02:00
Christian Kamm
ce99372c63 QmlJS: Add variables and functions in a JS function to code model.
Allows completion of local variable and function names.

Task-number: QTCREATORBUG-942
Reviewed-by: Roberto Raggi
2010-04-20 15:20:52 +02:00
Christian Kamm
9402fad726 QmlJSEditor: Build Snapshot by looking at imports of parsed files.
Previously we just scanned every directory containing a qml file for
other qml files.

This makes import ".." work.

Reviewed-by: Erik Verbruggen
2010-04-06 09:53:57 +02:00
Christian Kamm
9ea01cf5fb Improve Qml code model import handling.
* Fill the snapshot with files that could be imported.
* Implement package imports.

* The qmldir file is not parsed yet.

Reviewed-by: Erik Verbruggen
2010-03-18 11:25:37 +01:00
hjk
9595504bda Long live the king! 2010-03-05 11:28:13 +01:00
Christian Kamm
08b9323f0c Fix completion and checking for Script elements. Update Qml type xml.
* The "Script" type is now implicitly available without imports.
* No errors for bindings inside a Connections element.

Reviewed-by: Roberto Raggi
2010-03-03 11:38:17 +01:00
Erik Verbruggen
13d7612f09 Removed private header dependencies and introduced loading QML types from XML file. 2010-03-01 13:13:02 +01:00
Christian Kamm
9245c7bab5 Removed unnecessary includes of qmljslink.h 2010-02-12 10:10:20 +01:00
Christian Kamm
2b1adbf610 Improve building of the Qml/JS scope chain.
* For JS files: Add each Qml component that sources the file in a Script
  tag to the scope chain.
* For Qml components: Add each component that instantiates the component
  to the scope chain.
* Generate the full list of documents required for completion in a
  given file. Previously, files that included the file were missing.
2010-02-11 19:08:33 +01:00
Roberto Raggi
bdf8c94809 Get rid off the friend QmlJS::Link declaration. 2010-02-10 17:06:32 +01:00
Roberto Raggi
967ed09c29 Initial support of `Follow symbol under cursor' for QML/JS. 2010-02-09 11:37:58 +01:00
Christian Kamm
e984691fe6 Fix prototype reference resolution for Qml objects. 2010-02-04 10:34:49 +01:00
Roberto Raggi
fcf81b22ed Get rid of BindPtr.
There is no reason to store the Bind object in a QSharedPointer because the `binder' has the same
lifetime of its document.
2010-02-03 15:59:15 +01:00
Roberto Raggi
976d74ca73 Add support for lazy prototypes.
Done-with: ckamm
2010-02-03 15:42:32 +01:00
Roberto Raggi
1f0b717ad2 Completion for global variables in JS.
* Support for lookup JS vs Qml
* Bind global variables.

Done-with: ckamm
2010-02-03 14:34:06 +01:00
Roberto Raggi
95849cb0bd Store bindings and definitions in one single table. 2010-02-03 09:34:28 +01:00
Roberto Raggi
14ffb1e465 Some refactoring needed to create ranges for JavaScript functions. 2010-02-02 16:36:14 +01:00
Christian Kamm
03fa188b41 Bind each QML document after parsing. Link them before use.
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2010-02-02 16:03:43 +01:00