currently we mainly try to warn about primitive == null/undefined or
primitive === non primitive.
There are other that we could warn about null==null null==undefined,
but I feel that they might be triggered too much by clean code.
Change-Id: Id43d838d60a4e13f361be34e4bb38211777a081e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* fix ASTVariableReference::value: correctly get reference value type
by using either initialiser of bindingTarget (broken since a codemodel
update in 2018)
* disable warning for casting in bool to null comparison (it does not
cast, is always false)
* fix property checks (where skipped without default of readonly)
* remove non relevant checks (ErrInvalidPropertyType for lowercase now that custom
value types are supported, and for properties called data)
* updated import version
Change-Id: I38407acf327d0f773b38dda4c02fb4d95a420851
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
When editing QML there are false positives reported
for ListElement.
Task-number: QDS-2602
Task-number: QDS-2716
Change-Id: If3fc297d6609213448f8353e9406b3f0aaf65870
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* parser side support for annotations, inline components, new UiVersion
and all the things included in QT 5.15 parser
* SourceLocation moved from QmlJS:AST to QmlJS
* Visitors now need to handle throwRecursionDepthError
* BaseVisitor for visitors that want to override all visit
Task-number: QTCREATORBUG-23591
Change-Id: I682a30d0b08b6c929739fd0e339ef6fbde3eb630
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Add a soft check for duplicated Qml/JS imports which
adds a warning when a file contains imports that
duplicate the same URI / version or file path.
Change-Id: Ib9a1f8a90dd3cf469d90e83abc1d748901b1e353
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This fixes a false positive error message.
Task-number: QTCREATORBUG-22599
Change-Id: Ibdf9a3a6b1679bd11afa87ca3d5e77fcda773ce0
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
We need to do this because the new "required" keyword should be
recognized by Qt Creator.
This is not a verbatim copy of the QML parser from qtdeclarative. A few
data structures have changed that would require large scale changes in
otherwise unrelated parts of the code. For example, all Visitors need to
handle recursion depth errors now and the DiagnosticMessage only has
line and column now, no longer begin and legth.
Change-Id: Iea5b04e27b07e0cba55d64b844315af9828acbf7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
They are passively supported and we plan better support in the future.
Change-Id: I22520335ae3dba5804ec4c8902624b4afe4254a3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
The reasoning in 1b4766e26c did not take into account that the scope
of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with
f70905448f6 in Qt base.
Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This fixes a false positive error message.
Task-number: QTCREATORBUG-22599
Change-Id: I54104857982873baaa092ad936586c3d245ce720
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Variable declarations made with let or const need
to get evaluated on block level base.
Task-number: QTCREATORBUG-22054
Change-Id: Ia1d353be61c2d9532bc54257c15d00fb33ea156c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
- use nullptr instead of 0
- remove all QLatin*
- use initializer for QStringLists
Change-Id: I62db000e2644d1d2a2c1246e70e829e37d36f2f3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Update the qtcreator qmljs parser to the
one of Qt 5.12. It supports EcmaScript 7.
Task-number: QTCREATORBUG-20341
Change-Id: I0d1cff71402ba17e22cde6b46c65614e162280de
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Fixes warning: prefer using 'override' or (rarely) 'final' instead of
'virtual' [modernize-use-override]
Change-Id: I17955fd0fdb052678228f1bda32cd8d3b4298998
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This patch removes all references to QtQuick1 in qml library,
plugin, designer, profiler and tests.
Change-Id: Ie286fad96060299caae3ef328330597cf53e90d3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Types information for qbs is more limited that qml; this causes
qtcreator to raise false positives. This patch relax the checks and
provide some type information needed by qbs files generated by the
wizards.
Task-number: QTCREATORBUG-19757
Change-Id: I07a1dd9d8fedaf4c5c751c2f00643f15ae39127a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The default property of most QtQuick items is data and
therefore "data" should not be used as a property name.
Task-number: QTCREATORBUG-19225
Change-Id: I54d1b72ce984debd4c366b7261e93b7a81b8c940
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Attached properties used to cause false positives in the highlighter,
because when using qualified ids, only the first part was checked as
candidate for being at attached property.
Task-number: QTCREATORBUG-18707
Change-Id: I6b1b569bc1766325decbc5d100c16a4e0dc3634f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Resolve references while looking up for object members.
Task-number: QTCREATORBUG-18362
Change-Id: I9d2b2457fb3488c723a41e4e8ba1fc0ea9fe800f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Loader are working in the designer and we will add more support for
them in the future.
Change-Id: Ied62d65b0eb9933b44a7833ccafcb934d4ae6fba
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
The support is not perfect, but I see no reason to
excplitly not allow it.
Change-Id: I6b1d825acde156cc7b50160060e89bb964667ab8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
The last version of the grammar contains some constructs that the code model
needs to know.
Task-number: QTCREATORBUG-17842
Change-Id: I6250f96431acc05b19f3fd1b6cc268a07485cf0f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>