summaryrefslogtreecommitdiff
path: root/src/libs/qmljs/qmljscheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | QmlJS checks: Change suppression annotation to @disable-check.Christian Kamm2011-10-311-1/+1
| | | | | | | | | | Change-Id: I913cd757c4f8339a518c947569c5ba651153f1c1 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* | Merge remote-tracking branch 'origin/2.4'Eike Ziller2011-10-281-2/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | 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
| * QmlJS checks: Make 'unintentional empty block' warning less annoying.Christian Kamm2011-10-241-2/+1
| | | | | | | | | | | | | | Already fixed differently in master. Change-Id: I92f7665166b2b1ca4f3d4598825b04f3f19d4772 Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* | QmlJS checks: Warn about extra message suppressions.Christian Kamm2011-10-211-18/+61
| | | | | | | | | | | | Reviewed-by: Fawzi Mohamed Change-Id: I4038cd863ba80c1719417cd03b755b047f7d8b5e Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* | QmlJS checks: Suppression of static analysis messages.Christian Kamm2011-10-191-1/+33
| | | | | | | | | | | | | | | | * Use '// @disable M123' to suppress * Add quick fix to add these comments Change-Id: I499f5a6004148afbb346218c6fb01c9ca77b9f73 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* | QmlJS checks: Add hint about not using var/variant property types.Christian Kamm2011-10-191-12/+29
| | | | | | | | | | Change-Id: I79c5c4db78eb96eda7c6f5d543bb5063d5670968 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* | QmlJS: Introduce UnknownValue.Christian Kamm2011-10-181-7/+7
| | | | | | | | | | | | | | To distinguish known-to-be-undefined from a genuinely unknown value. Change-Id: I606b4ea4d726f94553400b8950d3c0a4e76564a8 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* | QmlJS checks: Limit warning about unintentional empty blocks.Christian Kamm2011-10-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* | QmlJS: Add more value_casts.Christian Kamm2011-10-121-4/+4
| | | | | | | | | | | | | | | | | | | | 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>
* | QmlJS checks: Allow calling some builtin constructors as functions.Christian Kamm2011-10-121-1/+6
| | | | | | | | | | | | | | | | | | | | 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>
* | QmlJS checks: Hint about extra parentheses.Christian Kamm2011-10-121-0/+32
| | | | | | | | | | | | | | | | | | 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>
* | QmlJS checks: Disable some checks when imports failed.Christian Kamm2011-10-121-20/+30
| | | | | | | | | | | | | | | | | | 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>
* | QmlJS checks: Add hint about not using multiple statements per line.Christian Kamm2011-10-101-0/+27
| | | | | | | | | | | | | | | | | | 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>
* | QmlJS checks: Add warning about 'eval'.Christian Kamm2011-10-101-0/+2
| | | | | | | | | | | | | | | | | | 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>
* | QmlJS checks: Warn when using some builtin constructors.Christian Kamm2011-10-101-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | QmlJS checks: Add confusing +/- check.Christian Kamm2011-10-101-0/+29
| | | | | | | | | | | | | | | | | | 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>
* | QmlJS checks: Add check for spacing around binary operators.Christian Kamm2011-10-101-4/+15
| | | | | | | | | | | | | | | | | | 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>
* | QmlJS checks: Add Hint about anonymous function formatting.Christian Kamm2011-10-101-0/+10
| | | | | | | | | | | | | | | | | | 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>
* | QmlJS checks: Add severity and unique id to messages.Christian Kamm2011-10-101-192/+175
| | | | | | | | | | | | | | 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>
* | QmlJS: Move commonly used functions to qmlutils.h.Christian Kamm2011-10-101-89/+3
| | | | | | | | | | | | | | 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>
* | QmlJS: Allow 'var' property type.Christian Kamm2011-10-061-1/+2
|/ | | | | | | | 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>
* QmlJS checks: Add tests and fix small bugs for 'unreachable'.Christian Kamm2011-09-201-11/+22
| | | | | | | 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>
* QmlJS: Change from QMap to QHash for QString keys.Christian Kamm2011-09-191-1/+1
| | | | | | | | | 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>
* QmlJS checks: Don't crash if try has no catch or finally.Christian Kamm2011-09-161-2/+6
| | | | | | Change-Id: If7001963bc11f2fa01f058c903ee014f6acb0c04 Reviewed-on: http://codereview.qt-project.org/5102 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* QmlJS: Adjust existing code for updated QML parser.Christian Kamm2011-09-141-37/+37
| | | | | | Change-Id: I153723eeb9973be025daf47e317f7b9d076a3c72 Reviewed-on: http://codereview.qt-project.org/4733 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* QmlJS checks: Correct the check for dangerous == and add tests.Christian Kamm2011-09-141-16/+18
| | | | | | Change-Id: Ie0f4062069bf241020868af34ce6d36146b4b0c7 Reviewed-on: http://codereview.qt-project.org/4646 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* QmlJS checks: Add 'unreachable code' warnings.Christian Kamm2011-09-141-25/+231
| | | | | | Change-Id: I59e490adce5c0cd7784894a0f9d4435cdcbc9b23 Reviewed-on: http://codereview.qt-project.org/4332 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* QmlJS checks: Improve warning about accidental empty blocks.Christian Kamm2011-09-081-0/+7
| | | | | | Change-Id: I2bddd65aef9092bf87f5a441e065ebca0e772174 Reviewed-on: http://codereview.qt-project.org/4331 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS checks: Fix collection of use-before-declaration warnings.Christian Kamm2011-09-081-25/+13
| | | | | | | | | 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>
* QmlJS checks: Don't complain about alias properties.Christian Kamm2011-09-081-0/+1
| | | | | | Change-Id: I6721b42a6ae8cc4de3d85754bf12c95f7366212e Reviewed-on: http://codereview.qt-project.org/4395 Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* QmlJS checks: Warn about inappropriate use of constructor functions.Christian Kamm2011-09-071-3/+58
| | | | | | Change-Id: Iaedaaa88915f2010bfdd0d2b5ca95f01f8663ed7 Reviewed-on: http://codereview.qt.nokia.com/4254 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Cleanup in Check.Christian Kamm2011-09-071-21/+20
| | | | | | | | Evaluate supports ExpressionStatements now. Change-Id: I74c440fe0abf27c3d3b41b7d28a69fdd9359fb2e Reviewed-on: http://codereview.qt.nokia.com/4080 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Check property declaration types.Christian Kamm2011-09-061-0/+49
| | | | | | | 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>
* QmlJS: Remove Interpreter namespace.Christian Kamm2011-08-081-3/+2
| | | | | | | | | 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>
* QmlJS: Share Context.Christian Kamm2011-08-081-10/+10
| | | | | | | | | | | | 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>
* QmlJS: Split Context and ScopeChain.Christian Kamm2011-08-081-11/+10
| | | | | | | | | | | | 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>
* QmlJS: Move Context to its own file.Christian Kamm2011-07-051-1/+1
| | | | | | Change-Id: I91331b7039e27e2f57cc19b985c8ed86c955ec9e Reviewed-on: http://codereview.qt.nokia.com/1042 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Fix error location for prototype errors.Christian Kamm2011-06-241-4/+5
| | | | | | Change-Id: Iaeb96ff67cfc92bcddeb1b7075b7fdcbaed317c0 Reviewed-on: http://codereview.qt.nokia.com/691 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* QmlJS: Fix completion inside grouped propery bindings.Christian Kamm2011-06-231-3/+3
| | | | | | | Task-number: QTCREATORBUG-3541 Change-Id: Ida8e59b65836c8515fbfbd2a9e4737d9ae04e76c Reviewed-on: http://codereview.qt.nokia.com/639 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* Qmljs: added scope for blocks in UiScriptBindings and UiPublicMemberFawzi Mohamed2011-06-071-0/+5
| | | | | | | | | | 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>
* QmlJS: Find prototype resolution errors.Christian Kamm2011-05-201-3/+33
| | | | | | | | | | 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>
* QmlJS: Update to new QmlJS parser.Christian Kamm2011-05-121-0/+6
| | | | UiPublicMember is now initialized with a statement.
* Fix/add copyright headersTobias Hunger2011-05-061-1/+1
| | | | Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
* QmlJS: Stop doing significant work in constructors.Christian Kamm2011-05-061-0/+1
| | | | | | To avoid order-of-initialization problems. Reviewed-by: Thomas Hartmann
* QmlJS: Fix type detection for alias properties.Christian Kamm2011-05-041-3/+7
| | | | Task-number: QTCREATORBUG-2306
* QmlJS: Don't warn about function exp statements.Christian Kamm2011-04-211-1/+2
| | | | Reviewed-by: Roberto Raggi
* Update license.hjk2011-04-131-14/+13
|
* QmlJs::Check: using the Option enum to ignore type errorsThomas Hartmann2011-03-011-3/+2
| | | | Unifying the api and exposing the options.
* QmlJs::Check: turning "file or directory does not exist" into a warningThomas Hartmann2011-03-011-1/+3
| | | | Missing files should be a warning.
* QmlJS: Remove the strict separation of types and attached types.Christian Kamm2011-02-211-1/+1
| | | | | | | | | | | | | | | | The problem was that several lookup calls suddenly failed because the actual QML types were no longer in the default scope chain. However, the QML documentation says the type names are in the scope. Also, 'MyComponent.' in a JS-expression context only showed the attached properties of MyComponent and missed the enums. With this change completion now may offers too many options, but that's better than missing some. This reverts parts of 490f2797f636ff49ce0a778610a2532d1277e4d4 Reviewed-by: Leandro Melo