Commit Graph

2626 Commits

Author SHA1 Message Date
hjk
652b9844e6 Utils: FilePathify Environment::{ap,pre}pendOrSetPath etc
Change-Id: Idfa5ec247337570936b0236cab9d3a5669792ca0
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-10 07:26:31 +00:00
Christian Stenger
f686bce68f QmlJS: Soften strict equality check Pt II
Disable strict equality check for undefined values as there
are too many ways the code model just assumes "undefined" as
the information would be present at runtime only or to avoid
too complex evaluation.

Task-number: QTCREATORBUG-25917
Change-Id: I7c6da04f52ba767c4ef5c21078dc14ac4de86687
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-11-08 08:04:42 +00:00
Jarek Kobus
acfe224281 Flush finished() signal when waitForReadyRead() was called
Apparently the QProcess behaves like that.

Change-Id: Idb1993b8abccbd7943582d41bd456eacc9a1c185
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-04 12:30:03 +00:00
hjk
84f6b8891b Core: ExternalTool: Use FilePath also for executables
Change-Id: I6ec914b68ae41f9ee5eb28416c29d0431c5ab880
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-29 11:54:29 +00:00
Christian Kandeler
c3a1193969 TextEditor: Add highlighting category for namespaces
... and make use of it in the built-in code model and with clangd.

Task-number: QTCREATORBUG-16580
Change-Id: I8c331f56aa1bbf91c9f768be82a779a72f40c4c7
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-29 08:36:20 +00:00
Christian Kandeler
d8d4739bc4 TextEditor: Allow special highlighting for static members
Task-number: QTCREATORBUG-9659
Change-Id: Idae529fd876ba5f555c76e4d282efc9263263d6c
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-28 10:04:57 +00:00
David Schulz
d849643cb0 QmlJS: fix building tests
amends d68bb4687c

Change-Id: I7fc5b260a7748829038b8494e75e4cfc5a56945b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-27 08:46:04 +00:00
Assam Boudjelthia
43f759a6b0 Android: remove unauthorized field form AndroidDeviceInfo
This is not really needed anymore, it was mainly used for physical
devices to report whether they need user authorization to be used
via adb. This is now handled by IDevice::DeviceState, where a
Connected device is unauthorized, otherwise any physical device is
ReadyToUse if authorization is good.

Change-Id: If5c1e49b98063eabe4205cd8adb5b11515e1e1de
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-25 09:22:08 +00:00
Assam Boudjelthia
ec55b1a483 Android: remove AndroidDeviceType and State from AndroidDeviceInfo
No need to have these enums which are now only a duplication of
IDevice::MachineType and IDevice::DeviceState.

Change-Id: Icc3f112f2670c7354bb282b36fad0f0631b9e047
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-10-25 09:21:37 +00:00
Christian Stenger
e1a15b2db5 QmlJS: Soften strict equality check
Judging on the sense of a strict equality check depends on
different aspects. As attached properties cannot be inspected
easily and e.g. function calls cannot be evaluated as they may
have different return values for different code paths we need
to soften the check to avoid false positives.

Fixes: QTCREATORBUG-25917
Change-Id: I121335a387eb235090346162df4703d3000b7426
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-10-15 05:18:23 +00:00
Assam Boudjelthia
78da7e2922 Move sdkmanager's sdk level parsing to AndroidConfig
Both the sdkmanger and avdmanager (maybe more) need to parse the sdk
level for packages and devices which may contain letters, make them
use the same logic.

Change-Id: Iff7fef3a66e00fac11b833f73f2f334a4cf1a766
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-13 14:56:06 +00:00
Christian Kandeler
a40b7867f6 ClangCodeModel: Optimize getAstPath()
Profiling has shown that this function is a hotspot. Luckily, it can be
easily sped up by taking advantage of the fact that the AST nodes are
(mostly) sorted by range, allowing us to employ a binary search when
looking for a given range.

