Commit Graph

74059 Commits

Author SHA1 Message Date
David Schulz
0b6bc0d187 LanguageClient: Move the BaseMessage to JsonRpcMessage conversion
... to the client interface. JsonRpcMessages are the only messages used
so far and no other types of messages are currently used by any of the
supported Language Servers. If a client is going to need special message
parsing it can still implement a specialized client interface and
overwrite parseCurrentMessage. This is the preparation to move receiving
and parsing data passed to and from the language server out of the GUI
thread.

Change-Id: Ibd4cd95daab7efff947273ca9e7d457de0286f47
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-17 04:31:06 +00:00
Jarek Kobus
819d6ad753 Implement RsyncTransfer
Change-Id: I07a9139bc5280a4f4b16181121ce7ab907493e72
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-16 17:27:42 +00:00
Jarek Kobus
7cca6cd718 FileTransfer: Make the usage more convenient
Prepare the API for rsync implementation.

Change-Id: I13b7def31c2e2b1460d18340f6bd7cbd8e0e9434
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-16 17:27:29 +00:00
Christian Kandeler
15665680df CppEditor: Use "auto" in AssignToLocalVariableOperation
Fixes: QTCREATORBUG-9577
Fixes: QTCREATORBUG-18412
Change-Id: I46a925611939a3dade142eaf76e20090ae203856
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-16 14:35:10 +00:00
hjk
6d1ec54679 Debugger: Make manual test easier compile with Qt 6
Change-Id: I2623a45fea4ac3ddad2790cbd34852891a9d73b4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-16 14:14:28 +00:00
Mahmoud Badri
bf49d143e8 QmlDesigner: Fix warning in AbstractView::dragStarted()
Change-Id: I3fc0bede9fd58b7c63cf6c28a982e4662766f375
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-05-16 13:26:58 +00:00
Eike Ziller
3db3b441db FileSearch: Some micro-optimization
Fixes: QTCREATORBUG-27552
Change-Id: I1b4677af59f335df676d32c2bb0e1dbd5a9dd14b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-05-16 13:23:20 +00:00
Eike Ziller
486ec4239a CMake build: List debugger resources explicitly
Developing these files can lead to .swp files from other editors,
and .pyc files when running python files. When these are later removed,
CMake complains about removed dependencies.
List the files to copy & install explicitly to workaround this.

Change-Id: Ie971abad8e9be0d2d7de94caf8836664396885b0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-05-16 13:23:04 +00:00
Jarek Kobus
9a4164a4de CMakeProcess: Don't use QTimer for checking the canceled state
Create a QFutureWatcher instead and connect to its canceled()
signal.

Replace some includes with forward declarations.

Change-Id: Ie82bf8902ef8c8d87011809bd14b7db3d4f52179
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-05-16 12:37:18 +00:00
David Schulz
52770b746e LSP: fix hover request result
According to the protocol a hover request can also return a Null as a
result. Reflect this in the protocol implementation and adapt usages.

Change-Id: I14ce71639c64b6de00e9c1198617083c1a3de9eb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-16 12:36:44 +00:00
David Schulz
2b8d96465a Coco: fix warning overriding virtual functions
Change-Id: I8c7d6619a9f277fa14a5e0e4d28175155fd0dd95
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-05-16 11:36:55 +00:00
Christian Kandeler
8c8e9e55b1 CppEditor: Refactor "assign to local" quickfix
Mostly to separate type and name deduction. No functional changes.

Change-Id: I87858f06bec73fbc59a0359769bd37038176b3ad
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-16 11:29:56 +00:00
hjk
0d733e68b5 ProjectExplorer: Create Runnables with full device paths in RunConfig
... instead of fixing them later in the ApplicationLauncher as used
by all SimpleTargetRunners.

The mapping to device paths happens now in the default commandline
getter on paths from the ExecutableAspect. This is (only) wrong in the
case of (local) custom runconfig with a device present, so this needs
a custom commmandline getter not doing the transformation.

