Commit Graph

717 Commits

Author SHA1 Message Date
Eike Ziller
380f7622de Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/debugger/watchhandler.cpp

Change-Id: If759b6260dfa008738d3a0ce543eb0eead8a8bba
2023-02-27 09:48:12 +01:00
David Schulz
9655c88862 LanguageClient: do not delay requesting symbols in the locator filter
This qualifies as a user interaction and the results should be collected
as fast as possible.

Change-Id: Ia83893fab87c253b9939cfee928aa12866087aa0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-02-24 09:26:02 +00:00
Jarek Kobus
b364e4a9cd LocatorFilter classes: Use Core namespace
Change-Id: I4fd1b1ed6aa9d844ed49123e80bfb066b9fa7af2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-02-23 08:28:45 +00:00
Orgad Shaneh
6a0a4ac5e4 Merge remote-tracking branch 'origin/10.0'
Change-Id: Iff4973fc4116122bcaa7aa9434294dba875ef56a
2023-02-14 15:52:41 +02:00
Alessandro Portale
9f2f2f3390 Translations: Change translation context prefix from "::" to "QtC::"
lupdate would be confused by translation contexts starting with ::

Change-Id: Ie95e73436fd3cafc80a8e89f908efadc747e644c
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:55 +00:00
Alessandro Portale
226799858c Translations: Replace QCoreApplication::translate() with Tr::tr()
Calling <Module>::Tr::tr() is preferred over
QCoreApplication::translate("::<Module>", "..."). This changes
occurrences in .cpp files.

Change-Id: I3311ef0dbf3e7d105a3f181b6b988f3b444468f1
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:37 +00:00
Christian Kandeler
a811afaeab CppEditor: Render forward decls less prominently in outline
Fixes: QTCREATORBUG-312
Change-Id: I9bb77add24737881eeee008620941b55118ee0e5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-02-09 08:59:25 +00:00
Christian Kandeler
cc52478a93 LanguageClient: Export LanguageClientOutlineItem
To enable more customizations by specialized clients.

Change-Id: I0ad92e248e931389c3fa239df424df8883e1d86e
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-02-07 12:01:31 +00:00
hjk
dab859e776 Utils: Replace Environment.isValid() with .hasChanges()
That's closer to the intended semantics. The "other" use in docker
will be changed to an optional<Environment> as follow-up to
keep this here mechanical.

Change-Id: I43ef9da6c9c7731b28f9d6fab6413ce9c4f428b4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-27 12:37:35 +00:00
Christian Kandeler
0d909c353c Designer: Update C++ code model on an object name change in designer
We try to locate the old symbol name in the generated ui header and
rename the symbol in the background.

Task-number: QTCREATORBUG-1179
Change-Id: Iaf68e3922cd728cbc87d0dc97125e34b8bdaa6be
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-27 10:02:52 +00:00
David Schulz
9938fffe06 LanguageClient: close and reopen renamed documents
That is the way accoarding to https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_didRename

Change-Id: Ibed1873ac85eb2e9074481537a34f959a55a6f71
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-23 14:01:20 +00:00
hjk
118b84ffd6 Use simpler Plugin::initialize() when feasible
Change-Id: I567965d266f20526bda9f823e31a04b354d53fb1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-20 12:13:10 +00:00
David Schulz
42d7304d2b ClangCodeModel: Allow cancelling the background index
Restarts the client with temporarily disabled indexing. The block is
reset after starting clangd, so any subsequent changes to the
configuration or the project will start the client again with indexing
enabled.

Change-Id: I16c975b6ef0b56f27ce5b2ced01f534f8ae0b4d3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-20 08:44:57 +00:00
hjk
77054c2fa3 LanguageClient: Tr::tr
Change-Id: Idbd7c5cdadba4f269b2033df91db0e05bb5281d5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-20 07:56:04 +00:00
David Schulz
ca2979ca52 LanguageClient: Do not untrack documents before restarting a client
shutdownClient removed the association between the document and the
client, but this is one of the information we would like to keep when
restarting a client. Also we never want to delete the client when
calling restart.

Change-Id: I0558c27ba4b9171c7933edaf2e17847d4e6f62b6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-19 10:10:42 +00:00
Christian Kandeler
7b5c5b774f LanguageClient: Fix renaming with pre-set replacement symbol
If a caller passes in a fixed new symbol name, it must not be overwritten
with one derived from the old symbol name.
The problem can be verified with the "convert to camel case" quickfix.

