Commit Graph

1390 Commits

Author SHA1 Message Date
David Schulz
141f19a652 Utils: move code model icons to utils
In preperation for the language server protocol support.

Change-Id: Iee4ccd53a86d9afdb357972ea62b75ace2edcb1d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-08-06 13:22:47 +00:00
Eike Ziller
5c81a65422 Merge remote-tracking branch 'origin/4.7'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: I29916313f12e25f3942ac926f8e4d4490074978e
2018-07-05 11:14:33 +02:00
Marco Benelli
067a7e903e QmlJs: avoid adding unnecessary lines in reformatting
The reformatter used to add unnecessary empty lines, notably before
comments after import declarations.

Task-number: QTCREATORBUG-18332
Change-Id: I96d6f2dd53d1197aa6bc0b834971a66861b2f498
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2018-06-29 09:13:13 +00:00
Alessandro Portale
4b13170565 qmljs: Use C++11’s override and remove virtual where applicable
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>
2018-06-26 10:38:38 +00:00
Joerg Bornemann
a073e17612 QmlJs: Make "qbs" an implicit import for qbs files
We want to have qbs syntax highlighting, even if the
    import qbs
statement is missing, because we want to remove the reqirement for it.

Change-Id: I569be825440bc733c3c0fa8e146e785060e08384
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2018-06-21 07:50:49 +00:00
Eike Ziller
3bbe535b95 Merge remote-tracking branch 'origin/4.7'
Change-Id: I3c5d7e9e8c589ad4425cd89d61e1f572f5cb7997
2018-06-19 10:03:28 +02:00
Alessandro Portale
b16ba2ba59 Remove a few redundant occurrences of 'virtual' and 'override'
warning: 'virtual' is redundant since the function is already declared
'override' [modernize-use-override]

warning: 'override' is redundant since the function is already declared
'final' [modernize-use-override]

Change-Id: I9036a0dc88ed70c4f6e37b916bb24ff65074863d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-18 08:41:37 +00:00
Marco Benelli
abb7d4cb53 QmlJs: fix indentation in object literals
Handle properly ternary operator inside object literals

Task-number: QTCREATORBUG-7103
Change-Id: I482fb77a606f929528147c2b3939fcade77ae40f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-05-23 08:04:29 +00:00
Marco Benelli
d14e89f899 QmlJS: improve support for enum declarations
Add indentation and little highlighting for enums.
It just highlights the 'enum' keyword and the name of the enum, not its
values.

Task-number: QTCREATORBUG-19226
Change-Id: I36e46a27b0e32c4aecc8e91875c3d22df1814d93
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-05-23 08:04:26 +00:00
Marco Benelli
d7f431482d qmljs: handle js directives .pragma and .import
The directives .pragma and .import are not included in the AST.
Their source code locations are not stored in any other place.
As a result, when reformatting the source, they simply disappear.

This patch keep track of their source code locations, so they are
not removed when reformatting the source code.
This patch contains also some modification in the lexer that should
probably be ported to the qtdeclarative version.

Task-number: QTCREATORBUG-13038
Change-Id: I5d568abf02d37a584d4d246939736aaec5af5053
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-12 10:49:46 +00:00
Orgad Shaneh
3a52a2c3f1 QmlJS: Sync parser with Qt 5.10
Change-Id: I87c64edc1235bab10b9f32abeab4386b5cc7390b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-11 12:15:19 +00:00
Orgad Shaneh
eea6a7c3b3 Utils: Purge qtcfallthrough.h
No longer needed.

Change-Id: I9b0bee014df89d4c567f1d2431b5ff9404f5f925
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:13 +00:00
Orgad Shaneh
8183809846 QmlJS: Update gen-parser.sh
Try to minimize differences on sync

Change-Id: I9af325911b1a6a7635099cb3a5c778305e5e6223
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 06:37:27 +00:00
Orgad Shaneh
438db9a488 QmlJS: Remove duplicate entry in DISTFILES
It already listed in parser.pri.

Change-Id: Id44e1945eb9f0a7fc988a00b52b6650267c8a266
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-05 14:33:01 +00:00
Marco Benelli
a874cf581d Qml/js reformatter: use quotes in objects literals
The reformatter used to remove the quotes that wraps the property name
in object literals.  This causes problem when the name is not a
valid identifier, resulting in that valid code become invalid after
reformatting.
This patch forces wrapping of property's name in quotes: in this way,
the reformatted code is consistent and it never get invalidated.

However the resulting formatted code is not consisted with the one
formatted by previous versions.

Task-number: QTCREATORBUG-17455
Change-Id: I1e361102819055de210d6c81020f204c08aaa253
Reviewed-by: Markus Maier <markus.maier.sw@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-05 06:50:03 +00:00
Marco Benelli
b9d72a5737 qmljs: remove remaining references to QtQuick1
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>
2018-04-03 14:40:30 +00:00
Eike Ziller
0b10ecc718 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakeproject.h
	src/plugins/debugger/debuggerplugin.cpp
	src/plugins/ios/iosrunfactories.cpp
	src/plugins/nim/project/nimproject.h
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qmakeandroidsupport/qmakeandroidrunfactories.cpp
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprojectmanager/qmlproject.h
	src/plugins/qnx/qnxrunconfigurationfactory.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/winrt/winrtrunfactories.cpp

