Commit Graph

124 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
03689eeb50 QmlJS checks: Allow calling some builtin constructors as functions.
String, Boolean, Number and Object perform type conversion. Date returns
the current date.

Change-Id: I51e5bcbb0fa85ceb30b3ee3749f96c3e3b12ca21
Reviewed-on: http://codereview.qt-project.org/6043
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-10-12 08:50:26 +02:00
Christian Kamm
d48566234f QmlJS checks: Hint about extra parentheses.
Migrated from QtChecker.

Change-Id: I85f7dd039ac858b103dfe0af257f66031540c5de
Reviewed-on: http://codereview.qt-project.org/5969
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-10-12 08:49:41 +02:00
Christian Kamm
038111c384 QmlJS checks: Disable some checks when imports failed.
The important error in this case is on the import.

Change-Id: I3a547ca7ac44a89aba6819ea80ec52185071408a
Reviewed-on: http://codereview.qt-project.org/5879
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
Sanity-Review: Christian Kamm <christian.d.kamm@nokia.com>
2011-10-12 08:49:30 +02:00
Christian Kamm
bf3bf658c4 QmlJS checks: Add hint about not using multiple statements per line.
Migrated from QtChecker.

Change-Id: Ia76067a5f0e443a61a7b78ca9081f5a1bb51b471
Reviewed-on: http://codereview.qt-project.org/5861
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-10-10 14:40:17 +02:00
Christian Kamm
1b0dc76564 QmlJS checks: Add warning about 'eval'.
Migrated from QtChecker.

Change-Id: I4b3e8993c7b9f697497d2199b24bf49379dbc1b4
Reviewed-on: http://codereview.qt-project.org/5860
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-10-10 14:40:10 +02:00
Christian Kamm
be9d25ec64 QmlJS checks: Warn when using some builtin constructors.
Number, String, Array, Object, Function and Boolean should not
be used.

Migrated from QtChecker.

Change-Id: I8aee41f12389196ed49c44e26eb04d3fac040a2b
Reviewed-on: http://codereview.qt-project.org/5859
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-10-10 14:40:03 +02:00
Christian Kamm
c82d53d4ae QmlJS checks: Add confusing +/- check.
Migrated from QtChecker.

Change-Id: I06115152f979f9abfa9cbdf4a3e2e63a51ea7284
Reviewed-on: http://codereview.qt-project.org/5858
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
2011-10-10 14:39:56 +02:00
Christian Kamm
aeadbcae40 QmlJS checks: Add check for spacing around binary operators.
Adapted from QtChecker.

Change-Id: I434582314e6431c56c9628a5a642bbfb032dfc2f
Reviewed-on: http://codereview.qt-project.org/5857
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
2011-10-10 14:39:49 +02:00
Christian Kamm
da123becaf QmlJS checks: Add Hint about anonymous function formatting.
Migrated from QtChecker.

Change-Id: I0178cc189d1c98b51e1aeb43db7421ba8c43fc7e
Reviewed-on: http://codereview.qt-project.org/5856
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
2011-10-10 14:39:39 +02:00
Christian Kamm
55713a1514 QmlJS checks: Add severity and unique id to messages.
Change-Id: I2cded26524c3f64152107e65d740658e3003ffac
Reviewed-on: http://codereview.qt-project.org/5790
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-10-10 14:39:20 +02:00
Christian Kamm
a7f78991c9 QmlJS: Move commonly used functions to qmlutils.h.
Change-Id: I22376d96fe575bc00a55094c06af80e32a5587e6
Reviewed-on: http://codereview.qt-project.org/6238
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
2011-10-10 09:36:12 +02:00
Christian Kamm
909c61247c QmlJS: Allow 'var' property type.
It's new in Qt 5.

Change-Id: If3e670d42528ca6996ae280d96077ce744d281d9
Reviewed-on: http://codereview.qt-project.org/6121
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-10-06 10:58:29 +02:00
Christian Kamm
a225f7a0af QmlJS checks: Add tests and fix small bugs for 'unreachable'.
Change-Id: Iaf9febc841130fa913fcc071ed0bf28ff9e0b63b
Reviewed-on: http://codereview.qt-project.org/5149
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-09-20 13:21:03 +02:00
Christian Kamm
f8462cca65 QmlJS: Change from QMap to QHash for QString keys.
Tests indicate that lookup in QHash<QString, ...> is more performant
even for short strings.