Change-Id: I950c150543ff68b975d36c6fb652d366b93ea3b2
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-11 08:46:52 +00:00
Eike Ziller
19abb9f877 Merge remote-tracking branch 'origin/6.0'
Change-Id: I9d25a7ac39b3619856fc8d8a6be6f91a403b3969
2021-09-30 09:03:12 +02:00
Christiaan Janssen
525039daeb QmlProject: port changes from QtForMcus
Task-number: QTCREATORBUG-26041
Change-Id: I5068381fb2c4c901d8621e0b8358db77d2cb0b21
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-30 06:19:46 +00:00
Eike Ziller
050af56000 Merge remote-tracking branch 'origin/6.0'
Change-Id: If773f217a9708ce0ad0b8adeefe3266ba0371a32
2021-09-29 12:54:38 +02:00
Eike Ziller
aa22e98b1d Merge remote-tracking branch 'origin/5.0' into 6.0
Change-Id: Iaa5a0fea546d4f28dbceae0458a325077ed382b7
2021-09-29 10:18:48 +02:00
Christian Stenger
430c48ac1a Tests: Fixup test expectations
Amends b64863806f.

Change-Id: I8df23cc10d71760cacb03eb59b728400a4ef3c61
Reviewed-by: hjk <hjk@qt.io>
2021-09-28 13:18:09 +00:00
Jarek Kobus
7958de05f5 Introduce Utils::Singleton
Introduce Utils::Singleton class and
Utils::SingletonWithOptionalDependencies class template
that helps implementing singletons that depend on other
singletons. It's guaranteed that whenever singleton B depends
on singleton A, than A is always created before B is being
created, and that the order of destruction is always
opposite to the order of creation.

Dependencies of singleton are listed as template arguments
for SingletonWithOptionalDependencies class template.
The first argument of SingletonWithOptionalDependencies
class template is always a singleton class itself.

Prepare a common interface for all singleton subclasses:
SingletonSubClass *SingletonWithOptionalDependencies::instance();

Make instantiating singletons and its dependencies thread-safe.

Create singletons on demand (only if some code needs them).
It's not needed anymore to explicitly instantiate
all required singletons in tests.

Make it possible (and thread-safe) to instantiate ProcessReaper
and LauncherInterface singletons in non-main threads.

Make the following dependencies between existing singletons:
   SshConnectionManager depends on:
-> LauncherInterface depends on:
-> ProcessReaper

Change-Id: Iefaacab561c2b3dcf07e7fafbb87339ea6a15278
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-28 10:25:29 +00:00
hjk
aa4b825809 Ssh: Use FilePath for SshConnectionParameters::privateKeyFile
Change-Id: Ifaf97cc744f80e1fa0f4000aabf83671b2ffd972
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-28 09:57:41 +00:00
hjk
0aa3cc45b5 Core: Use FilePath for ExternalTool working directory
Change-Id: Ifd295c3bd07b79f146b84fc27c117f42ba9b793f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-27 14:21:40 +00:00
David Schulz
c00330f905 Editor: multi cursor support
Adding a way to create multiple cursors that can insert/remove text at
arbitrary positions in the document. Adding cursors is done by pressing
alt + up/down or by clicking into the editor while holding the alt key.

Fixes: QTCREATORBUG-16013
Change-Id: I495d27d95a3d277220946616ef30efc241da0120
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-27 10:56:54 +00:00
Christian Stenger
b64863806f Tests: Fix expectations in offset test
Change-Id: I875966409d769fe19e615763c605c527398b01dd
Reviewed-by: hjk <hjk@qt.io>
2021-09-27 10:40:15 +00:00
Christian Stenger
de3e3e7af1 Tests: Fix execution of dumper tests on Win
Amends 6786d585e0.

Change-Id: Ib0c9b3d07741db00a01033be2118487ecc9644ea
Reviewed-by: hjk <hjk@qt.io>
2021-09-22 04:41:33 +00:00
Christian Kandeler
e79b9050eb CppEditor: Remove an unused enum value
Change-Id: Ifd0361a9a78eae7be917e1fff68161aa0cd8e79f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-21 11:28:19 +00:00
Eike Ziller
3d4d7c7e14 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/plugins/clangtools/clangtoolssettings.cpp
	src/plugins/clangtools/executableinfo.cpp
	src/plugins/clangtools/executableinfo.h

Change-Id: Id8caf63e3e594792467d3447870086bd2d8f73b9
2021-09-13 17:03:55 +02:00
Christian Stenger
6786d585e0 Tests: Fix running dumper tests on Win
Using QtcProcess needs more setup, so use consistently
QProcess for all processes inside the dumper tests.

