Commit Graph

62421 Commits

Author SHA1 Message Date
David Schulz
9c7b4f0a89 LanguageClient: improve the performance of the inspector
... by caching frequently accessed data of the massages.

Change-Id: I0a0a70c404cbc2fd8d26340004a45aa364843055
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-14 09:30:31 +00:00
Assam Boudjelthia
1e20d4a4ee Android: Add Android 12 to SDK Manager parsing
Allow SDK Manager to parse packages from android-s as Android 12
properly.

Pick-to: 4.15
Change-Id: I3feae845e5b8d98fe1a70988cf6e2ac1d9a5c16a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-07-14 08:57:56 +00:00
hjk
076d1bf10a Docker: Fix debugger auto-detection
Mark detected debuggers as such and give them some bonus to match,
overriding other hacks.

Change-Id: Iaf4d88fa22dd50e68124b61087d4c742f7a56d0f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-14 08:28:56 +00:00
hjk
e8521e6fe1 Utils: Add/fix FilePath::isFile and FilePath::isDir
In general, the more specific isReadableFile etc are preferred, but for
porting a 1:1 match to QFileInfo functionality is helpful.

Change-Id: I5b575ca9a5053f13f63c0fbe0e3dcc222494280f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-07-14 08:16:57 +00:00
David Schulz
be025cbc5e LSP: mark MessageIds created from undefined json values invalid
Change-Id: I5f134c7302e01eadb1d99d71e4317c1c5f334fd7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-13 16:12:38 +00:00
Tim Jenssen
453f4996db use "qml" as QML runtime
Since Qt 6.2 qmlscene is deprecated by Qt.

This patch also removes QMLViewer as a last
QtQuick 1 artifact in external tools.

Task-number: QDS-639
Task-number: QDS-4535
Task-number: QTCREATORBUG-22385
Change-Id: I5f67040954f8ef438961f7166a53bd96d5b73f4d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-07-13 15:38:46 +00:00
Jarek Kobus
0420caa3ce TextEditorWidgetPrivate: Disconnect more signals in d'tor
After the TextEditorWidgetPrivate's d'tor has finished,
compiler starts destructing all the member fields of
TextEditorWidgetPrivate before calling base QObject d'tor.
Some d'tors of some members may still emit signals which
are connected to TextEditorWidgetPrivate's slots. In this
case we may start operating on corrupted internals.

Fixes: QTCREATORBUG-26001
Change-Id: I865cad16601b278fe7f7cf95145557310bb83126
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-07-13 14:18:59 +00:00
Tor Arne Vestbø
a71d725e46 Add workarounds for running under Rosetta on macOS
When Qt Creator is built as an Intel binary, and runs on
an Apple Silicon (ARM) Mac, it will be run via the Rosetta
translation layer. This means any process spawned by QtC,
including qmake, CMake, and lldb, will launch as x86_64
binaries as well.

For qmake and CMake, this affects their default choice of
build architecture, resulting in x86_64 builds of user
applications. We want to produce native arm64 apps, even
if Qt Creator itself isn't one, so we explicitly detect
the situation, and if Qt has an arm64 slice, we default
to arm64 builds.

The logic of adding CONFIG+=x86_64 to the qmake step has
been disabled, as the assumption that a single qmake run
and build will produce only a single architecture does no
longer hold. The corresponding logic in Qt was removed
in 2015 (qtbase f58e95f098c8d78a5f2db7729606126fe093cbdf).

In the case of lldb, running it as an x86_64 binary fails
to attach to the running application. We work around this
by using the 'arch' tool to explicitly launch it as an
arm64 binary. This works for debugging both arm64 and
x86_64 applications.

Change-Id: I65cc0f600223990f25c76cef18d927895e551260
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-07-13 11:18:23 +00:00
Jarek Kobus
9cd97e940b EditorManager: Update current editor prior to deleting other editors
Otherwise it may happen that destructor of an editor being
deleted may trigger a call to EditorManager::currentEditor()
before reaching the editor's QObject destructor. In this case
the pointer to the editor (EditorManagerPrivate::m_currentEditor)
isn't cleared yet by Qt and it may return the pointer to
partially destructed object.