Change-Id: I8e5a73d0f1a72e202522f397b16901887f9c3591
Reviewed-on: http://codereview.qt-project.org/5070
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-09-19 09:09:28 +02:00
Christian Kamm
b3bb5d700e QmlJS checks: Don't crash if try has no catch or finally.
Change-Id: If7001963bc11f2fa01f058c903ee014f6acb0c04
Reviewed-on: http://codereview.qt-project.org/5102
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-09-16 15:35:07 +02:00
Christian Kamm
4b2f42cf87 QmlJS: Adjust existing code for updated QML parser.
Change-Id: I153723eeb9973be025daf47e317f7b9d076a3c72
Reviewed-on: http://codereview.qt-project.org/4733
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
2011-09-14 11:48:22 +02:00
Christian Kamm
367e27cde7 QmlJS checks: Correct the check for dangerous == and add tests.
Change-Id: Ie0f4062069bf241020868af34ce6d36146b4b0c7
Reviewed-on: http://codereview.qt-project.org/4646
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
2011-09-14 11:13:59 +02:00
Christian Kamm
6808607c3b QmlJS checks: Add 'unreachable code' warnings.
Change-Id: I59e490adce5c0cd7784894a0f9d4435cdcbc9b23
Reviewed-on: http://codereview.qt-project.org/4332
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
2011-09-14 10:56:51 +02:00
Christian Kamm
ca35046827 QmlJS checks: Improve warning about accidental empty blocks.
Change-Id: I2bddd65aef9092bf87f5a441e065ebca0e772174
Reviewed-on: http://codereview.qt-project.org/4331
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-09-08 14:06:28 +02:00
Christian Kamm
5b8d7b465c QmlJS checks: Fix collection of use-before-declaration warnings.
Previously they would not be collected if the var had a
duplicate-declaration warning.

Change-Id: I82244e911fcdfc3d11cc391288da263ee288a3ca
Reviewed-on: http://codereview.qt-project.org/4330
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-09-08 14:06:16 +02:00
Christian Kamm
daf6f5fff0 QmlJS checks: Don't complain about alias properties.
Change-Id: I6721b42a6ae8cc4de3d85754bf12c95f7366212e
Reviewed-on: http://codereview.qt-project.org/4395
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2011-09-08 08:56:01 +02:00
Christian Kamm
e850586b77 QmlJS checks: Warn about inappropriate use of constructor functions.
Change-Id: Iaedaaa88915f2010bfdd0d2b5ca95f01f8663ed7
Reviewed-on: http://codereview.qt.nokia.com/4254
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-09-07 07:27:57 +02:00
Christian Kamm
4e60db9065 QmlJS: Cleanup in Check.
Evaluate supports ExpressionStatements now.

Change-Id: I74c440fe0abf27c3d3b41b7d28a69fdd9359fb2e
Reviewed-on: http://codereview.qt.nokia.com/4080
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-09-07 07:27:45 +02:00
Christian Kamm
aad5ab8542 QmlJS: Check property declaration types.
Change-Id: I2cc1236552e00e99a846b0d4b724135724f175fc
Task-number: QTCREATORBUG-3666
Reviewed-on: http://codereview.qt.nokia.com/4241
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-09-06 10:07:16 +02:00
Christian Kamm
0e54183d4d QmlJS: Remove Interpreter namespace.
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>
2011-08-08 13:21:28 +02:00
Christian Kamm
9dc9674c6b QmlJS: Share Context.
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>
2011-08-08 12:05:19 +02:00
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
36ed6bce1d QmlJS: Move Context to its own file.
Change-Id: I91331b7039e27e2f57cc19b985c8ed86c955ec9e
Reviewed-on: http://codereview.qt.nokia.com/1042
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-07-05 11:52:20 +02:00
Christian Kamm
55b11db1f7 QmlJS: Fix error location for prototype errors.
Change-Id: Iaeb96ff67cfc92bcddeb1b7075b7fdcbaed317c0
Reviewed-on: http://codereview.qt.nokia.com/691
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
2011-06-24 11:32:48 +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
Christian Kamm
0bf18d008b QmlJS: Find prototype resolution errors.
To avoid lots of follow-up errors where the root cause is a failed
prototype resolution or a prototype cycle.

Task-number: QTCREATORBUG-4952
Change-Id: Id474c8c6c152c993aca8c6c421b6d88eb1481676
Reviewed-on: http://codereview.qt.nokia.com/36
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
2011-05-20 13:33:18 +02:00
Christian Kamm
d72bddc7da QmlJS: Update to new QmlJS parser.
UiPublicMember is now initialized with a statement.
2011-05-12 13:39:53 +02:00
Tobias Hunger
aa2acec14c Fix/add copyright headers
Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
2011-05-06 15:17:05 +02:00
Christian Kamm
d05992d0fa QmlJS: Stop doing significant work in constructors.
To avoid order-of-initialization problems.

Reviewed-by: Thomas Hartmann
2011-05-06 13:48:55 +02:00
Christian Kamm
02b7eacf4b QmlJS: Fix type detection for alias properties.
Task-number: QTCREATORBUG-2306
2011-05-04 11:14:35 +02:00
Christian Kamm
ad43f5c48e QmlJS: Don't warn about function exp statements.
Reviewed-by: Roberto Raggi
2011-04-21 09:43:51 +02:00