Commit Graph

80529 Commits

Author SHA1 Message Date
Eike Ziller
68c92f6dfa Provide device roots in filesystem locator filter
Check if the full search text matches a device root and suggest them at
the end of the results.

Change-Id: I6e6e201597a9824b5e0c342cbc930baf2ac5ffea
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-04-25 13:27:52 +00:00
Marcus Tillmanns
1fe09a00d7 FSEngine: Fix thread safety
Change-Id: I5223cef1a70ffcb92e886733af2b1d8061c4dbf0
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>
2023-04-25 13:00:09 +00:00
Jarek Kobus
f46f9ac432 AutoTest: Optimize starting task tree in TestCodeParser::scanForTests()
When loading a Qt project, after the Scanning For Tests
finished, the scanForTests() blocks the main thread for
about 2.5 seconds on the call to m_taskTree->start().
The reason is that created task tree contains about 8000
asynchronous tasks. If all they run in parallel it means
that we start them all synchronously.

Don't use internal QThreadPool, as it doesn't prevent
the freeze when more than maxTreadCount() threads
are started. Instead, use the parallel limit with the
same constraint that was used for thread pool.
It means that only constrained number of tasks are being
run in parallel and the rest is being postponed until
some of the running tasks finished. In this way starting
the constrained number of tasks reduces the GUI freeze
to ~0 ms on task tree start().

In general: this patch divides the overall freeze of
2.5 seconds evenly into many very small pieces and
distributes them evenly in time, so the GUI stays responsive.

This patch, when applied together with 2 bottom patches,
reduces the GUI freeze spent inside scanForTests() after loading
a Qt project and after Scanning For Tests finished
from about 23 seconds into 160 ms.

Change-Id: If33076d4f042c3d96434b9f3cc305776fb30906d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-25 12:58:22 +00:00
Jarek Kobus
b9ca680b03 AutoTest: Further optimize TestCodeParser::scanForTests()
When loading a Qt project, after the Scanning For Tests
finished, the scanForTests() blocks the main thread for
about 3.5 seconds on the calls to parser->init().

Refactor the code so that it operates on QSet<FilePath>
instead of QList<FilePaths>.

This patch constraints the freeze to about 40 ms.

Change-Id: I219b3e2abf2b7e5166eec08d83f4cdcb8e4a8098
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-25 12:58:08 +00:00
Jarek Kobus
72bddf9f51 PluginManager: Introduce global future synchronizer
The global synchronizer will be destructed after the
asynchronous shutdown phase and prior to deleting
all the plugins (i.e. synchronously). It's assumed that
between deleting the synchronizer and the point when all
plugin destructors are finished no new futures are added
to the global future synchronizer.

Change-Id: Ibc839b04f2c2bbd35980b8baed51b29c2c4f7c76
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-25 12:57:37 +00:00
Jarek Kobus
e03081a008 LanguageClient: Reimplement matchers()
Change-Id: Iad31279b1563022132b5c2f971ceeb96f19a5eaf
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-04-25 12:56:42 +00:00
Eike Ziller
755f57d450 FileSystemFilter: Share implementation
between old and new API, so I can continue with changes on top.

Change-Id: Ic7b807c9b57296499f1a622bc4e3bc60fbba6865
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-04-25 12:28:00 +00:00
Cristian Adam
fa5c352668 CMakePM: Fix boolean cacheVariables parsing
Fixes: QTCREATORBUG-29078
Change-Id: I652343d6d688e36b6d5ecc23e91243b4cecbb87d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-04-25 12:21:54 +00:00
Jarek Kobus
0a39d20651 BookmarkFilter: Reimplement matchers()
Change-Id: I703cea015bf696acfb3aa7cafc38c9ee22b683ce
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-25 11:19:05 +00:00
hjk
a3f025063f Help: Use IOptionPage::setWidgetCreator() for general settings
Change-Id: I71a500cc349fed92c38368989fc258902c942e29
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-25 11:09:42 +00:00
Jarek Kobus
b19b4482c1 HelpIndexFilter: Reimplement matchers()
Change-Id: I47bf8eee25b91ac5ae7d8fd2c06a34370d5d433f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-25 11:08:17 +00:00
hjk
72d72251d8 Utils: Start decoupling LayoutBuilder from Aspects
Makes it easier reusable elsewhere.