Change-Id: I3d3aca692cb8e73535e1ef657608fd13d18ee5df
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-19 09:04:51 +00:00
David Schulz
41294e70b4 TextEditor: prevent crash on updating the completion model
Prevent updating the model with something other than a generic proposal
model.

Change-Id: I3880c1ce4ae7cf0aa4fb72d59b75a40db3f53482
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-19 06:28:41 +00:00
Alessandro Portale
0a67f912eb Fully qualify Tr::tr calls for the cases where lupdate needs this
Change-Id: Icc5757376b028d9e5602751d9d8ea0a850970ebb
Reviewed-by: hjk <hjk@qt.io>
2023-01-17 15:24:23 +00:00
David Schulz
15cf2ecf25 LanguageClient: Export ProgressManager
Change-Id: I737b7097878aacf9d1cf5b72af05b1471ab36891
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-17 13:22:21 +00:00
David Schulz
f920ee217b LanguageClient: remove unused code
Change-Id: Iac6a0f02aa52d9d5d1699200b2dd328c00ea9f30
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-17 07:16:34 +00:00
hjk
e7c536011f Prefix Tr::tr contexts with ::
To make outliers better visible in Linguist

Change-Id: Ic35ea2a858b7e3576d9a416fb494fddb616eaaa1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-13 12:00:17 +00:00
David Schulz
3677932266 ClangCodeModel: reuse Id for restarted clients
This is needed to keep annotations hidden after the restart of clangd if
the user disabled them in the text mark tooltip.

Change-Id: I69a668f2ba71f1dda83eca74a064af7ec1f92e77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-12 14:45:12 +00:00
David Schulz
baa1e3c2e1 Editor: Allow to hide annotations for a group of text marks
The hiding is not persistent, so on the next Qt Creator start all
annotations are visible again. This is meant to quickly get rid of
annotations if there are to many irrelevant of a specific kind.

Change-Id: I4862e56e0f5624f30aadda26efc9dea672ab1f57
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-12 10:19:10 +00:00
Jarek Kobus
ed3d75b044 Fix missing include
Amends 887db6b419

Change-Id: Iaea15ce222f07306b48f2fde5e1526689a9d9aff
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-11 10:38:46 +00:00
David Schulz
887db6b419 LSP: implement call hierarchy
Fixes: QTCREATORBUG-11660
Change-Id: I006872ba598a807f1f9f16d134fe9ce4fe5dd09d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-11 09:49:01 +00:00
hjk
4ddd28ae22 Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*
... and re-use the old QtcProcess::readAllStandard* names for
a QString-returning 'decoded' version.

For now, only use that in 'full Utf8' cases, to stay bug-compatible,
the plan is, however, to employ the QTextCodecs we have already
in the channel buffers. That will be one-by-one, though.

Change-Id: Id209e0671920d4ea4197918e872f441254112d52
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-10 12:08:53 +00:00
hjk
66c08a824d Utils: Rename most FilePath::{from,to}Variant uses to {from,to}Settings
Specifies the main purpose more clearly. The remaining ones a "true"
(internal) variants in models and as action data.

Change-Id: I8dd3c846e419f29d88283c2f48268ef6685b19fe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-10 09:00:30 +00:00
Marcus Tillmanns
bf9e2110e6 LSP: Use localSource
This change allows the LSP to find a local version of a source
file even if the server is running on a remote device.

Change-Id: I274cb327ad958ac3c4486859da666702758b7d42
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-10 07:03:13 +00:00
David Schulz
d62d39642e LanguageClient: Add action to restart client to editor toolbar
Change-Id: Ib2fb0f6d9a5b3baeac937f298670887fa704ddce
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-09 14:12:22 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Eike Ziller
55fa109b59 CMake build: Use version-less Qt targets
Since we do not support Qt < 5.15 anymore, and as a first step
for getting rid of our special FindQt5.cmake.

Change-Id: Icc5dbaf9b0a3a622b1f609ff114b9decb6d2856c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-01-05 10:13:16 +00:00
Eike Ziller
3f4c3a3db4 Merge remote-tracking branch 'origin/9.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/texteditor/texteditor.cpp

Change-Id: I9c8f1331be3f5442f1fd28aeb0a9bc07128629d1
2022-12-20 11:05:01 +01:00
Marcus Tillmanns
223bec26a1 LanguageServer: Add tooltip to file pattern
Change-Id: Ic404636bda45e9ff7ff3639232ebddfbfaf821c6
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>
2022-12-16 12:28:32 +00:00
David Schulz
5eeef19743 LanguageClient: resend rename request automatically on changes
Instead of asking the user to trigger the search again button before
being able to trigger the replace operation.