Change-Id: I4f44dce8d680008148a73eb2a8ac13477d0fb825
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-07-13 11:03:28 +00:00
David Schulz
425353aa16 ProjectExplorer: add find support to Issues pane
Change-Id: I8eff2f4da68b1a135c213d2f6f477af70e8877bf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-13 09:01:33 +00:00
hjk
1e19786312 CMake: Simplify CMakeConfigItem::sortOperator
A simple function is faster and less code.

Change-Id: Ibea38936bb0866bb7a8f884d44551e2c4d1bf6a3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-13 08:37:53 +00:00
hjk
bb77053e6d Docker: Add a hint on what to do with "Paths to mount"
Change-Id: I992e73f78ff18ac5ed89ff5ce6fb6e7f98e1cb2c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-13 07:26:43 +00:00
hjk
3f4d45532d ProjectExplorer: Introduce a QString Toolchain::detectionSource
Would be useful to link auto-detected items to the source of
their detection and later automatic removal when the source vanishes.

This is bit more fine grained than the existing detection() and
mimics what QtVersion, Debugger and CMake have.

Change-Id: I2fae95e7e3c2e8191e9ff4cc7f36dc3fde86cf18
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-13 07:22:44 +00:00
hjk
84befc2ae1 QtSupport: Catch some setup errors coming via stdout
Some setups pass error messages via stdout, fooling the detection logic
into believing everything is fine. We roughly know what to expect
from qmake -query, so we can at least filter out some cases.

Change-Id: I799a0bc708d44e062c8ad298c0d8fc576328e5b5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-13 07:20:37 +00:00
Christian Kandeler
3c1e787215 ClangCodeModel: Limit result count in clangd-based locator searches
clangd memory usage explodes when the workspace/symbol result count hits
the six-digit mark, so prevent that.

Change-Id: Iefc2eeb3da7fe541e2b1d3105818126980fc3323
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-07-13 06:55:23 +00:00
Christian Stenger
d0172f80b4 Docker: Guard against empty mounts
Using empty mounts makes using the container fail.

Change-Id: I65041eae3a1ebeec936861b4f85977981bbd84d3
Reviewed-by: hjk <hjk@qt.io>
2021-07-13 05:36:08 +00:00
Eike Ziller
5b21b3bca5 Update qlitehtml to latest master
Fixes local documentation links that refer to just an anchor.

Change-Id: Ib84db2a1a78f31fb081e8c02df0ccdb5a00cae05
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-12 18:10:45 +00:00
Christian Kandeler
264fa85f50 Fix a number of compiler warnings
Change-Id: I3e71bffb2099d896742a6fca77febe20e2076464
Reviewed-by: hjk <hjk@qt.io>
2021-07-12 15:24:59 +00:00
Jarek Kobus
d8286adc7c Implement ProcessLauncher::processId()
Implement the reply confirmation for the started signal.
After qtcreator_processlauncher starts a new process
we connect to its started() signal and post a reply through
the socket to the LauncherInterface with the information about
the new PID. ProcessLauncherImpl now emits the started signal
with a delay, just after the confirmation has been received.

Change-Id: I2689e8e97b17466bd1f6b32c01909c12d80fcdef
Reviewed-by: hjk <hjk@qt.io>
2021-07-12 15:13:03 +00:00
hjk
1936006a91 Docker: Force a container restart when mounts have changed
Change-Id: Iaddb52b6c4fb27ff9ccc098d76cc6e333e02c7e4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-12 13:21:44 +00:00
Christian Kandeler
d603654aca ClangdClient: Do not close temporarily opened files
... if they have been properly opened in the meantime.
This fixes the problem that when a file was opened indirectly via "Go to
definition", the didClose message for the file that we temporarily opened
to search for overrides sometimes came in after the "regular" opening of
the file. As a result, such files were not actually in clangd's open
documents set, and no functionality was available for them (e.g. F2 on a
symbol would do nothing).
Also remove a left-over related declaration.

Change-Id: I9fc85d95595cb38a8d92e3f46505b9c514537d21
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-07-12 12:49:30 +00:00
hjk
e429aaa43b Debugger: Remove the extra server start script setting
This was part of very original gdbserver support where normal
remote debugging did not start the server on the device.