Change-Id: I86ff9f40229a33690f854f5fda692bc06d6976ef
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-25 10:55:29 +00:00
Christian Kandeler
6738616378 Core: Never auto-remove a running search
Change-Id: I03db560fae250ee3c799890179dd8c4618431efb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-25 10:47:25 +00:00
hjk
b7ca84c5ee Utils: Remove one LayoutBuilder::addRow() overload
The flexibility here is getting in the way later when trying to
remove the dependency on aspects.

Change-Id: I7221e80f2067292c7c80aead8f6d739fb7878f7e
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>
2023-04-25 10:07:26 +00:00
Cristian Adam
dad415b884 Terminal: add cmd shell integration when using clink
The script was provided at https://github.com/chrisant996/clink/discussions/453

If clink is not installed cmd will not have any issues, since only
the environment variable CLINK_PATH will be set.

Change-Id: I9f1d16933ae6bbcb3da1243e8704af6dc86b9a4d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-25 09:23:22 +00:00
Cristian Adam
411b2e05b8 CMakePM: Allow project files to be removed in project view
Removal of a project file is done as a rename with an empty filename.

Fixes: QTCREATORBUG-25922
Change-Id: I4443d4a31723eb1ac93f02bad633bcfaf99a9573
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-04-25 09:22:40 +00:00
Cristian Adam
54af6bd5b3 CMakePM: Allow files to be renamed in project view
This includes both with source files explicitly specified or
resulted from a file(GLOB|GLOB_RECOURSE) call.

Fixes: QTCREATORBUG-27538
Change-Id: I5ee113af168bdb8cd0a96e8ab2ae603c0607fb0b
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-25 09:22:08 +00:00
Jarek Kobus
f5d7765094 LanguageClient/ClangCodeModel: Reimplement matchers()
Don't assert when ClientRequestTask::preStartCheck() failed.

Change-Id: I157fe8fc15aa055b70823d6a54454c6eec692f88
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>
2023-04-25 08:52:40 +00:00
Jarek Kobus
08f3d57aa1 CppEditor filters: Reimplement matchers()
They are used only when ClangCodeModel plugin is disabled.
Activated with '.', ':', 'c' and 'm' shortcuts.

Change-Id: I131473c419e0cb302492cc6d4263bd8ad80769e4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-25 08:49:55 +00:00
Marcus Tillmanns
2e384d9c12 Utils: Fix line ending conversion in FileReader
FilePath::fileContents always uses "binary" mode when reading files.

FileReader::fetch previously used QFile with QIODevice::Text mode to
read (local) files, which converts \r\n to \n. This patch re-introduces
the conversion.

Fixes: QTCREATORBUG-29040
Change-Id: I0a16b056bea456512e6526497b725c73b0a1bd11
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-25 08:35:46 +00:00
hjk
c2ea7bc415 FakeVim: Re-organize ExCommand settings page setup
Change-Id: I085a86529fc840472aabf7ae62d6565f454256ae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-25 08:35:45 +00:00
hjk
d13d48a281 FakeVim: Use IOptionPage::setWidgetCreator() for user command settings
Change-Id: Ic5d895634cb5ef1b2e1a6fa465cd800a213a7d41
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-25 08:12:05 +00:00
Christian Kandeler
daf1b29b2d Core: Try not to evict still-running searches
... when the maximum number of searches has been reached.

Task-number: QTCREATORBUG-28976
Change-Id: I12bad860ce61f71aad9ba2fec93333a5d98bc61d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-25 08:04:03 +00:00
Christian Stenger
ca3d889831 AutoTest: Only handle document updates if necessary
Do not send qml document updated unnecessarily in case we know
that nothing had changed at all.