Change-Id: I525bc0ea59b5e7caf7a445a1a723d6f5b152162d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-16 10:57:43 +00:00
Jarek Kobus
ef2c551121 GenericLinuxDeviceTester: Make some order in implementation
Change-Id: I83a3c2880b055d0d74af402df876748975a7450e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-16 10:34:54 +00:00
Jarek Kobus
4634b058fa AbstractUploadAndInstallPackageService: Use FileTransfer
Use LinuxDevice::transferFiles() instead of SftpTransfer.
Get rid of unused now PackageUploader.

Change-Id: Ibea4557c3e003cd9d7d3692db5bec6b82dcad71a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-16 10:34:44 +00:00
Jarek Kobus
8eb12ea614 CMakeProcess: Fix stopping the CMake process
Calling QtcProcess::terminate() doesn't guarantee that
process will be terminated, especially on Windows we may
ofter wait for it forever. Replace the call to terminate()
with close(). After calling close(), the process will sooner
or later be terminated (or finally killed) - that's the job
for ProcessReaper.

Since the current code relies on receiving the finished() signal
after calling a stopping method, we need to call the expected
handler (handleProcessDone()) after calling the QtcProcess::close(),
as afterwards we can't expect receiving any signal for the possibly
running process anymore.

Refactor the code so that we connect do QtcProcess::done() signal
instead of connecting to QtcProcess::finished() signal. This
guarantees that the handler will also be called when process
failed to start. Handle this case in done() handler, too.

Rename CMakeProcess::terminate() into CMakeProcess::stop()
in order to avoid confusion on what method we have chosen to
stop the process in fact. That's the implementation detail.

Get rid of some QFuture related handlings from public API.
Use them directly from inside CMakeProcess d'tor.

Get rid of public state() method, as it seems it's unused.

Increase the responsiveness of small [x] icon of the running
cmake task (reduce the timeout of 500 ms into 50 ms).

Fixes: QTCREATORBUG-27518
Change-Id: I15cac3990079ad1cae0bbe22ac2a6e64cfb659a0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-05-16 10:30:48 +00:00
Artem Sokolovskii
e30652ae55 ClangFormat: Build fix Qt 5
Change-Id: I5afec32314263dfa9db6f36b8871b43fde47f698
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-05-16 09:51:38 +00:00
Jarek Kobus
92f20c5711 GenericDirectUploadService: Use FileTransfer
Instead of using SftpTransfer.

Change-Id: I0732e1472efe3db10291078319b23211973c86d2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-16 09:33:04 +00:00
Christian Stenger
4076f6c385 QmlProjectManager: Fix compile with Qt5.15
Amends 92c93c388a.

Change-Id: Iff025dbf7feb6c84dd7eb88ccea14e8e12e69a2f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-05-16 09:20:17 +00:00
hjk
6ea8a76e44 Utils: Consolidate port parsing methods
Change-Id: I137e9faa2c5f18e9ade0e2c59d73811d682abf13
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-16 08:43:16 +00:00
Jarek Kobus
f8d637dc71 LinuxDevice: Add createFileTransfer() method
The method returns FileTransfer object. This should substitue
SftpTransfer. It is going to handle rsync transfer, too.

Change-Id: I082cf21581ac387e42bb3594604facafe32d7492
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-16 08:40:52 +00:00
Christian Stenger
d9005be8a2 Utils: Use new mimetypes implementation when using qbs
It is default for the cmake build, so switch for qbs as well.

Change-Id: Icb325c58e587ecee2c621bf68c191869520e963a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-16 08:24:44 +00:00
Tapani Mattila
5019513efc QmlDesigner: Implement first iteration of QDS landing page
Task-number: QDS-6564
Change-Id: I7f92024f9ec521ff9ebe2637146b56c9b30edd59
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-05-16 08:21:48 +00:00
Alessandro Portale
86708dbdde Improve various HTML-based tooltips
A couple of tooltips in Qt Creator, contain rich text (HTML). These
tooltips tend to have line breaks in unfavorable places, making the
content sometimes hard to read.
This is fixed in this change by using: style="white-space:pre"

