Commit Graph

136 Commits

Author SHA1 Message Date
Christian Kamm
6c9f32ba60 QmlJS: Also bind FunctionExpressions.
Reviewed-by: Erik Verbruggen
2010-11-16 15:27:26 +01:00
Christian Kamm
f7a077b1fa QmlJS: Avoid infinite loop with recursive prototypes. 2010-11-15 10:36:22 +01:00
Christian Kamm
83e7d7c350 QmlJS: Add a UrlValue.
This will allow distinguishing mere strings from urls and allow
different completion.

Reviewed-by: Erik Verbruggen
2010-11-12 10:35:41 +01:00
Thomas Hartmann
bb9a9d060f QmlObjectValue: bugifx for QmlObjectValue::propertyType()
We have to follow the prototype chain

Reviewed-by: Christian Kamm
2010-11-11 11:49:11 +01:00
Thomas Hartmann
d63199ca13 QmlJS: Resolve property types within package.
Reviewed-by: Christian Kamm
2010-11-11 11:49:11 +01:00
Christian Kamm
806c8a563d QmlObjectValue: Add convenience functionality.
Added
hasLocalProperty()
hasProperty()
keysForEnum()

Reviewed-by: Christian Kamm
2010-11-11 11:49:11 +01:00
Thomas Hartmann
ba39234627 QmlJS: Adding IntValue and RealValue
This allows to distinguish between int an real numbers

Reviewed-by: Christian Kamm
2010-11-11 11:49:11 +01:00
Thomas Hartmann
f7e7de44cb QmlJS: Dump isWritable and isPointer for types.
Reviewed-by: Christian Kamm
2010-11-11 11:49:11 +01:00
Thomas Hartmann
4255220c35 QmlJS: Fixing type hierarchy for holes (non exported types)
Done-with: Christian Kamm
2010-11-11 11:49:10 +01:00
Christian Kamm
8cd68b3b06 QmlJS: Fix completion for 'anchors.' and similar properties.
The detection of whether a type or one of its children is exported was
broken when we fixed the type information for the QtQuick module.

Reviewed-by: Erik Verbruggen
2010-10-27 18:19:45 +02:00
Christian Kamm
872f7eb459 QmlJS: Fix completion for enums on the global Qt object.
Reviewed-by: Erik Verbruggen
2010-10-19 11:08:09 +02:00
Christian Kamm
4751d92df4 QmlJS: Always register C++ based components with their C++ name.
This is the name that other components will refer to it by. For
instance, MouseArea has a 'drag' property with type 'QDeclarativeDrag',
since QDeclarativeDrag was only exported as Qt.Drag and QtQuick.Drag,
the type lookup didn't manage to resolve the name.
(cherry picked from commit b53ba61248)
2010-10-08 13:09:31 +02:00
Christian Kamm
6f1c1af833 QmlJS: Prepare qmldump for multiply exported C++ objects.
In the future, builtin objects are going to be exported in Qt 4.7 and
QtQuick 1.0.

Reviewed-by: Roberto Raggi
2010-10-01 10:14:29 +02:00
Christian Kamm
3f505e9982 QmlJS: Add initial 'Find Usages' support. 2010-09-24 14:11:06 +02:00
Christian Kamm
6755edc351 QmlJS: Cache some commonly used QML specific objects. 2010-09-24 14:11:06 +02:00
Christian Kamm
bfd7fd464e QmlJS: Synchronize Engine::registerValue.
When multiple threads share the Bind instance in a Document and do
lookup on the objects contained inside, that may trigger a new object
creation in some situations - which needs to be synchronized.
2010-09-24 14:11:06 +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
88601712c6 QmlJS: Make ScopeChain more const-correct.
We don't want people modifying the shared component chain on a
const Context *.
2010-08-30 14:12:06 +02:00
Christian Kamm
1a9c69ddb0 QmlJS: Fix crash when opening JS files.
Now that Contexts are cached, it needs to be copyable. However, the
ScopeChain has a QmlComponentChain member that owns resources and didn't
have a correct copy constructor or copy assignment operator.

I've made QmlComponentChain non-copyable and store a shared pointer to
an instance instead, as it will generally not change for a given
context.

Reviewed-by: Lasse Holmstedt
2010-08-27 09:42:07 +02:00
Christian Kamm
cea32d6467 QmlJS: Fix possible segfaults with null documents. 2010-08-26 11:34:29 +02:00
Christian Kamm
87e04df257 QmlJS: Refactor LookupContext creation for speed.
* If possible, create LookupContexts through SemanticInfo; it caches the
  linked Context and will be faster.
* Contexts now own their Engine.

Reviewed-by: Lasse Holmstedt
2010-08-26 11:34:29 +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
Leandro Melo
9946711166 QmlJS: Don't detect type from expression if the type is given explicitly.
To make sure
property color foo: "white"
is of type color, not string.