Change-Id: Ie2f0674255249b27d9435fc9df344e3f21bb886a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-16 09:12:01 +00:00
David Schulz
c8e1201236 LanguageClient: Do not send out invalid errors
An error is expected to contain an error message so add one that misses
one. Additionally assert when trying to set an error to a response that
is invalid (does not contain message or code.)

Fixes: QTCREATORBUG-28598
Fixes: QTCREATORBUG-27856
Change-Id: I0631433d847610531758d297a93a5c7cdfdc6c1d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-12-16 07:05:55 +00:00
David Schulz
2d0456f085 LSP: Support remote LSP file paths
Change-Id: If3cf1b8d675ef091427dbcd703c7d14b384a1b3a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-15 09:49:48 +00:00
David Schulz
6d8f6ab395 LanguageClient: robustify renaming symbols
Guard against using a symbol support from a deleted client. Additionally
cancel active replace operations and provide a sensible error message.

Change-Id: I92ca0038fa5f6acbb8369a48c4e8051adfadb30e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-08 14:27:29 +00:00
David Schulz
69ce2a4047 Editor: ensure something is selected after model update
Change-Id: I3fbf14cb7aa60caef43340302e74e80ed5e3ba4c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-12-08 06:16:33 +00:00
David Schulz
8c8f3e30b5 LanguageClient: Fix handling of defective language server
If the language server cannot be started, the client might be already in
an error state before the language server gets initialized.

Change-Id: Ib6c9df13b381e7854806714c07f4830796bb2cd3
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-12-07 10:58:31 +00:00
The Qt Project
b7e70592d6 Merge "Merge remote-tracking branch 'origin/9.0'" 2022-12-07 10:53:46 +00:00
Marcus Tillmanns
bd716a16bb languageclient: Write errors to log file
Helps the user to better understand why his language server might
have a problem.

Change-Id: I9440a28cb5d0d35808b497bcdcd545d7b10597a0
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-12-07 10:30:10 +00:00
Eike Ziller
b4fed03c27 Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/plugins/cppeditor/cppeditorplugin.cpp
	src/plugins/docker/dockerdevice.cpp

Change-Id: I41747ff9490e4ab20340d4d4acb4655100aaa3d2
2022-12-07 10:47:47 +01:00
David Schulz
69fef7480e LanguageClient: prevent nullptr access
Change-Id: Id0dc46d3775d5e765d1e7d2c2eac0d7f807f34ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-30 13:11:09 +00:00
David Schulz
0bd6d7a69f LanguageClient: move completion rerequest logic
...from the code assistant to the language client specific assist
implementation. This further reduces the complexity of the code
assistant.

Change-Id: I08ba5eecea826d3ccfe7f1f5a8791a085299d6ef
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-11-29 06:04:30 +00:00
David Schulz
fd17724597 LanguageClient: use reported rename placeholder
Using the reported range to create a usable placeholder if the
cursor ('|') is placed on the end of an identifier like in:

int global|;

Change-Id: I2ebacf3b9b54cff8f8887526479792374f67c881
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-11-21 11:47:52 +00:00
David Schulz
0e4b0a26d3 Editor: move ownership of assist interface to processor
This way the base class can manage the lifetime of the interface object
and it doesn't need to be done in each implementation of perform.

Change-Id: Ie1ce742e31b688a337533ee6c57d376146e25ace
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-11-17 13:23:55 +00:00
David Schulz
09ee528c40 Editor: unify assist processor handling
Define the run type of the processor by its implementation instead of a
enum value of the provider. The execution of a processor inside the
assist now follows a unified procedure.

Change-Id: Ibe9fab324c6072e77702c2663946d7a9f562a085
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-11-14 13:02:51 +00:00
David Schulz
b8a3f8d277 LanguageClient: fix compile
Change-Id: I090945ee1bd4e45983d6b5b4818d95682e0f428b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-11-11 10:47:41 +00:00
David Schulz
5eca1ff873 LanguageClient: use internal filtering if we got all completions
... at the current position. This reduces the amount of requested
completions.

Change-Id: I0fa35269bc123513217e3b3abd2c921bd92d8d10
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-11-11 10:11:33 +00:00
Eike Ziller
10dca6b37f Merge remote-tracking branch 'origin/9.0'
Change-Id: Ie069f3b2a1200b3e665341b1d56ce836024b0d29
2022-11-10 13:22:43 +01:00