Commit Graph

3125 Commits

Author SHA1 Message Date
Christian Stenger
658e2a3197 CMakePM: Fix build with Qt6.2
Change-Id: Iac128851da0aa7895d5c2352be550702fbc1e7f9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-09-26 07:49:03 +00:00
Cristian Adam
cd94514dbb CMakePM: Add hover help for CMakeEditor
Fixes: QTCREATORBUG-25780
Change-Id: I954023f701e6c1c6ca5e25190b37f8b9a8becfb5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-25 13:41:44 +00:00
Cristian Adam
05614ab740 CMakePM: Display help details for code completion
The first 1024 bytes from the CMake .rst files are displayed raw data.

A .rst to html or markdown would be needed for nicer user experience.

Change-Id: Ie6adbb404d844ae88b868b465d4125c2177e6cfe
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-25 13:41:34 +00:00
Cristian Adam
53b8f0e495 CMakePM: Speed up CMake introspection
By listing files instead of running cmake and asking CMake to provide
the information.

For properties and modules now the information is taken from the active
CMake version and not from the Syntax-highlighting file.

Change-Id: I0974cc816d990fd382d9e855eb08416b50d0368b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-22 15:26:07 +00:00
Cristian Adam
45a8dc4e44 CMakePM: Support local functions and variables for code completion
... and also navigation via F2.

Change-Id: I0f1242c6ff502973de180643b369c635636b0112
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-22 13:26:10 +00:00
Cristian Adam
0632648be6 CMakePM: Remove the CMake introspection after CMake project load
Will be done in the CMake editor. No need to slow the project loading
when you don't do any editing of CMake files.

Initially I wanted to have it already loaded when code completion is
done, but doing once when a CMake editor is opened is better.

Change-Id: I1eda2a64e708bfa4fab5ab749059a08769800eba
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-22 10:33:36 +00:00
Cristian Adam
ed1568309b CMakePM: Add CMake Profiler action
Change-Id: I17f258834724c37f0933d18b6214851be1965913
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-21 18:39:53 +00:00
Alessandro Portale
1d5ecdb5c7 CMakeProjectManager: Non-toolbar icon variant for "Reload CMake Presets"
Change-Id: Ieadbe94ce22367eaf0ea0da220150051e924a266
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-09-21 18:18:23 +00:00
Jarek Kobus
e753c4585c CMakeEditor: Fix unused variable
Drop a call to currentProject(), as currentBuildSystem()
already implies currentProject() isn't nullptr.

Amends a998269d7e

Change-Id: Ibf902dc78af5c59c6475366f52d0b3489e989789
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-09-21 12:05:19 +00:00
Cristian Adam
d88c270aaf CMakePM: Allow code completion for CMake files without a project
By taking the default CMake tool in Qt Creator. Similar to the editor.

Change-Id: Id1effa3c4f71dc59dcf940f0fc246aa87c9ba0f7
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-09-21 11:48:00 +00:00
Cristian Adam
c0d50cd00a CMakePM: Remove subsequent call to wordUnderCursor
Just use the value above it.

Change-Id: I16e1e3217de6e03d7bf9f16e6966c9854bd68930
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-09-21 11:32:52 +00:00
Alessandro Portale
813342b957 CMakeProjectManager: Fix implicit conversion warnings
Amends a998269d7e

Change-Id: If6d0bda51030a39cb26ec1e270be2086a2bb54a1
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-09-21 09:57:26 +00:00
Alessandro Portale
f3c84c6d4f CMakeProjectManager: Fix warning about shadowing
Amends a998269d7e

Change-Id: I5a36c3fc15e2913656a1d7bf7113ebd39cd6008c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-09-21 09:57:04 +00:00
Cristian Adam
a51380c2fd CMakePM: Add policy support for help and code completion
Change-Id: I82d291639fe890602bba61eded9d1dfd7d38ca41
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-20 21:11:10 +00:00
Cristian Adam
a998269d7e CMakePM: Expand help for variables, properties and modules
Not only CMake functions.