Change-Id: I7c09c6705c8b8d52ba7b27b054b825c4147647d3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-09-13 11:18:48 +00:00
Jarek Kobus
4b81483b4d Add some explanation about how to run this test
Change-Id: I748e13db89dc79bbf11f663ce6914513d2912766
Reviewed-by: Alp Öz <aoz@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-13 10:50:44 +00:00
Jarek Kobus
f72c4cb8ac Ssh: Re-base SshProcess on top of QtcProcess
Change-Id: I266820e0e2ea12d6e4a5a83a679a7279fab9cd83
Reviewed-by: hjk <hjk@qt.io>
2021-09-13 09:26:09 +00:00
Cristian Adam
0f0287d907 Debugger: Enable standalone usage of debugger auto test
Change-Id: If89d261c82b25332ab6e354dfbf908765bb802f3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-09-13 08:00:29 +00:00
Jarek Kobus
33f1a96005 Control the lifetime of SshProcessManager
Make it possible to control when the SshProcessManager is
being constructed / destructed. Expose public constructor.

Since different singletons depend on each other, we need
to control the order of creation and destruction of them.

The order of creation is like that:

1. QCoreApplication
2. ProcessReaper
3. ProcessLauncher
4. SshConnectionManager

The order of destruction must be opposite to the above.

Change-Id: Ice07eb751cd61c03cb461816fa1b74ab040a53de
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-10 14:02:21 +00:00
Jarek Kobus
ecfe6b7fc1 Add a test ensuring we don't receive a warning when killing process
Before we were receiving the following warning when detroying the
QtcProcess while still running:

QProcess: Destroyed while process ("[program_name]") is still running.

With the new implementation it won't appear anymore since terminating
running QtcProcesses is done internally by the reaper.

Change-Id: I14a0de136f463966cb1e4c43c5cb26b4de47e7ce
Reviewed-by: hjk <hjk@qt.io>
2021-09-09 14:34:59 +00:00
Ihor Dutchak
716efc964d Debugger: Add support boost::container vector/static_vector
Also fix boost::container::list.

Change-Id: Iaa2ff09defc6f90c3f6eb1f7b333f9e5ccc16b65
Reviewed-by: hjk <hjk@qt.io>
2021-09-09 07:18:34 +00:00
hjk
d10b8e47de Debugger: Fix CComplex dumper test
Looks like newer gdb's output looks now closer to lldb's.

Change-Id: I9b44eec1aa1c448ca4ed85696243807145a8de51
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-08 14:34:13 +00:00
Assam Boudjelthia
41528390b8 Revert "Move sdkmanager's sdk level parsing to AndroidConfig"
This reverts commit 2d77922856.

Reason for revert: This causes a build error in Android tests, reverting until the a fix is ready for that to not block the repo.

Change-Id: I74961df660ebaf69caf092d53172821815f21268
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-08 12:52:16 +00:00
Assam Boudjelthia
2d77922856 Move sdkmanager's sdk level parsing to AndroidConfig
Both the sdkmanger and avdmanager (maybe more) need to parse the sdk
level for packages and devices which may contain letters, make them
use the same logic.

Change-Id: Iff7fef3a66e00fac11b833f73f2f334a4cf1a766
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-08 08:09:20 +00:00
Eike Ziller
95de5c93b1 QmlJS: Fix issues with getting modulePaths
This patch

- improves performance by removing the usage of QRegularExpression for
trivial string operations (this is called 3000 times after configuring
Qt Creator)

- fixes handling of version number like "2.-1" which are the result of
imports with only a major version number like "import QtQuick 2"

Task-number: QTCREATORBUG-25899
Fixes: QTCREATORBUG-26178
Fixes: QTCREATORBUG-26216
Change-Id: Ic792909513f4fe25ac72043645f297ee41890375
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-09-07 08:16:48 +00:00
Jarek Kobus
ace765c199 Move ProcessReaper into lib/utils
Reuse ProcessReaper inside process launcher.
Automatically reap all internal QProcesses of QtcProcess
(either direct child of QtcProcess in QProcessImpl
or indirectly inside process launcher).
Make ProcessReaper work again on QProcess instead of on
QtcProcess, so it may still be reused for non-QtcProcesses.

