Christian Kamm
097850c842
QmlJS: Speed up ValueOwner construction.
...
* Don't build all default values (including the global object)
separately for each ValueOwner instance.
* Instead, keep all global, immutable values in a single, shared
instance.
While refactoring, some cases where we *modified* the global object had
to be removed:
* C++ context properties no longer get injected into the global object,
instead they now have their own scope just above the global one.
* The Qt object's prototype no longer gets modified in Link. Instead,
it's now a reference to the "Qt" object provided in a qmltypes file.
* The whole concept of a function 'Activation' that could potentially
affect the global object was removed.
Change-Id: Id382faf965efa747fcc7a9b0bc2c90429d84d61b
Reviewed-by: Leandro Melo <leandro.melo@nokia.com >
2011-11-25 10:36:42 +01:00
Eike Ziller
e2b0835b58
Merge remote-tracking branch 'origin/2.4'
...
Conflicts:
qtcreator.pri
src/libs/qmljs/qmljstypedescriptionreader.cpp
src/plugins/analyzerbase/startremotedialog.ui
src/plugins/qmldesigner/designercore/include/rewriterview.h
src/plugins/qt4projectmanager/makestep.cpp
Change-Id: If9d15a8c8f73106585fd8ce6ac47c253a40af6b1
2011-11-25 09:48:25 +01:00
Christian Kamm
3e48bb6d19
QmlJS: Add documentation for ScopeChain.
...
Clear up Context documentation a little.
Change-Id: I2ede3dc0f15a972d2748cef1aa579a04f0786106
Reviewed-by: Leandro Melo <leandro.melo@nokia.com >
2011-11-24 19:11:18 +01:00
Christian Kamm
d5b8638b48
QmlJS: Make Evaluate understand more expressions.
...
Change-Id: I718a74ecdbe24db917bbc2d8f3c9abddf051e134
Reviewed-by: Leandro Melo <leandro.melo@nokia.com >
2011-11-24 19:11:01 +01:00
Christian Kamm
756c734e22
QmlJS: Add documentation for Evaluate.
...
Change-Id: I02543af2ce90dfa5bda88533ead39a7dbede90d4
Reviewed-by: Leandro Melo <leandro.melo@nokia.com >
2011-11-24 14:42:29 +01:00
Christian Kamm
fad5cc0166
QmlJS indenter: Fix hang when using 'else (a==a) {}'.
...
Change-Id: Id7b8fba6707b1eaabf8065854f357cf600c809c5
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com >
(cherry picked from commit 567e68a42a )
Reviewed-by: Eike Ziller <eike.ziller@nokia.com >
2011-11-22 13:52:39 +01:00
Christian Kamm
eaf4b5be53
QmlJS check: Extend "don't use var" performance warning.
...
* now also recognizes color, rect, point, size, vector3d
* to do detect these correctly, set the return types on a number of
builtin Qt.* functions
* add test
Change-Id: Ieaeb73be208af2d47e1bb4fa1485dc876705ee20
Reviewed-by: Leandro Melo <leandro.melo@nokia.com >
2011-11-22 13:25:14 +01:00
Christian Kamm
d719489009
QmlJS: Remove unused code.
...
Change-Id: Ic6e7f46a3a7155a1ab41c41e4d9ee9d4832c3717
Reviewed-by: Leandro Melo <leandro.melo@nokia.com >
2011-11-21 15:50:10 +01:00
Christian Kamm
2e724095c1
QmlJS: Fix crash when reading malformed qmltypes files.
...
Task-number: QTCREATORBUG-6587
Change-Id: I0b7c65c1d7f613283e447293daf26673e88ba6e7
Reviewed-by: Eike Ziller <eike.ziller@nokia.com >
2011-11-21 11:11:37 +01:00
Oswald Buddenhagen
c344032bd5
centralize setting of "CONFIG += shared dll" for libraries
...
"dll" and "shared" set each other, but too late to actually test for it
in the project files, so include both.
note that this will slightly modify the build of some of our imported qt
solutions.
Change-Id: I0bd4f41a68fd160f8e87eb0a0fa66096fe70ef3e
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@nokia.com >
2011-11-18 10:40:09 +01:00
Christian Kamm
b671baeffb
QmlJS: Improve completion and hints for functions.
...
* FunctionValues know about optional arguments (for builtins)
* ASTFunctionValues only report themselves as variadic if they
use the 'arguments' array.
* Function argument hint shows optional args and variadic.
* Completion automatically adds parentheses.
Change-Id: Ib2598600ff8b1ce8c5de3bcabd24a3e171ff3a57
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com >
2011-11-16 11:20:37 +01:00
Christian Kamm
a5b26a32b3
QmlJS: Add 'reformat' action which regenerates the whole file.
...
Change-Id: I0aed6c6e197e122200d720eb9291a083095a6299
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com >
2011-11-15 11:31:40 +01:00
Christian Kamm
dfd58916cd
QmlJS: Add documentation for QmlJS::Value.
...
Also:
* Remove unnecessary QmlJS:: qualifications in existing documentation.
* Remove unnecessary explicit links in the documentation.
Change-Id: Icb41941d98b5cfe9d2fb3b3887fafee16635eb13
Reviewed-by: Leandro Melo <leandro.melo@nokia.com >
2011-11-15 11:10:43 +01:00
Christian Kamm
12a1ba08fa
QmlJS indenter: Fix indent after do-while without semicolon.
...
Change-Id: I4909f4640e7cd115b6c5c54c7aca7fca511653c9
Reviewed-by: Leandro Melo <leandro.melo@nokia.com >
2011-11-15 08:58:21 +01:00
Eike Ziller
d1d85ba912
more s/info@qt.nokia.com/qt-info@nokia.com/
...
Change-Id: I5eecac63f45cf5bd192bd2ee42370d6338c1ec9f
Reviewed-by: hjk <qthjk@ovi.com >
2011-11-11 10:53:34 +01:00
Eike Ziller
85cf2b661e
Merge remote-tracking branch 'origin/2.4'
...
Conflicts:
src/libs/qmljs/qmljsinterpreter.cpp
src/libs/qmljs/qmljsinterpreter.h
src/plugins/debugger/qml/scriptconsole.cpp
src/plugins/git/gitplugin.cpp
src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas.cpp
src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas_p.h
Change-Id: Iad59c8d87c72a21c79c047e374c0ab689998af39
2011-11-11 09:46:25 +01:00
Christian Kamm
88d480cd61
QmlJS checks: Fix // @disable-check at beginning of line.
...
Change-Id: Iae9b9f499d3c2c6b3e3cc1be93e2b62508363aec
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-11-08 09:05:24 +01:00
Christian Kamm
386fc347d7
QmlJS: Make Document::Ptr point to a const Document.
...
Change-Id: I15a36c3f918c0ee16f30bc8366df505e0afac949
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-11-08 09:05:12 +01:00
Christian Kamm
64cddc8857
QmlJS: Fixed attached objects.
...
Task-number: QTCREATORBUG-6450
Change-Id: Idd8e2ec3550190a137dbf0fe452c8488fb3fe1ad
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-11-07 15:19:01 +01:00
Christian Kamm
a51120b7db
QmlJS: Documentation.
...
Change-Id: I2a095e38b7d79a5fb39a16d8f32b48c8e28132f6
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@nokia.com >
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-11-07 15:16:59 +01:00
Christian Kamm
de6ea6c3b9
QmlJS: Handle inner ids in 'Wrap in Loader' quick fix.
...
Change-Id: I7385f49928db78abd2deb7783ca0a38288ae7446
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com >
2011-11-04 14:13:17 +01:00
hjk
31600758de
all: s/info@qt.nokia.com/qt-info@nokia.com/
...
Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e
Reviewed-by: Eike Ziller <eike.ziller@nokia.com >
2011-11-03 10:33:19 +01:00
Eike Ziller
912cd548c0
Merge remote-tracking branch 'origin/2.4'
...
Conflicts:
src/libs/qmljs/qmljsinterpreter.cpp
src/libs/qmljs/qmljsinterpreter.h
src/plugins/madde/maemopackagecreationstep.cpp
src/plugins/projectexplorer/buildmanager.cpp
src/plugins/qmljstools/qmljsqtstylecodeformatter.cpp
src/plugins/qmljstools/qmljsqtstylecodeformatter.h
tests/auto/qml/qmleditor/qmlcodeformatter/tst_qmlcodeformatter.cpp
Change-Id: I63ab2ba5dac006c37ccfbae55b023396a4676ff7
2011-11-01 18:16:38 +01:00
Christian Kamm
e733cb2155
QmlJS checks: Add @enable-all-checks annotation.
...
It enables all checks, even those that we deem to annoying to be
enabled by default.
Also fix a bug where some disabled checks had the wrong severity.
Change-Id: Id434ad62dabafac979ee2304a85d368b9ea98fa4
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-10-31 09:38:03 +01:00
Christian Kamm
5ac449a708
QmlJS checks: Change suppression annotation to @disable-check.
...
Change-Id: I913cd757c4f8339a518c947569c5ba651153f1c1
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-10-31 09:37:57 +01:00
Christian Kamm
4521be25cd
QmlJS: Avoid an infinite loop if a qmltypes file has a cycle.
...
The qmltypes files shipped with libraries shouldn't, but could define
components that form a prototype cycle. Use of the new
QmlObjectValue::prototypes() function avoids the code model getting
stuck in an infinite loop for these cases.
For plain ObjectValues this is already solved by using
PrototypeIterator.
Change-Id: I0f562672ab99b454bc3a0121c7a1b9eca43476bb
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-10-31 09:37:46 +01:00
Christian Kamm
a9553c494e
QmlJS indenter: Never touch indent of multi-line strings.
...
Task-number: QTCREATORBUG-6368
Change-Id: Iae68427e429e625214bc0729aaaf313dc3371570
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-10-31 09:37:17 +01:00
Christian Kamm
c8fc9b33ae
QmlJS: Clean up idOfObject() and folding text code.
...
Change-Id: Id3e9d24689c67ce0e12b12b82636177a0344ede1
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com >
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-10-28 15:49:38 +02:00
Eike Ziller
81cce8902e
Merge remote-tracking branch 'origin/2.4'
...
Conflicts:
qtcreator.pri
src/libs/qmljs/qmljscheck.cpp
src/plugins/debugger/gdb/gdbengine.cpp
src/plugins/debugger/gdb/remotegdbserveradapter.cpp
src/plugins/plugins.pro
src/plugins/projectexplorer/buildmanager.cpp
src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
Change-Id: Id2dcebf95b94dc46c1d85908ba1d1378aaf362ac
2011-10-28 10:17:44 +02:00
Christian Kamm
fc7cd25849
QmlJS checks: Make 'unintentional empty block' warning less annoying.
...
Already fixed differently in master.
Change-Id: I92f7665166b2b1ca4f3d4598825b04f3f19d4772
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com >
2011-10-24 10:23:19 +02:00
Christian Kamm
bbb6a4bb64
QmlJS: Fix build.
...
Change-Id: I230442300bf03d229c0168c108eb69fbd98708af
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com >
2011-10-21 08:59:27 +02:00
Christian Kamm
e906bbdb56
QmlJS checks: Warn about extra message suppressions.
...
Reviewed-by: Fawzi Mohamed
Change-Id: I4038cd863ba80c1719417cd03b755b047f7d8b5e
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com >
2011-10-21 08:31:45 +02:00
Christian Kamm
0b75a66407
QmlJS: Support module apis defined by QML modules.
...
Change-Id: I18ec9daf8088f7db5ff2da11da14b539f501bab3
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-10-21 08:21:00 +02:00
Christian Kamm
4565c12f2b
QmlJS: Improve tests/tools/qml-ast2dot.
...
Change-Id: Ifd06745ec823d09ae7b42318d418fa1adb01824b
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com >
2011-10-20 11:04:03 +02:00
Christian Kamm
0ed824762c
QmlJS checks: Suppression of static analysis messages.
...
* Use '// @disable M123' to suppress
* Add quick fix to add these comments
Change-Id: I499f5a6004148afbb346218c6fb01c9ca77b9f73
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com >
2011-10-19 15:09:35 +02:00
Christian Kamm
cf156cd2ea
QmlJS: Add quick fix to wrap element in Loader.
...
Change-Id: Ie8b1624abfd9faa8c6153ad99e48964d597d543c
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com >
2011-10-19 14:21:47 +02:00
Christian Kamm
85d78c6082
QmlJS checks: Add hint about not using var/variant property types.
...
Change-Id: I79c5c4db78eb96eda7c6f5d543bb5063d5670968
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com >
2011-10-19 14:12:47 +02:00
Christian Kamm
567e68a42a
QmlJS indenter: Fix hang when using 'else (a==a) {}'.
...
Change-Id: Id7b8fba6707b1eaabf8065854f357cf600c809c5
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com >
2011-10-19 09:40:12 +02:00
Christian Kamm
3ede0687ba
QmlJS indenter: Improve indentation of function literals.
...
Change-Id: Ic79745eefbf37e42d4dd42e73d3752bed34bbfa9
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-10-19 08:33:28 +02:00
Christian Kamm
4a487b1add
QmlJS indenter: Move reusable code to qmljs lib.
...
Change-Id: I5ab50b586109a9736cda48245807571ce10dfb5b
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-10-19 08:33:21 +02:00
Christian Kamm
89ff3cebe6
QmlJS: Introduce UnknownValue.
...
To distinguish known-to-be-undefined from a genuinely unknown value.
Change-Id: I606b4ea4d726f94553400b8950d3c0a4e76564a8
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-10-18 13:16:18 +02:00
Christian Kamm
8532e7b1b7
QmlJS checks: Limit warning about unintentional empty blocks.
...
width: {
}
should not trigger a warning. We now only warn if { and } are
on the same line.
Change-Id: I45fa846ff63d0a83de782c412212165845c07e72
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-10-18 08:15:11 +02:00
Eike Ziller
8eb8368139
Merge remote-tracking branch 'origin/2.4'
...
Conflicts:
qtcreator.pri
src/libs/qmljs/qmljstypedescriptionreader.cpp
tests/auto/qml/qmleditor/qmlcodeformatter/tst_qmlcodeformatter.cpp
Change-Id: Id032187023bb42f259a87545ceeb3c965dd01a32
2011-10-17 14:22:32 +02:00
Christian Kamm
ea24106373
QmlJS indenter: Fix ternary multiline indent.
...
Task-number: QTCREATORBUG-6208
Change-Id: I7e5267291bc01226b5339cb4abdbb15856c58477
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com >
2011-10-17 11:22:34 +02:00
Aurindam Jana
baafc89dfc
Debugger: Fix build break on Windows
...
Removed inclusion of parser.pri from qml.pri and added QML_PARSER_EXPORT
to QmlJSGrammar.
Task-number: QTCREATORBUG-6292
Change-Id: I6a1fb3e038a6c154c4c3b368d7c7e6eda9975698
Reviewed-by: Kai Koehne <kai.koehne@nokia.com >
2011-10-13 09:25:42 +02:00
Christian Kamm
9abf0e6a9a
QmlJS: Convert more dynamic_casts to value_casts.
...
And introduce a good error message for the case when someone
forgets the specialization of the value_cast template.
Change-Id: Iec55a839e8f5eef5872b1dab8601f66e0e0c88de
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com >
2011-10-13 08:44:28 +02:00
Christian Kamm
0c4bd321e5
Json: Fix indenter for json files.
...
Change-Id: Id864509dd78a70fc34a3798b80f7e1c8991181f4
Reviewed-on: http://codereview.qt-project.org/6038
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com >
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-10-12 11:34:43 +02:00
Christian Kamm
b5a92a1957
Json: Use the javascript editor for json files.
...
Task-number: QTCREATORBUG-4639
Change-Id: Icd0fda434d5ca66056d784dd87240db76e8a442c
Reviewed-on: http://codereview.qt-project.org/6035
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com >
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-10-12 11:34:36 +02:00
Christian Kamm
7ed717ca62
QmlJS: Add more value_casts.
...
And switch all existing dynamic_casts to value_casts.
Change-Id: I93b89358e4802080f40b332074c64f4e91a2bc4c
Reviewed-on: http://codereview.qt-project.org/6311
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com >
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com >
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com >
2011-10-12 10:55:55 +02:00
Christian Kamm
572b3a180b
QmlJS: Compile fix.
...
Change-Id: Ie7d49f1dd54cd8316d660bc8ae6857dc2effc963
Reviewed-on: http://codereview.qt-project.org/6504
Sanity-Review: Christian Kamm <christian.d.kamm@nokia.com >
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com >
2011-10-12 10:55:37 +02:00