Change-Id: Ib029fdbaa65270426332f5edd6e90264be5fb539
2018-03-13 11:25:38 +01:00
Thomas Hartmann
3b1e0e070a QmlJS: Allow NumberAnimation for ui.qml files
Change-Id: I12836a2d7708d50278715139f0cfba5fa221f8eb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-03-07 14:13:08 +00:00
Eike Ziller
205c930592 Merge remote-tracking branch 'origin/4.6'
Change-Id: I63f8aebb201936f671b1486ff9420f67e5e3fafc
2018-03-01 15:46:37 +01:00
Marco Benelli
2acb365dac qmljs: relax checks for qbs files
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>
2018-02-27 15:17:44 +00:00
Marco Benelli
1442919823 qmljs: correct error level for M127
Lint message M127 (Expression statements should be assignments, calls
or delete expression only) is a warning and not an error.

Task-number: QTCREATORBUG-19534
Change-Id: Iff93cd77582c28f4160fe7a8dec42f19c22436cb
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-01-26 10:03:20 +00:00
Eike Ziller
32c938c4a0 Merge remote-tracking branch 'origin/4.6'
Change-Id: I724da8f761275865e735e7dce10c3b2b2d99fe94
2018-01-25 10:20:06 +01:00
Nikolai Kosjar
e54c514984 Fix build with Qt 5.6 / qtcreator.qbs
Broke with:

  Introduce Q_FALLTHROUGH()
  commit f482270432

Change-Id: I4f99f9a4d8a56ab1358be53f83aa0c449cff69a8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-01-25 06:04:27 +00:00
Friedemann Kleint
f482270432 Introduce Q_FALLTHROUGH()
Silence g++ 7.X warnings.

Change-Id: I9d06d04b496c9ec060e13e1be6f43d8fbadb1f3b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-24 14:50:43 +00:00
Marco Benelli
a68a545ce2 qmljs: update qmljs parser
Change-Id: I418c3f8c77f36274864edd71d8f86d37587cb3a7
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2018-01-17 15:19:51 +00:00
Thomas Hartmann
50ca0de846 QmlDesigner: Add missing font and text properties for Qt 5.10
Task-number: QTPM-862
Change-Id: I12813cf429f4f4a5a85c4e3c6d74eb7ac1a45bd2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-01-10 10:30:59 +00:00
Marco Benelli
d11e31230c QmlJs: remove bundles for QtQuick1 type descriptions
QtCreator now assumes that QtQuick2 is used, so the relevant bundle is
loaded unconditionally.

Change-Id: Ib6b7b0c9a949e74edf0e0b7f68b0c774d7bcb451
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-01-08 13:15:23 +00:00
hjk
cc88302309 De-emphasize PluginManager::getObjects<Type>()
... by additionally keeping local (currently non-owning) pools per
"interesting" type.

Current situation:
  - The global object pool does not scale well for looking up
    objects, as iteration plus qobject_cast typically iterates
    over all pooled objects.
  - User code that can use typed results from the object
    pool need to have access to the full type definition anyway,
    i.e.  depend on the plugin of the target class anyway.

The patch here solves the scaling problem is to have local
type-specific pools to which objects register in their
constructors and deregister in their destructors.

This patch here does *not* change the ownership model of the
pooled objects, however, it opens the possibility to change
the ownership model per type (e.g. by not putting things into
the global pool at all anymore and make the local pool 'owning')
and the intent is to handle that in later patchs.

Even without the follow-up patches this here is a performance
improvement for the cases that access the local pools instead
the global one, i.e. "practically all".

Change-Id: Ib11a42df2c4ecf5e1155534730083a520dd1995b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-12-15 07:08:05 +00:00
Ulf Hermann
d81c6c7403 QmlJS: Don't parse files we cannot open
This rids us of the "Issues" about various wizard files when opening
qtcreator.pro

Change-Id: Ib49e87ded791bcc9155e65a77cac523c1f67de56
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-12-07 08:26:28 +00:00
Eike Ziller
e2baa116ca Merge remote-tracking branch 'origin/4.5'
Change-Id: I86852d289c22210a0439e8e297819dc7276a96de
2017-11-29 09:56:22 +01:00
Nikolay Shalakin
171adfcfc9 QmlJsImport: correct ImportMatchStrength comparison
Change-Id: I9aa775dc23d19e856e38baf9834bedb6903800a9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-11-28 09:53:47 +00:00
Eike Ziller
a9e4e3608e Merge remote-tracking branch 'origin/4.5'
Change-Id: I0194bdeda71e33fd5bc9cb3eb7a9198ae72815ed
2017-11-07 15:10:36 +01:00
Ulf Hermann
636efd668f QmlJS: Declare a metatype for the Dialect enum
This way we can pass it through signals across threads.