Change-Id: I950cac5cec28f17ae97fe474d6a4e48c01d6aaa2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-09-06 21:28:19 +00:00
Jarek Kobus
a454b3dc23 Use QProcess' / process lanuncher's exit code
Change-Id: I802116c45847daf9a647771ee293aef8463fc3c7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-03 10:56:19 +00:00
Jarek Kobus
597750507e Implement process channel forwarding in process launcher
Change-Id: I9e526eb40ebc46284f773d10ec0e285a009c524d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-03 10:56:12 +00:00
Eike Ziller
253c4e55b6 CMake build: Compile QmlDesigner autotests
We cannot do this via a static library, because the tests need
to compile the same files with different defines
(QMLDESIGNER_TEST). Add a function which extends a target
with the corresponding files.

Also do not hardcode resource directories in the test -
the Qt Creator app bundle is no longer in a "bin/" subdirectory
on macOS. Use the build system provided IDE_*_PATH
variables instead.

Change-Id: I21850eba3cb47b4dcfd5e66227183b2d1ff35ff2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-02 10:09:57 +00:00
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.

Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 14:53:58 +00:00
Christian Stenger
9eee8e4b84 Tests: Add test for async copying via FilePath
Change-Id: Idbc18d43ea81d395cc76f7bf9cfb32df1350b3ed
Reviewed-by: hjk <hjk@qt.io>
2021-09-01 11:41:51 +00:00
hjk
5830641d0f Valgrind: Make callgrind work on docker
Callgrind on Remote Linux did not work for years, so its safe to ignore
the remains from the previous remote support and start over.

This here now handles the local case and the case where callgrind
runs together with the debuggee in the same docker container.

Guessing at the output file name is replaced by specifiying it in
advance.

Cross-setups are not yet supported.

Change-Id: I97edeb4eab7475727eddb26d25f8bec650a7eeb9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 09:27:24 +00:00
Jarek Kobus
15c183fce6 Set process state to NotRunning after FailedToStart error
Remove the process in process launcher after error has appeared.
Remove unneeded stopStopProcedure as we are disconnecting from
process' signals inside removeProcess().
In order to behave as much similar to what QProcess does,
provide a test that:
- ensures the FailedToStart error is synchronously emitted
  when waitForStarted is being executed
- ensures that process state is reset to NotRunning after
  FailedToStart error
- 2nd call to start/waitForStarted doesn't block on
  waitForStarted

Change-Id: I139354421d037739f1cc1a2685b66f1e5b6170c8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-31 12:09:36 +00:00
Eike Ziller
987ad3fe9c Merge remote-tracking branch 'origin/5.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/android/androidconfigurations.cpp

Change-Id: Icd2b0fda2b2653656285bbbe457c30c9cd414d3f
2021-08-30 12:15:37 +02:00
Christian Stenger
aca5e375f4 Tests: Fix build without ShaderTools
Change-Id: Id22a91c440ea08fdab42e864d54587836e043584
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-27 13:38:45 +00:00
Christian Stenger
68c2741587 Tests: Unify build for debugger tests
Latest breakages suggest to unify this as qmake was not linking
directly against utils when building some of the debugger related
tests except on Windows.
CMake and Qbs builds are untouched as they did link against utils
before already.

Change-Id: I0541964417546294b4b82aceac06f7322b1bef64
Reviewed-by: hjk <hjk@qt.io>
2021-08-26 12:11:55 +00:00
The Qt Project
2028d1c620 Merge "Merge remote-tracking branch 'origin/5.0'" 2021-08-26 11:07:04 +00:00
Christian Stenger
3d2a0ae2a6 Tests: Fix compile with qmake on Linux
Amends 244e940c94.

Change-Id: Ic1a308d44c51caae53c60dac7d08510b936896fd
Reviewed-by: hjk <hjk@qt.io>
2021-08-26 09:42:03 +00:00
Eike Ziller
0777b65db3 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	src/plugins/android/androidconfigurations.cpp

Change-Id: If8dc2cdf131811e08ca147c6f58dbb3ed3bf7227
2021-08-26 11:09:08 +02:00