Commit Graph

1581 Commits

Author SHA1 Message Date
Christian Kandeler
3c0c26f7b3 ClangCodeModel: Adapt to updated clangd tooltip format
The header file path is not the last line anymore;
see https://reviews.llvm.org/D146244.

Change-Id: Ifbc2b55c0a82c661454d487c287fe4fb5a950d38
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-04 08:53:57 +00:00
Jarek Kobus
36463f3c87 CppLocatorFilter: Don't repeat CppLocatorData arg in c'tors
It's always the same instance of:
CppEditor::CppModelManager::instance()->locatorData().

Change-Id: I7d8aa2da6f0055d91b519efb6ebdf2177794e0b7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-04 08:08:09 +00:00
Christian Kandeler
0319542937 ClangCodeModel: Do not try to rename macros and namespaces with clangd
Unfortunately, clangd refuses to rename macros and namespaces.
Fall back to our old two-stage "find + replace" approach for macros
(which clangd can find just fine) and employ the built-in code model for
namespaces (as they don't get indexed at all by clangd).

Change-Id: I08b1088ff4de9220427e089ef0700dbf2a944081
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-04 07:26:49 +00:00
hjk
305ccfe259 Utils: Replace FilePath::onDevice() by new FilePath::withMappedPath()
Basically a.onDevice(b) == b.withNewMappedPath(a), matching the order
of b.withNewPath(a).

Whether the (curretly docker-specific) path mapping is useful /there/, and
whether some of the calls are needed at all is dubious. I added some
FIXME and changed a few cases directly.

Change-Id: I7514736ce922f632f1f737bc496f6783389a42b6
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-04 06:56:55 +00:00
Eike Ziller
7fc0dcec0d Fix lots of tr.h files not being mentioned in CMakeLists.txt
Change-Id: I63d364ac50d9587339b10a5571870cb9a81c54ee
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-04-01 04:25:17 +00:00
Alessandro Portale
50a214de9e Qbs build system: Add a component for test files groups
Mainly in order to enforce a unified group name across QtC libraries and
plugins.

Change-Id: I6eafe0f9d227ec73d8c9029675866c67063768fb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-21 14:54:08 +00:00
Jarek Kobus
af84305f12 DocumentLocatorFilter: Make it more self-contained
Hide public DocumentLocatorFilter::updateCurrentClient()
method and remove
ClangdCurrentDocumentFilter::updateCurrentClient().
Connect DocumentLocatorFilter internally into a new
LanguageClientManager::clientInitialized() signal instead.

Change-Id: Ie74a112bda811525b7d226da1377e5624130e9ed
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-20 12:35:01 +00:00
Eike Ziller
0d8d4322b4 Merge remote-tracking branch 'origin/10.0'
Change-Id: Ie591b7130b33a042509e56701384f8ff4d9cb7f8
2023-03-16 11:57:01 +01:00
Jarek Kobus
6dc7bfb818 ClangGlobalSymbolFilter: Avoid custom prepareSearch() for aggregate
Delegate prepareSearch() directly to m_lspFilter aggregate
inside ClangGlobalSymbolFilter::prepareSearch().
This helps to keep filters' responsibilites more self-contained.

Disambiguate different overloads of
WorkspaceLocatorFilter::prepareSearch().

Change-Id: I98f25d01ad713a8c209a07bfd0d05b3ddcf16948
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-03-16 09:26:45 +00:00
Christian Kandeler
25f1a4804a ClangCodeModel: Consider concepts in semantic highlighting
We highlight concepts as types for now, as it's a pretty good fit. We can
always introduce a dedicated concept highlighting type later if there is
demand.

Task-number: QTCREATORBUG-28887
Change-Id: I405db5ca4351efd565b968e765fe8bca976a2800
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-03-14 13:03:02 +00:00
Jarek Kobus
5effb95ad9 ClangGlobalSymbolFilter: Don't remove duplicates prematurely
That's being done later, inside Core::Internal::runSearch().

Change-Id: Ib131aefdb39dbe2dfd457020ff13f1c453814597
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-13 15:22:52 +00:00
Eike Ziller
c7e94d80c7 Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/shared/qbs

Change-Id: I33e13270c8c15a51b4ce4eaa6b4584041ed124e0
2023-03-13 12:30:04 +01:00
Christian Kandeler
b63713a84f ClangCodeModel: Prefer clangd's switch header/source
It's more reliable than the built-in code model with non-trivial
directory layouts.

Fixes: QTCREATORBUG-28878
Change-Id: I02a058e7efb54e6af0998948a20d990e10293f03
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-10 12:55:26 +00:00
Jarek Kobus
d6f5d07639 ClangCodeModel: Use QtConcurrent invocation for async run
Change-Id: Id404d3a7699f12cdbc1e51390b3e5218ab3459b6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-03-09 11:21:33 +00:00
Jarek Kobus
6efecebb10 ILocatorFilter: Provide default implementation for accept()
Change-Id: Ide3c65ac78da60c9634b8f1c3009e947e8f1e2f3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-03 14:06:17 +00:00
Jarek Kobus
215f79f580 LocatorFilter classes: Use more linkForEditor
Limit the usage of ambiguous internalData.

Change-Id: Ice67884b9fb2ff303939cd5998c6e80453e82530
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-03-03 14:06:08 +00:00
David Schulz
fef8bc4bc4 ClangCodeModel: request symbol update in clangd locator filter
Change-Id: I60dfb4cfe8af9abf3bd40c2359c4414ac729cd65
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-03-02 12:49:51 +00:00
hjk
3e7d93c788 ProjectExplorer: Move some not-fully-session related bits
... out of SessionManager.

The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.

Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.

Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-01 09:26:50 +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
Eike Ziller
4e9309f923 Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/clangcodemodel/clangcodemodelplugin.cpp

Change-Id: Idb3d6e8fdfd278979f6180dc3795a2138bc2e61d
2023-02-16 12:47:32 +01:00
hjk
b30a74130f Clang*: Use new plugin test setup scheme
Change-Id: I636b93d74b4f9ab9ade28c46c6e84b461ccf34be
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-02-15 14:47:37 +00:00
Christian Kandeler
8257369b73 ClangCodeModel: Remove unneeded code
This was liblclang-specific.

Change-Id: I3fe8a8d2d49b1c7b92a54a90864e4ead7152e4ae
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-15 12:07:32 +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
Alessandro Portale
64aaf66c3b Proliferate Tr::tr in various places
This changes several tr() calls which were either missed during Tr::tr-
ization or were added later.

Found with regular expression: (?<!(Tr::)|([\w]))tr\(

Change-Id: I1c0c03589e941614a7a8449ecfebc7d2cad396c3
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:19 +00:00
Eike Ziller
2f5aed6c78 Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/clangcodemodel/clangdlocatorfilters.cpp

Change-Id: If91f26625ea9620fb9fdbf45705b32f37cb7f158
2023-02-10 10:43:06 +01:00
Christian Kandeler
bb9e492745 CppEditor: Prevent duplicate symbols in document-scope locator
If declaration and definition of a symbol are present, offer only the
definition, as in the function and class locators.

Fixes: QTCREATORBUG-13894
Change-Id: I6794607c4c45831df53b022bbdad9db7205a890b
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-02-09 12:44:31 +00:00
Marcus Tillmanns
4e34f1781e Clangd: Convert paths in diagnostic messages
Change-Id: I28844c803b9d71be3a7bb760ef89542265fb352b
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-02-09 12:01:07 +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
Jarek Kobus
86a14c8b27 ClangGlobalSymbolFilter: Avoid downcasting to WorkspaceLocatorFilter
Store a pointer to WorkspaceLocatorFilter instead of base
ILocatorFilter and avoid later downcast to WorkspaceLocatorFilter.

Change-Id: I729f60356b287f3b4bddf016e21761a372993928
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-02-09 08:53:44 +00:00
Christian Stenger
f5bd330277 Qbs: Update some qbs files
List respective tr files and while at it shuffle some
of the listed files to match common sort order.

Change-Id: I73845ad1dae5e8c86d3741067f40b7b2b37e2a6e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-02-08 14:37:03 +00:00
hjk
3f8240a7de TextEditor: Some fileName -> filePath renaming
Change-Id: Id0751f936666fa658226d62a1906b82e3bac1660
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-02-08 13:48:30 +00:00
Alessandro Portale
9db70d8810 Translations: Fix stray QApplication::translate() calls
For references to the module-own context, use Tr::tr().
For references to other modules, use the right context name (with "::"
prefix).

Change-Id: I6dce8f1ceccb23c44d93f1826402cd3be8e98e5a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-02-08 08:32:42 +00:00
David Schulz
fbcf0fb3bf ClangCodeModel: Fix initial processor state
It is expected that the processor that is created by the provider is not
running.

Fixes: QTCREATORBUG-28769
Change-Id: Icef270c5f9255b97aa04fc3d0ea0cf872787bd24
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-02-07 12:54:47 +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
David Schulz
2293488536 ClangCodeModel: prevent accessing nullptr
There is a certain amount of time between resetting the processor to
nullptr in ClangdFollowSymbol::VirtualFunctionAssistProcessor::cancel
and the destruction of the ClangdFollowSymbol sentinel. So we also need
to check the processor before calling update.

Task-number: QTCREATORBUG-28769
Change-Id: Idec7c9dd7648285ecf2360c309d9751303f6209c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-02-07 09:44:01 +00:00
Christian Kandeler
e771560ec7 ClangCodeModel: Do not traverse the AST in the semantic highlighter
... with clangd >= 17. We do not need to look at AST nodes anymore;
everything comes from the server.

Change-Id: I46eb91f26515e31b752020edbc32f1b23c1d79c7
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-03 14:07:56 +00:00
Christian Kandeler
d7308cc7a6 ClangCodeModel: Ignore built-in types
... in the semantic highlighter. The syntax highlighter already handles
these.

Change-Id: Ib1e80ec194021dbd2b4eca7a300db869ccddb7b0
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-03 10:59:41 +00:00
Christian Kandeler
7c6a00b4e7 ClangCodeModel: Ignore number literals
... in the semantic highlighter. The syntax highlighter already handles
these.

Change-Id: I26f6bca06c4fc648ffe59bd9e3639d81d2265755
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-03 09:33:55 +00:00
Christian Kandeler
c31522731c ClangCodeModel: Ignore boolean and pointer literals
... when doing semantic highlighting. The syntax highlighter already
handles these.

Change-Id: I048e033eda5b72d2e6eafaaccdb66040a00afe6a
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-02 13:36:16 +00:00
Christian Kandeler
209e3d0e66 CppEditor: Fully handle raw string literals in the syntax highlighter
As of a3af941adf, the built-in highlighter
can properly handle multi-line raw string literals, so we don't need to
abuse the semantic highlighter for this anymore.

Fixes: QTCREATORBUG-26693
Fixes: QTCREATORBUG-28284
Change-Id: If644767dfa8a97294e84a541eea44143e8d1bb88
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-02-02 09:52:55 +00:00
Christian Kandeler
be9a01252d ClangCodeModel: Make use of new semantic token in clangd
... for angle brackets.
See https://reviews.llvm.org/D139926.

Change-Id: I17be843005e290a8aec91573d9ed4bd0727e2dab
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-02-01 11:06:54 +00:00
David Schulz
739d4942e2 Merge remote-tracking branch 'origin/master' into 10.0
Change-Id: I9f6090e2a9f62fd3a9823f5a7342ea423dfbb2ac
2023-02-01 05:24:33 +00:00
Christian Kandeler
803ecca075 ClangCodeModel: Fix soft assert
Amends 0d909c353c.

Change-Id: Icb0c7245825fc7e8c4ce1ac3fae1bc585e857ace
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-30 11:57:39 +00:00
Eike Ziller
3724520499 Merge remote-tracking branch 'origin/master' into 10.0
Change-Id: I4dd2149e046d33b65e6d9c3497d0153f81fd3f31
2023-01-27 15:41:54 +01:00
Jarek Kobus
62e0b4052f Remove unneeded includes of utils/runextensions.h
BTW, spotted some other unused includes marked with yellow.

Change-Id: I364e4b6fae73a2be2cfd3a63c1100be4a91aa49a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-27 13:16:44 +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
hjk
3d32412271 ClangCodeModel: Remove unused files
Change-Id: Id9490ee1fcf16d16b6e675e9c5c09de47cb6dc09
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-01-23 14:34:54 +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