The effect can still be achieved by a custom deploy step.

Change-Id: I8763ea131700115065693bd8a8a5382f0e02a113
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-07-12 12:48:36 +00:00
Jarek Kobus
f8e0f6eb91 ProcessLauncherImpl: always send stop request to process launcher
In this way we may cleanup it properly inside process launcher.

Change-Id: I75051708d58ff645b9dbc632eb0b8d5cb557b7fa
Reviewed-by: hjk <hjk@qt.io>
2021-07-12 12:37:46 +00:00
Jarek Kobus
2aa533c7dd Support ProcessChannelMode in ProcessLauncherImpl
Change-Id: Ifb919f19aac8ad223e6beb93c4c14fa4fdb204e9
Reviewed-by: hjk <hjk@qt.io>
2021-07-12 12:37:23 +00:00
Jarek Kobus
3335a78d5f Send started() signal from ProcessLauncherImpl
Change-Id: Ie9f3b3afe5c74407534fb3f605160cb41336c944
Reviewed-by: hjk <hjk@qt.io>
2021-07-12 12:31:18 +00:00
Jarek Kobus
94a2aefc19 Implement ProcessLauncherImpl::setErrorString()
Change-Id: Idd1f0573d5e7db1b45024ed0c5bd7d0831217f25
Reviewed-by: hjk <hjk@qt.io>
2021-07-12 12:30:54 +00:00
hjk
b349e22e7e QMake: Properly use build device environment in more cases
Change-Id: I3d9000c1de448bb023a9b9012db06ed400bbe85a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-12 11:57:27 +00:00
Eike Ziller
b0aee9ccd9 Update Find/Replace action even in edge cases
The Issues pane has a placeholder for the find tool bar, there is one in
the top level layout for all output panes, but it doesn't support
searching itself. Make sure that the Find/Replace action is updated even
when switching focus from another find tool bar to the issues pane.

Fixes: QTCREATORBUG-25991
Change-Id: If96e9a2c59e159408aa881a01a1df0bb7bf28963
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-07-12 11:37:36 +00:00
hjk
ee974ec491 Utils: Mention environment dialog += and =+ to append and prepend
Change-Id: I9aea9c7bbdfcbdc164c0233b0b12fd634c4b2a47
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-07-12 11:36:07 +00:00
David Schulz
288306a707 LanguageClient: fix completion item isSnippet
Change-Id: Iffe170bc0f74d722662007596906ba8793de36d7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-12 10:30:34 +00:00
Christian Stenger
505401a7d4 CompilationDatabasePM: Be more verbose inside test
Makes it easier to understand what is failing.

Change-Id: I23140641a796150aa97f02c514c0ccd8e7623f51
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-12 10:03:29 +00:00
David Schulz
a8a3cd4f91 LanguageClient: directly update document highlights on changes
If the document highlights are requested after a timeout the document
might have changed again inbetween leading to another document change
notification that gets send to the server.

Change-Id: I476e833c55e1bed96c9bd49ee2f17915ee3536a2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-12 05:05:52 +00:00
David Schulz
5b18d1efa7 LanguageClient: update outline after document
Update the outline sidebar widget after document changes are send to the
server like in the outline combobox in:

Amends ed199da1df

Change-Id: Iab58c0712a1c489576ed25a9b7e28f6f01e65946
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-12 05:05:43 +00:00
David Schulz
4361103193 LanguageClient: highlight current argument in function hint
Change-Id: I23be02c4bef30a527ba9f419a059c1d3bfed1c2b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-12 05:05:33 +00:00
Christian Stenger
27e6cbeb5b PE: Do not skip explicitly missing test files
Amends 9e5fc953da.

Change-Id: I08f792d426cb0ffcfc3904fd293c290565b0856c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-12 04:58:26 +00:00
Jarek Kobus
327645c0f0 Remove unused readChannel()
By default QProcess::readChannel() returns StandardOutput,
and since no one modifies it, it will always be the same.
No need for an assert.