Done-with: ckamm
2010-07-27 13:43:51 +02:00
Leandro Melo
302e93d67f QmlJS: Set type correctly for color properties.
Done-with: ckamm
2010-07-27 13:43:50 +02:00
Kai Koehne
be777c647e QmlJS: Fix compilation warning 2010-07-23 07:46:05 +02:00
Kai Koehne
7f5c790358 Compilation fix (MSVC) 2010-07-16 11:34:01 +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
con
ede2a7c975 Merge remote branch 'origin/2.0'
Conflicts:
	doc/qtcreator.qdoc
	share/qtcreator/gdbmacros/dumper.py
	src/libs/qmljs/qmljs-lib.pri
	src/plugins/debugger/breakhandler.cpp
	src/plugins/projectexplorer/projectexplorer.h
	src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.h
2010-06-30 14:25:09 +02:00
Christian Kamm
38e8c0dfd0 QmlJS: Set the return value of the JS type constructors.
Task-number: QTCREATORBUG-1737
Reviewed-by: Erik Verbruggen
2010-06-28 09:49:45 +02:00
Christian Kamm
c4a979a99f QmlJS: Fix completion for slots.
When reading the xml file describing the Qml types, we incorrectly
classified all functions as methods. They should be slots, since
otherwise qmldump couldn't have dumped them in the first place.

Task-number: QTCREATORBUG-1755
Reviewed-by: Erik Verbruggen
2010-06-28 09:45:37 +02:00
Christian Kamm
4271d2a21f QmlJS: Make the qml instantiating component chain more useful.
By actually storing the documents instead of only the root and id
environments.
2010-06-25 17:10:14 +02:00
Christian Kamm
123607ad70 QmlJS: Make variables in imported JS documents show up in completion.
Filtering them out has long since become unnecessary. It was used back
when JS files were sourced from Script elements - there they'd only
make the functions available. Now functions and variables are imported.

Task-number: QTCREATORBUG-1735
Reviewed-by: Erik Verbruggen
2010-06-25 13:34:45 +02:00
con
b0040dc858 Merge remote branch 'origin/2.0'
Conflicts:
	src/plugins/projectexplorer/taskwindow.cpp
	src/shared/proparser/profileevaluator.cpp
2010-06-10 15:00:16 +02:00
Christian Kamm
45415783e7 QmlJS: Get rid of xml file describing qml builtin types.
The type information is now generated at runtime.
2010-06-10 11:33:04 +02:00
Robert Loehning
0aaa9a82b1 Compile fix for MSVC 2010-06-09 15:46:54 +02:00
Christian Kamm
e307bc2506 QmlJS: Store plugin metatypes in LibraryInfo. Rework type loading. 2010-06-09 14:36:54 +02:00
Christian Kamm
649cebda32 QmlJS: Fix windows namespace issue with ComponentVersion.
Done-with: owolff
2010-06-09 14:36:54 +02:00
Christian Kamm
fa79add293 QmlJS: Check for existance of qmldump binary before using it. 2010-06-09 14:36:54 +02:00
Christian Kamm
f9d7872761 QmlJS: Use ComponentVersion everywhere. 2010-06-09 14:36:53 +02:00
Christian Kamm
822520c304 QmlJS: Get at types defined in plugins by running qmldump on them.
Task-number: QTCREATORBUG-1021
Reviewed-by: Roberto Raggi
2010-06-09 14:36:53 +02:00
Christian Kamm
313d30654e QmlJS: Avoid infinite recursion when encountering property loops.
Such as
property int foo: bar
property int bar: foo.

Task-number: QTCREATORBUG-1389
Reviewed-by: Roberto Raggi
2010-06-08 15:37:16 +02:00
Christian Kamm
3b8b6e89cc QmlJS: Autocomplete dot and colon for properties.
Reviewed-by: Roberto Raggi
2010-06-07 17:37:45 +02:00
Erik Verbruggen
ea2054a945 Fixed uninitialized members. 2010-06-04 11:15:38 +02:00
Erik Verbruggen
eed0241d97 Fixed a couple of null-checks/-returns. 2010-06-04 11:15:38 +02:00
Erik Verbruggen
112df597db Fixed default property discovery for custom QML components.
Reviewed-by: Christian Kamm
2010-05-31 12:21:12 +02:00
Christian Kamm
62141475e3 QmlJS: Potentially fix hard-to-reproduce crash in JS completion.
* Context::build was potentially dangerous. Link and ScopeBuilder
  went out of scope before their results stopped being used.
* ScopeBuilder: If no function scope object was found, don't add it.

Reviewed-by: Erik Verbruggen
2010-05-19 14:23:08 +02:00
Christian Kamm
da6b372575 QmlJS: Move Q_DECLARE_TR_FUNCTIONS to the start of class declarations.
The documentation requires having it there.
2010-05-19 13:42:56 +02:00
Christian Kamm
4e498caf30 Fix the build.
50cc55af80 broke it.
2010-05-19 13:39:54 +02:00
Christian Kamm
50cc55af80 QmlJS: Change to a nicer way of marking strings for translation.
Reviewed-by: ossi
2010-05-19 13:32:11 +02:00
Christian Kamm
fadfe9c64e QmlJS: Generalize EasingCurve name check to all enums.
Reviewed-by: Erik Verbruggen
2010-05-19 12:24:32 +02:00