Change-Id: I6753233204d9210d181633e16f1d5bff967d55c9
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-11-07 08:47:39 +00:00
Thomas Hartmann
6a738504d0 QmlJS: Add error message for dynamic property called "data"
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>
2017-11-06 16:41:07 +00:00
Marco Benelli
f12e095fd4 Qmljs: check pointer to ModelManagerInterface
Task-number: QTCREATORBUG-19152
Change-Id: I3c511d15af943cc92c35a3c3d823080415940780
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2017-10-26 08:18:36 +00:00
Robert Loehning
7dad30f160 QmlJS.PropertyReader: Remove unused variable
Change-Id: I4b90ca969a911436057debfa7dc38918b89c8fb0
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-23 18:54:47 +00:00
Tim Jenssen
7208ef1ff5 Qmljs: remove unused method
Change-Id: Id3bce005ed4c972d6cbb7f37cf609ff551c7066c
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-10-19 07:11:25 +00:00
Marco Benelli
c054dd2cff QmlJs: fix bug in resolving qml imports
The introduction of Controls.2 changed the way in which imports are
resolved. This patch fix some leftovers of the old resolution scheme.
Such leftovers caused false positives in import declaration to happen
when resetting the QML/JS code model.
The code has also been simplified a little, by the removal of
duplicate code and of unused methods.

Change-Id: I90bdf7ed47fdfea7cbd8259acd7a9a968f27301b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-16 11:10:17 +00:00
Marco Benelli
d600bae736 QmlJs: better indentation for switch common cases
Do not add an empty line between common cases in a `switch` block,
according the best practices for javascript style.

Task-number: QTCREATORBUG-18515
Change-Id: I8b665eabb9b1d5b617d608e430e8b9137dc32032
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-09-19 08:04:50 +00:00
Marco Benelli
65b2edbd82 qmljs: better handling of attached properties
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>
2017-09-19 08:04:36 +00:00
Marco Benelli
6f7aa1f962 QmlJS: user defined style in reformatting file
The size of tabs and indentation used to be ignored when reformatting
a file.

Task-number: QTCREATORBUG-12849
Change-Id: I0b522b526a199c6397b78b5e193159ec52fc941a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-09-18 06:58:35 +00:00
Tobias Hunger
4ef01c961e app_version.h: Make IDE name configurable
Change-Id: I993f452c8d09cf89e9a2958fc8e36b7d2c17ee6f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-05 10:19:48 +00:00
Eike Ziller
a0a42ff7bd Merge remote-tracking branch 'origin/4.4'
Conflicts:
	src/plugins/debugger/gdb/gdbengine.cpp

Change-Id: I8a7c8ca07d6d6005f5d39b8f1477ebbc7a299fbf
2017-08-17 17:29:25 +02:00
Christian Kandeler
a4aa79a4f8 QmlJS: Rename variable called "interface"
Easily conflicts with a macro of the same name in windows.h.

Change-Id: Ia6dfb294092497c48816e71ff901e9c3b2c8359f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-08-17 09:53:39 +00:00
Eike Ziller
d8fd5292f1 Merge remote-tracking branch 'origin/4.4'
Conflicts:
	src/tools/clangbackend/ipcsource/clangiasyncjob.cpp
	src/tools/clangbackend/ipcsource/clangjobrequest.cpp
	src/tools/clangbackend/ipcsource/clangjobrequest.h

Change-Id: Ib8602530663813ade418f995dfd2a736908cfe75
2017-08-15 10:07:51 +02:00
Ulf Hermann
6de5650241 QmlJS: Fix initialization order
This avoids some compiler warnings.

Change-Id: I81a626d22d39a2a45c2bf64403b0e28b76e50105
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-08-14 09:18:44 +00:00
Robert Loehning
74d14d0092 QmlJs: Initialize members
Change-Id: I15a3ec660608266595a8b7a12b59016cc28331af
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-08-11 10:34:00 +00:00
Marco Benelli
73834060d7 QmlJs: fix false positives for properties
Resolve references while looking up for object members.

Task-number: QTCREATORBUG-18362
Change-Id: I9d2b2457fb3488c723a41e4e8ba1fc0ea9fe800f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-08-10 08:08:38 +00:00
Tomasz Olszak
38296f6acc Fix inserting the same multiple items to PathsAndLanguages
Change-Id: Ie1df6fad425fd7198a72f531c19b3681627a5210
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-07-03 06:45:03 +00:00
Robert Loehning
232f6a1096 QmlJs: Remove unused members
Change-Id: I2656bafe9f22652a3e80e6581a41296dfb144564
Reviewed-by: Christian Kamm <mail@ckamm.de>
2017-06-07 14:58:36 +00:00