Change-Id: I1d6b94dcd68753e0f451a2812a752ff92f4860af
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-04-25 07:53:06 +00:00
Jarek Kobus
57d982e5ca OpenDocumentsFilter: Reimplement matchers()
Change-Id: Ie458d74321286d720b3eef62b7b3273c5c222e44
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-25 07:32:27 +00:00
Eike Ziller
ec9680d42e Markdown: Add option for hiding preview
Make it possible to hide the preview, by having a toggle button for
"Show Preview" and "Show Editor", and ensure that at least one is always
on and they are in the order as the views themselves. Disable the "Swap
Views" button if only one is shown.

Change-Id: I0ec1e06c2a8ec94e34bf52eae45ba009fd8cd1b5
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-25 07:26:26 +00:00
Jarek Kobus
e849c19a33 AutoTest: Optimize TestCodeParser::scanForTests
In case of loading a Creator project, after the Scanning
For Tests finished, the scanForTests() called by
TestCodeParser::onFinished() freezed the main thread for
about 1 second. In this case requestRemoval() signal was
emitted nearly 1000 times.

Optimize the internals:

1. Don't emit requestRemoval() for every single file but
   emit it just once passing a QSet<FilePath> instead.
2. Adapt some other callees and callers to work on
   QSet<FilePath> instead on a single FilePath.

This change constraints the freeze to about 2 ms.

Change-Id: If23b85b495c125d82eb3c8b5a6912349df122745
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-24 14:04:41 +00:00
Marcus Tillmanns
cc14eaf570 CoPilot: Fix leak in authwidget
Also fixes a crash when the state check returns after the widget
was already deleted.

Change-Id: I04256e6ba686469f18ebdb75c73e12cecf330bed
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-24 13:18:12 +00:00
David Schulz
e58dd4381f Copilot: set the correct suggestion document for inline suggestions
Change-Id: Idbccf2eb68b4d1e2bd3751e851310cc74cac2694
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-24 13:09:31 +00:00
Christian Stenger
5bc60ac8de QmlJS: Stop suggesting versions for imports if possible
Fixes: QTCREATORBUG-28649
Change-Id: I918b229855c18519800a54a73b56eaffa40524e5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-24 11:37:58 +00:00
Marcus Tillmanns
9a25a8849b ClangTools: Check if executable is valid
Previously "getClangIncludeDirAndVersion" would fail
on the QTC_CHECK and print out a warning each time.

Change-Id: Id67b0c7f4c4e52b030d52ad5140f48e0a19770e0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-24 11:20:35 +00:00
Jarek Kobus
4a3495c8b9 LanguageClient: Reorder arguments in workspaceMatchers
Provide a default empty list for clients. It's going to
be used for MatcherType::CurrentDocumentSymbols.

Change-Id: Ib3ba2ec8fa08b9a55eb097ac3cce8bcd513eb5ae
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-24 10:10:27 +00:00
David Schulz
afcbe845ce Copilot: Add setting for automatic completion
Can be used to turn off the automatic completion insertion, so a user
only can request suggestions explicitly via the shortcut.

Change-Id: I0c4d9e2f41d30312b0870facdd80dc1d3d03d809
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-04-24 10:07:21 +00:00
Jarek Kobus
21c71cded7 DocumentLocatorFilter: Make internals reusable in LocatorMatcher
Prepare for LocatorMatcher implementation.