Another issue with some tooltips is that they show key/value definitions
in a <table>, which, especially with longer keys makes looking up the
value quite hard. Also the length of the key column is dependent on the
(translated) content.
This change implements an alternative: using "description lists" <dl>,
which indent the values nicely independent from the key length.

Fixes: QTCREATORBUG-27553
Change-Id: If047627193413f23d868c52f005f22aa9a0752a9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-05-16 08:17:45 +00:00
Tapani Mattila
92c93c388a QmlProject: Move project file pattern searches from StudioWelcome plugin to QmlProject plugin
Task-number: QDS-6930
Change-Id: I63345b539efdafa754671aef46ad808999914edb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-05-16 08:05:22 +00:00
Christian Kandeler
e2890aa1ff LanguageClient: Take quickfix range from cursor selection
We must respect the selection the user made, otherwise code actions
might not work correctly.

Change-Id: I39142047f90f3d7c85aefbfa960e59d413e4be38
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-05-16 07:52:20 +00:00
Christian Kandeler
1e25be0cfd ClangCodeModel: Suppress broken clang fix-it (again)
This time with clangd.

Fixes: QTCREATORBUG-18593
Change-Id: I26cedec0dcdf07c46ae96a5d714df128dfcd2d26
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-05-16 07:50:30 +00:00
Robert Löhning
05b5b864c9 Squish: Remove unused MSVC2013 toolchains
Change-Id: I2a809150e93e1b17eb13482cc85985cd9ce64e1d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-16 07:47:40 +00:00
Robert Löhning
95bbe6bde6 Squish: Fix toolchains in Qt 5.14.1 kit
This referred to MSVC2013 which has nothing to do with this kit.

Change-Id: Iad72dfd7632e7039ac5d528a3e750264b192df63
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-16 07:47:13 +00:00
David Schulz
6006ec8180 Coco: Add coco hoverHandler if diagnostics are visible
Change-Id: Id0a72fe0fc8a79e30e87fc7a0632eeb41338e73c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-16 07:39:06 +00:00
David Schulz
e5ceca9fd8 Coco: add test instructions
Change-Id: I705b196fdc517f8cf2d90d82521e992d8dc1063a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-16 07:38:54 +00:00
hjk
1a019ca02a Debugger: Fix path to uninstalled gdb data
Affects only self-build gdb.

Amends adf1243ed9.

Change-Id: I0b8380f27c14e155629aaf7235721aa80c0a3d45
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-16 07:35:01 +00:00
Orgad Shaneh
b1fc92f8b6 Sqlite: Fix MSVC warning on build
cl : Command line warning D9025 : overriding '/W3' with '/W0'
cl : Command line warning D9025 : overriding '/W3' with '/W0'

Change-Id: I1be9e569aee98046b81db63d99d75d725bfa9c15
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-05-16 07:15:59 +00:00
Orgad Shaneh
a19ebd97cd InfoBar: Initialize member on default ctor
Reported by Coverity.

Change-Id: I00f166af79400d373c0fdf2c2db2b6d8b3d29b16
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-05-16 07:06:54 +00:00
Eike Ziller
562cca8ed6 Help: Unregister URL handler for qthelp before deleting it
Qt 6 warns if that is not done.

Change-Id: If0b9f36e35544d1a1d8a45b8c06005cef3940ebb
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-16 07:05:11 +00:00
Artem Sokolovskii
b634ec77fc ClangFormat: Fix override checkbox doesn't affect behavior
Override checkbox allows use clangFormat settings
from widget even if there is .clang-format file in
file's folder or parent folder.
It works for global settings and for project settings.

Change-Id: I03152f4b0e1b62b3ac038024e76cc9082fa37ec3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-16 07:00:07 +00:00
Orgad Shaneh
ab66f81a61 Utils: Initialize DeviceShell member on ctor
It is initialized in start(), which is called in the worker thread.

Reported by Coverity.

