To improve the speed of parsing the result of a remote
cmake call, we move the file fetching and parsing into a
mapped concurrent call.
We also first uniquify the list of files to remove duplicates.
Fixes: QTCREATORBUG-29618
Change-Id: I18108928ba3b5f4f8ec3d5610b216c5ccf060877
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This is where the user would expect it.
It is an action, so the user can assign a keyboard shortcut if needed.
Change-Id: I4c6db3b1dafb5fb173a07c21d271715310a2b091
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Let's say you move the mouse left and right on the keyword, we shouldn't
flicker showing the same tooltip to the new position.
Change-Id: I45b69578d377384422535ce5f33f81bc916a42e2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
No need to cache the value of the CMakeTool, since it causes issues with
the update mechanism.
Task-number: QTCREATORBUG-29683
Change-Id: Id5925b9a90d6010aa09b4a2f7b5ed3d447f5cd7a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Avoid calling not-thread safe functions from inside
the CMakeFileCompletionAssist::performAsync().
Move calling these functions before the asyncRun, collect
the needed data inside the PerformInputData structure
and pass it to the other thread instead.
Fixes: QTCREATORBUG-29683
Change-Id: I56127163a47339bc45d47f3a7d2c76d518b640f7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Check that the function operating upon is "include" and then match the
word under cursor with a file from the project.
Change-Id: Ia0131f08515c56582a1fb02a59d6b2e41ac04288
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
The CMake snippets do have comments with the origin of the snippet and
this patchset allows navigation to the url in question.
Change-Id: I6eb2565e8f7b9100a1cc19dbf8ccda430c698613
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
For example find_package(ZLIB QUEIT) will result in the package
variables ZLIB_LIBRARY ZLIB_INCLUDE_DIR.
The variables are available for both code completion and navigation.
Change-Id: I4ea6090f44a980dc91632fcabbda16987b0f0285
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
They were available via Ctrl-K and "cmo <target_name>". But they should
be working also in the text editor.
Change-Id: Iaad72b784485364776b67d6dfdef7ba73dd2df70
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This allows e.g. Qt6::Core to be specified as argument for
target_link_libraries and navigation via F2.
Also fixes a bug introduced with
695952f84b which removed the project
specific features due to project being nullptr.
Change-Id: I5efa28c498d337e6bab564533a5445e6c364b26b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
To be able to parse the rst help files from CMake
Change-Id: Ibec21e8571324276d2080f81728b1268581601d0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reuse it in CMakeEditor and CMakeFileCompletionAssistProvider.
Amends d04585b519
Change-Id: I8dbd59c815e017404ff215ca1ff68740d6653e91
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
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>
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>
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>
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>
By taking the default CMake tool in Qt Creator. Similar to the editor.
Change-Id: Id1effa3c4f71dc59dcf940f0fc246aa87c9ba0f7
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
They are CMake module functions and need only certain parameters.
Change-Id: I6e49359470cd228fec985fca2297a50d44c76ded
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
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>
... by moving restoreKits to the delayed initialize phase.
Change-Id: If72e41b64ee71f2917b3f7a317d9887afc6e29e8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
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>
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>
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>
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>