Change-Id: Id55f75e5cce4f1b8eaef2ec3094d7b103c2f0238
Reviewed-by: hjk <hjk@qt.io>
2021-07-09 15:41:39 +00:00
Jarek Kobus
1a98fe33db Implement ProcessLauncherImpl::program() getter
It returns the command stored when starting the process.

Change-Id: If90a3a54f80bc020e043045378caf2ffb603b746
Reviewed-by: hjk <hjk@qt.io>
2021-07-09 15:31:39 +00:00
Jarek Kobus
f341107c9f Mark ProcessLauncherImpl canceled when killing it
Mark ProcessLauncherImpl canceled when the kill
request has been sent to the process launcher.
If ProcessLauncherImpl is canceled, ignore the
finished reply sent from process launcher.
Recheck the state inside stopProcess() method
after calling terminate() - in this way in case of
ProcessLauncherImpl we avoid calling unimplemented
waitForFinished().

Change-Id: Ibad148f6c7e63ef619e53eb41bbeeb7693be3d25
Reviewed-by: hjk <hjk@qt.io>
2021-07-09 15:30:50 +00:00
Alessandro Portale
716f0bd032 Avoid compiler warnings about truncation from double to float
They appeared when compiling against Qt 6

Change-Id: I6bb94168f9776a7fa416d51ff4bb3ca32c9f02fc
Reviewed-by: hjk <hjk@qt.io>
2021-07-09 15:25:44 +00:00
Jarek Kobus
3402411751 Remove unused stateChanged() signal
Change-Id: Ieb8e01ed1c88f981595391698fed6dcff7c8e932
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-09 15:05:23 +00:00
Eike Ziller
952760828a Merge remote-tracking branch 'origin/5.0'
Change-Id: I66f81270c7dcd5a2fa00e6063c2b46b53ab9f39d
2021-07-09 16:07:44 +02:00
Eike Ziller
cfba41c307 Merge remote-tracking branch 'origin/4.15' into 5.0
Change-Id: I2e63e1136af4001836044f4e67e3d01c1e9f0369
2021-07-09 16:01:31 +02:00
Eike Ziller
94d227cd43 Fix build with MSVC
Amends c3e413a864

Change-Id: Idb7e3c9d4cf53cf989d5aa4dd4353db798b92fb6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-09 14:00:02 +00:00
hjk
3f06ca7cbb Docker: Drop the default /opt and /data mounts
They were helpful for my local setup but arbitrary and in some
cases detrimental in the general case.

Task-number: QTCREATORBUG-25981
Change-Id: I65636a9ba8340357f7c83990703fe6e74b2afed4
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-07-09 13:47:31 +00:00
Eike Ziller
e895a0380b Fix lupdate issues
Some tr functions missing, some places where we need full qualification
because lupdate gets confused with namespaces.

Change-Id: Ic1d6ef3b31960dda02bc0788a255857117acdca9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2021-07-09 13:05:03 +00:00
hjk
c916bcd049 ProjectExplorer: Use FilePath::readContents() for API detection
Change-Id: I3f19ed8ffc99f43fde4b7e5edbb53f92c7ef17ab
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-09 12:48:43 +00:00
hjk
97578a4fee Utils: Allow an offset in FilePath::readContents()
Also, change the size limit to take a qint64. Contrary to e.g.
Q(6)Hash::size() there is a realistic chance that 31 bits are not
enough.

Change-Id: Idbe6e765a5cac4336b3d64a8e0adb14966fd18a3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-09 12:48:37 +00:00
David Schulz
dba0294b33 LanguageClient: fix parametersKey
Change-Id: I1ec383fa38db62cc3ed5e61f3fdd526d5edb565b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-09 12:18:59 +00:00
David Schulz
a5861b3995 LanguageClient: prevent removing duplicated completion items
The label is not sufficient to identify duplicates for language client
completion items, since the changed text is not always equal to the
label.

Change-Id: I4d3295944a78b541144ecac0982e1f09a53bec8a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-09 12:18:49 +00:00
Eike Ziller
e45eaf500c Merge remote-tracking branch 'origin/5.0'
Change-Id: I9dca34a9895d19ace05aef5b73e9a806b23607fb
2021-07-09 14:11:59 +02:00