Change-Id: I385b185c220f5be20cc312eb960658c2de770a9c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2022-05-16 06:49:25 +00:00
Christian Stenger
d78da50f46 Git: Export GitClient and GitPlugin for re-use
Change-Id: I3635af18ec9e5e134219dd8d336b5b78a013d8cb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-05-16 04:21:58 +00:00
Orgad Shaneh
d78ebf69ba VcsBase: Fix MSVC warning
qhash.h(1138) : warning C4723: potential divide by 0

Change-Id: I368ec727d08d5e0bb333099a3536d97c65503e7d
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-05-15 16:58:14 +00:00
Thomas Hartmann
11f55c7173 QmlDesigner: Add simple tracing to AssetsLibraryModel
Change-Id: I5306ce637e44ac275411fdb60c5e83f96039ec62
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-05-13 15:05:13 +00:00
Thomas Hartmann
96144d12bb StudioWelcome: Download data from Qt.io
We try to download new updated data from Qt.io
if it is newer.

In any case we provide a default that comes with QDS.

I removed the check for QmlData, since they should not be required
and they stop FileDownloader from running from "pure" C++.

Task-number: QDS-6886
Change-Id: I1332c194286e6e91dfcd1c6605931f1ed020bc29
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-13 14:46:54 +00:00
Cristian Adam
d0a9b873cb ProjectExplorer: Include symlinks for compiler import name matching
On macOS /Library/Developer/CommandLineTools/usr/bin/cc is a symlink
to /Library/Developer/CommandLineTools/usr/bin/clang, and should not
be matched as a GCC toolchain.

Fixes: QTCREATORBUG-27523
Change-Id: I8885a263b46fa8d8a8145f7c0faa31f21aae920a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-05-13 14:44:20 +00:00
David Schulz
b2e2421d2d ClangCodeModel: remove duplicates from clangd quickfix assist
Do not report quickfixes with a diagnostic since those are already
collected by the ClangdQuickFixFactory as builtin quickfixes.

Change-Id: I8d29a08b823291f8beaa762c09b7d29a4b9d0384
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-13 14:19:13 +00:00
Artem Sokolovskii
85d2159e41 CorePlugin: Remove foreach / Q_FOREACH usage part 2
Task-number: QTCREATORBUG-27464
Change-Id: I4767c333c2724c954e63a7297c5013d11ae71777
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-05-13 13:35:04 +00:00
David Schulz
1bfd5da024 LanguageClient: Track quick fix assist processor
Same as for the completion and function hint processor, these processors
need to be tracked so they get cleaned up on client destruction.

Change-Id: Ib24eb8c652e7a44d8b79e1edddda9ad659d145a3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-13 12:59:55 +00:00
David Schulz
089e1edcbf LanguageClient: run quick fix assist on lightbulb click
This will bring up a list of all possible quickfixes instead of just the
last one.

Task-number: QTCREATORBUG-27514
Change-Id: I9066c701f9aab404d26075803b4f62f71078016b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-13 12:40:28 +00:00
David Schulz
4f29bd5613 ClangCodeModel: Fix positioning lightbulbs for diagnostics
Set the diagnostic to the containing code action when generating
refactor markers. This makes sure the light bulb is displayed at the
diagnostic and not the edit location.

Change-Id: I46ac7a19879d2358eb49f5cb1b695ee10a0c682d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-13 12:40:05 +00:00
Eike Ziller
1dd2eea25c Git: Fix compiler warning
Remove unused lambda capture

Change-Id: I623aff7800279d9f9d6088230b76c0f5db59fc2e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-13 11:37:58 +00:00
Miikka Heikkinen
17982e661c QmlDesigner: Disable shadows for gizmos
Some gizmos (selection box and helper grid) are drawn to main 3D editor
scene. Disabled receiving and casting shadows for those gizmos so
they do not interfere with scene lighting.

Change-Id: Ia589d3896c2591061966f6a4d532a0dedbf6fe12
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-05-13 11:11:54 +00:00
Knud Dollereder
4d58f8dee8 Make the curveeditor state aware
Fixes: QDS-6872
Change-Id: I2fe733bf6c25d3517ff80d122977113e10bac627
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-05-13 09:46:43 +00:00