Change-Id: Icd21eb39a55533261f2b5c170a9dbd38a640e3e9
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-20 19:54:03 +00:00
Cristian Adam
52e3ab5272 CMakePM: code completion changes for cmake_print_variables|properties
They are CMake module functions and need only certain parameters.

Change-Id: I6e49359470cd228fec985fca2297a50d44c76ded
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-19 16:35:18 +00:00
Cristian Adam
bc1c24eb84 CMakePM: Revamp the CMake code completion
By using KSyntaxHighlighting's metadata from the cmake.xml file.

With this information the code completion has localized arguments for
functions.

Added support for Generator Expressions $< and function ${ completions.

The project functions/macros and options are also taken into
consideration.

The file completion is using FilePaths and should work remotely.

Change-Id: I79d1360c1249c65c9db65349f326be5d41f0f734
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-18 15:22:39 +00:00
Cristian Adam
e37bbb8e03 CMakePM: Show link for Ctrl + mouse for functions/macros in editor
Amends 4d358ae337

Change-Id: I7f89a1c2e4a32ec8944995074d0198e960a9d798
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-18 08:33:03 +00:00
David Schulz
0b85fc5aa0 ProjectExplorer: reduce the perceived startup time
... by moving restoreKits to the delayed initialize phase.

Change-Id: If72e41b64ee71f2917b3f7a317d9887afc6e29e8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-15 13:08:49 +00:00
Cristian Adam
78f89fc777 CMakePM: Proper support for Unity builds
A Unity build can be enabled by specifying CMAKE_UNITY_BUILD set to ON
globally or per target bases via the UNITY_BUILD property.

CMake would then add unity_NN_[cxx|c].[cxx|c] sources files that would
include the existing project files.

The existing project files would then be added as "headers" to the
project and exported via the CMake file-api.

This patch makes sure that these new "headers" are added to the Qt
Creator's code model and have proper syntax highlighting, be available
to plugins (e.g. Todo) and so on.

Fixes: QTCREATORBUG-23635
Fixes: QTCREATORBUG-26822
Fixes: QTCREATORBUG-29080
Change-Id: Ie8dd542504f632c01f91691f8736e51be8b19a01
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-14 18:10:27 +00:00
Cristian Adam
4d358ae337 CMakePM: Jump to function/macro/option definitions in CMake editor
Fixes: QTCREATORBUG-25523
Change-Id: If9ab6651a858e5fa08e8a1c321cb1f757831e14a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-14 18:10:22 +00:00
Tim Jenssen
1a3a8ecc96 Merge remote-tracking branch 'origin/qds/dev'
Change-Id: Id242ab4ca485527defdcc1555d204e12e50ddb7a
2023-09-14 17:37:24 +02:00
Tim Jenssen
a603b65f18 Merge remote-tracking branch 'origin/11.0' into qds/dev
Change-Id: I2bf1a2a72d9765d9b4088840414b4933644db47a
2023-09-14 12:23:01 +00:00
hjk
efb93d1366 CMakeProjectManager: Remote-ify CMakeFileCompletionAssist implementation
Change-Id: I18aa3d23244dd6475657f43bc18ce83298e278bf
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-09-14 11:27:09 +00:00
Cristian Adam
4f26d802ca CMakePM: Remove support for extra generators
They are marked as obsolete in CMake 3.27 and will be removed in a
future version of CMake.

Fixes: QTCREATORBUG-29603
Change-Id: I6e5d36441d05b87ee4467d13781f53d4269636ad
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-14 10:30:06 +00:00
Cristian Adam
74640c6d5b CMakePM: Fix crash
Amends 6528bd3eed

Fixes: QTCREATORBUG-29587
Change-Id: I62e469a461dd730858e05d0309151dba4e9fe93c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-12 11:56:28 +00:00
Cristian Adam
3a3bf41eef CMakePM: Add support for cmake-format config files
Fixes: QTCREATORBUG-28969
Change-Id: I0bb31993e4d2ffd8affcc67dee5fd70654e2c1d3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-12 10:49:22 +00:00
Marcus Tillmanns
77cc79b7b0 CMake: Cache CMakeTool capabilities
Change-Id: Ie81347a7864abeeb64aa2af6dee3f9def241fed8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-09-12 09:29:50 +00:00
Eike Ziller
dab19c4a8c Use Nanotrace to generate startup performance report
Add various trace points to the code, including the plugin
initialization methods (centrally in plugin manager), code that is
scheduled on the event loop with QTimer::singleShot or
QMetaObject::invokeMethod during initialization, and code that is
triggered from ICore::coreOpened

Can be turned on by configuring with `BUILD_LIBRARY_NANOTRACE=ON`
Run with `-trace <file>` to write trace file. If Nanotrace is not built,
the added code expands to nothing.

Changes in Nanotrace:
- turned generated data to microseconds instead of nanoseconds, because
  that is what Chrome tracing expects
- fixed serialization of duration (needs to be an item of the event, not
  in a "arg" subitem)
- fixed shutdown() to reset the initEvent

Change-Id: I994de82023b820d771e1be0a859ebd8da0b73d4d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-12 07:32:07 +00:00
Marco Bubke
e4a470ed0b CMake: Fix warning
glibc 2.12 is now over 10 years old. I think we do not support it
anymore.

Change-Id: I3df4ebaa73de07c22ff71e50ddbee5938bd0ce55
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-07 11:08:14 +00:00
Eike Ziller
2792166574 Merge remote-tracking branch 'origin/11.0'
Change-Id: Ifab8b72af33de4decf20d2a879bea4dfba1e9fbe
2023-09-07 11:15:32 +02:00
Marco Bubke
9e60df9f7f CMake: Silence warning in third party code
Adding SYSTEM_INCLUDE for which you get no warnings. Fix
PUBLIC_SYSTEM_INCLUDE to work for all cases where PUBLIC_INLCUDES works.

Change-Id: I7059c2879004743c13c368220596081dd054407a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-09-07 08:53:43 +00:00
Cristian Adam
e892a6224f CMakePM: Save document before doing file operations on the CMake
Fixes: QTCREATORBUG-29550
Change-Id: I5ec360a48adce0d51a7fbe1704c7d4a9125bd913
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-05 08:41:43 +00:00
hjk
a475632c66 Utils: Make TreeViews use setUniformRowHeights by default
When applicable, the flag makes a significant difference in
performacnce. However is easily forgotten in cases where it
is applicable, and cases where it is accidentally used are
easily spotted visually. So arguably, opt-out is a better
default than opt-in.

Change-Id: I88aeb05b42533ba4e23c39573a3ddd016343cd55
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-05 07:24:21 +00:00
hjk
67212a31ee Utils: Cache theme icon access
These trigger over 120k file exist check on my machine on startup,
just for a handful icons.

Change-Id: Ic73f0783142ed329c2f8c8b852f622e69fc306da
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-01 14:03:33 +00:00
Cristian Adam
07ad848ea1 CMakePM: Replace QDir in CMakeBuildConfiguration
This allows remote support.

Change-Id: I12c991d584baa3762102b8a19179e732a31f192b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-08-31 14:23:10 +00:00
Cristian Adam
246f33c20d CMakePM: Replace QDir with FilePath in fileapiextractor
This allows remote support.

Change-Id: I5ac46b1c2ed0e7e1fcc559522f1fcd902f83b8c0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-08-31 13:06:30 +00:00
Cristian Adam
925b7a3566 CMakePM: Replace QDir with Utils::FilePath in editor
This way we could handle remote files.

Change-Id: I7062445cb743a2838f3c9f1bcff89611127011ca
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-08-31 13:04:53 +00:00
hjk
41184bc9fc Utils: Use numberedKey(Key, int) more wildly
Will ease transition to a key class that doen's have ::number()

Change-Id: Ib2f2957c916f41b0731a2033422bfbf7e429bcc8
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-30 09:57:23 +00:00
Cristian Adam
d9a8eba35d CMakePM: Enable cmake format action only if the tool is present
If the tool is not present the menu action is disabled.
Also add a link to the Qt Creator cmake-format documentation.

Fixes: QTCREATORBUG-29415
Change-Id: I4afb33f0d5ce08975b0964d6bee80dfb41cfcde5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-08-29 13:29:13 +00:00
Eike Ziller
da7c25e8da CMake: Do not print warning if no run device is set
With an iOS kit, there is no run device set if no device is connected,
which triggered an assert.

Change-Id: I9c435c618daab2601973372efb84f9ddbe9c5998
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-29 10:38:12 +00:00
hjk
23149b27ab Utils: Introduce variantFromStore and storeFromVariant
These are functional replacements for
  QVariant::fromValue(QVariantMap) (or QVariant::fromValue(Store)) and
  QVariant::toMap() (or QVariant::toValue<Store>())

We will have a few code paths in the end that need to explicitly
operarate on both QVariantMap and Store (e.g. actual reading/writing
to keep format compatibility etc), so these can't in the end be
simple to/fromValue(OneType) but need an internal 'if' or such.

Change-Id: I954f3cb24fa8fe123162b72bbd25d891dd19b768
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-28 11:16:40 +00:00
hjk
d7d78df9da Plugins: And more Store and Key
After this one, is compiles with the opt-in macro. Not changed yet,
though.

Change-Id: I29a66ecb5daa71d0d97566b81fd9f47d92f6368a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-25 11:45:22 +00:00
Eike Ziller
c9fd5465eb Merge remote-tracking branch 'origin/11.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs

Change-Id: I0b0394dd68cf89b2579d623af897f55dc01aeea5
2023-08-25 11:50:14 +02:00
Cristian Adam
bd36af75eb CMakePM: Add F2 jump for CMAKE_SOURCE_DIR and more
This will allow opening CMake files via F2 when using include statements
like: include(${CMAKE_SOURCE_DIR}/cmake/api.cmake)

CMAKE_BINARY_DIR and CMAKE_CURRENT_BINARY_DIR are also supported.

Fixes: QTCREATORBUG-29467
Change-Id: I9adb417d98e8a8fccf6cd3e5038562db02cb28c2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-08-25 08:51:34 +00:00
hjk
8d0aa34bfc Plugins: A bit more Keys and Store
Change-Id: Iee55eeaa881dd9f2047fdbe95ad8d827f4ba34e0
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-25 08:00:02 +00:00
Eike Ziller
f2da62fd22 Fix exclusion of system directories from (DY)LD_LIBRARY_PATH
We should not only exclude children of system directories, but also the
directories themselves.

Fixes: QTCREATORBUG-29478
Change-Id: I1aa18b2faa03d241b8cc43eb157b5fa49285a12b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-25 07:16:35 +00:00
Cristian Adam
6a30ebd01e CMakePM: Only set cmake reply fileWatcher after CMake has run
This avoids the case when CMake would trigger the file watcher when
generating totally different json files.

For example switching branches and doing a build on a big project, like
Qt Creator for example.

The filewatcher would be triggered and the UI would freeze for quite a
while.

Task-number: QTCREATORBUG-29416
Change-Id: I6ff47d8c2553f7718e82d92daae99036f37aca7d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-08-24 15:23:21 +00:00
hjk
5254765e16 ProjectExplorer: Re-organize KitAspect layouting related functions
Less obscure as it's fairly close to the standard pattern now.

Change-Id: I4680465fbdb9fb6a458c18ef0534e4d8a4a31d1e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-08-24 08:40:32 +00:00
hjk
6e307be365 Utils: Rename the new Storage to Store
Apparently that's what the young people on the web use for such a thing.

Change-Id: I75d5396ff3cb3c26efd6008b5f2261354c4f7896
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-24 05:56:57 +00:00