Change-Id: I3d78045a06c8ebefacb033f0eabb5f7a2457ab06
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-24 09:38:53 +00:00
Jarek Kobus
90c09c65f9 DiffEditor: Fix jumping to context line immediately on git show
Fixes: QTCREATORBUG-29081
Change-Id: I7a4658209f95e98cb485e725dee07074dae5c163
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-04-24 08:26:22 +00:00
Jarek Kobus
e9ae45bfcc FileSystemFilter: Reimplement matchers()
Change-Id: I47547713cadfe9aa1212336ffbfbdace3dd84430
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-24 07:39:29 +00:00
Eike Ziller
c9696fbabb Merge remote-tracking branch 'origin/10.0'
Change-Id: I8b36c1812b61dbe08fe3e7930f950e6b8e8a7079
2023-04-24 08:52:35 +02:00
The Qt Project
05f80a132d Merge "Merge remote-tracking branch 'origin/9.0' into 10.0" into 10.0 2023-04-24 06:51:40 +00:00
Jarek Kobus
bb9ba4349a Utils: Use Q_DISABLE_COPY / Q_DISABLE_COPY_MOVE
Change-Id: If9ea6220700769cd99ede3ebaacc4d75cb673e89
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-24 06:36:37 +00:00
David Schulz
b794e98233 QMLLS: fix crash on opening non existing qml files
The automatic handling of the document inside the language client
manager is normally done after a document was opened successfully. Since
the QML document registers the document manually on construction before
the file was tried to be opened the automatic cleanup inside the manager
does not work. Postpone the document registration like in the
PythonDocument after the document was opened successfully.

Fixes: QTCREATORBUG-29021
Change-Id: I2dd9e2da9c9ed6d38414ad991df3c03b62e9d611
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-24 06:25:19 +00:00
Jarek Kobus
9a1be79c0d LocatorWidget: Reuse LocatorMatcher in LocatorWidget
Introduce QTC_USE_MATCHER env var temporarily. When
this var is set, the locator will use LocatorMatcher
internally.

It's very hard to migrate all the matchesFor() implementations
into the LocatorMatcherTask in one patch, so this var
is going to be removed when all filters are migrated.

Whenever a new patch providing the filter's migration
is added, it may be tested by setting this env var.

Add a temporary printout with info about which implementation
is selected in runtime.

Change-Id: If2d6006a89f3669ea4f6f8f171e59e00917419c4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-24 06:19:36 +00:00
Eike Ziller
646f95811d German translation: Python
Change-Id: I86e11626122c88a307134ae352331845fa4b394d
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-24 06:14:03 +00:00
Eike Ziller
5125ccf03f Merge remote-tracking branch 'origin/9.0' into 10.0
Change-Id: Ifbb14e33104b39de8ca2e1495301a53e71496ef9
2023-04-24 08:10:39 +02:00
Jarek Kobus
dfa1dafd49 PerfProfiler: Use Q_DISABLE_COPY_MOVE
Change-Id: I7abe582d2fb092bf87ac14690f588ae3524abc3d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-24 06:04:49 +00:00
Jarek Kobus
2839d019b8 LanguageClient: Use Q_DISABLE_COPY_MOVE
Change-Id: Iee54086810442b64cb8b7aa68a48341909481787
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-24 05:38:02 +00:00
Alessandro Portale
1e02f6bf98 Resuscitate the "legacy" Qt Quick Application wizard
Users still want to create new Qt Quick Application applications
targeting Qt 5 and with other build systems than cmake.

Fixes: QTCREATORBUG-28964
Change-Id: Ib87b7128f0b34eb4126ec771f324c70a960b2a03
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-21 18:42:21 +00:00
Haowei Hsu
440541da23 l10n(zh_TW): Fix translations of 'Toolchain'
* Toolchain: 工具鍊 -> 工具鏈

Change-Id: Ia58d3c58ec46169abfc51036131be5572e7c242e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-21 16:13:29 +00:00
Jarek Kobus
b1e65195ac CppEditor/LanguageClient: Reuse MatcherType enum
Change-Id: I95a8c902ddf6d7525543ccbc2acf45fe273a12f4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-21 15:19:49 +00:00
hjk
6f7a56c31c Designer: Use IOptionPage::setWidgetCreator() for settings
Change-Id: I731905a84110966640cef0bfd8cf7eeb9e7527cc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-21 12:46:14 +00:00
Leena Miettinen
51d6b75fb0 Doc: Fix references to locator screenshots in How-tos
They are now in WEBP format.
Also, move some text and images around and add a reference to
screenshot that shows a list of found files.

Change-Id: I219e2b94fe22ffc6d36b0de34529d3849a76ff1b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-21 12:45:41 +00:00