Commit Graph

1581 Commits

Author SHA1 Message Date
Christian Kandeler
ba35a64d93 ClangCodeModel: Remove dead code
None of this had any affect after switching to clangd.

Change-Id: I806682fecff84bf6eb0b0eb382e096fc9a25fa3d
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-07-07 14:09:50 +00:00
Christian Kandeler
d0a34587ac ClangCodeModel: Fix suppressing warnings via textmark tooltip
This functionality was never properly converted when we switched to
clangd.

Fixes: QTCREATORBUG-29385
Change-Id: Ie06c9ec8bbed6a539ce9f9bf5ba512ae1a7f4b98
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-07-07 08:01:26 +00:00
Eike Ziller
a490625394 Merge remote-tracking branch 'origin/11.0'
Change-Id: Ie4b1f249d1a5b7835022f367ee6b1c8a3c953f0b
2023-07-04 12:57:47 +02:00
Christian Kandeler
20cb9b6e69 ClangCodeModel: Do not call FilePath::exists() on random strings
Fixes: QTCREATORBUG-29356
Change-Id: I6f4d89a6823829a7ecf16200786621321fea61a5
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-07-04 08:36:40 +00:00
Eike Ziller
26e96bfad8 Merge remote-tracking branch 'origin/11.0'
Conflicts:
	src/plugins/debugger/debuggeritemmanager.cpp

Change-Id: I9d99d13feff9315f52eacbd84857c63cb69bf804
2023-07-03 10:24:09 +02:00
David Schulz
520264999a ClangCodeModel: fix crash on followSymbol
Big files are loaded in chunks inside a QEventLoop. If follow symbol is
triggered via mouse and opens such a big file and the mouse is moved
while loading that file ClangdFollowSymbol got deleted while opening the
file in ClangdClient::followSymbol. Instead of the hard deletion just
cancel that follow symbol operation and make sure done is emitted
afterwards. The handling of that done signal takes care of the deletion
of that follow symbol operation.

Change-Id: Iba4ad6abb541186c2f26506f82fe1bc582818fca
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-06-28 12:33:51 +00:00
Eike Ziller
0f9b118776 Merge remote-tracking branch 'origin/11.0'
Change-Id: Ib798dc9922c01b7667388ca03d3a248610f73028
2023-06-20 10:36:06 +02:00
Christian Kandeler
7b8117ba2f TextEditor: Add dedicated text style for C++ concepts
Fixes: QTCREATORBUG-29286
Change-Id: Ifc89bad0b84dfdbcac0720fc59799edd461c00bb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-06-20 08:15:50 +00:00
Eike Ziller
6c601b8cd4 Merge remote-tracking branch 'origin/11.0'
Change-Id: I8d1c9720a868da02b3157a48954eb4e262539c84
2023-06-15 09:48:58 +02:00
David Schulz
3c2d545230 LanguageClient: improve the performance of creating text marks
If we already know the document for a text mark we can save the lookup
in the documentModel. This improves the performance for the text mark
creation on windows by around 10%.

Change-Id: Iecf9cb2e9114ed026f5e354e75d279b54c0ce51d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-14 12:56:36 +00:00
Eike Ziller
375db16ac4 Merge remote-tracking branch 'origin/11.0'
Change-Id: I87b22a73427cf9fc1b96075dc0db769ed3d3621c
2023-06-09 11:24:29 +02:00
Christian Kandeler
f0a1591035 ClangCodeModel: Adapt to new "inactiveRegions" notification in clangd
See https://reviews.llvm.org/D143974.

Change-Id: Iff6cc39f7c567feee1953fde1ca96a9aefec75d4
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-06-08 11:06:15 +00:00
Christian Kandeler
6500a250fc ClangCodeModel: Suppress more clang warnings about unknown arguments
E.g. some instances of drv_unknown_argument have now become
drv_unknown_opt_for_target.

Change-Id: I5df7f25c4efcaaa38ac0d9ffcd53f3467798a604
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-06-08 08:30:06 +00:00
Christian Kandeler
8e75381fce CppEditor: Give C++ file name settings a per-project variant
Fixes: QTCREATORBUG-22033
Change-Id: If37517bb091438e70c5af5102bf833ed46d0c951
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-06-08 08:23:01 +00:00
hjk
19a6428f54 More deprecation induced busywork
QString::count() will vanish.

Change-Id: I65672fa648c0969930e9398ec4e541a0771c8a57
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-08 07:00:01 +00:00
Christian Kandeler
24df1f1183 ClangCodeModel: Support new clangd semantic token for labels
See https://reviews.llvm.org/D143260.

Task-number: QTCREATORBUG-27338
Change-Id: I26eb3688f311d93c966901a6639931fec944dd49
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-06-07 14:00:37 +00:00
Christian Kandeler
0a1073f7cd ClangCodeModel: Restart clangd on changes in VCS repository
This should prevent the index from becoming stale after e.g. a git
checkout.

Change-Id: I94d364d3f2ec38889564c7859ca95ccb2de3019d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-06-06 09:18:12 +00:00
David Schulz
270972c7bb ClangCodeModel: report highlight results in one batch again
... with Qt 6.6

Change-Id: Ic3ebb5cee4deeebf87a0d8e0ab33bcdc1c92c3a2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-06-02 05:37:50 +00:00
Eike Ziller
edd1a89807 Move SessionManager to Core plugin
Sessions are independent from projects, and this allows for removal of
e.g. the dependency from Bookmarks to ProjectExplorer.

Includes moving the command line arguments (-lastsession, <session>) to
Core plugin.

Change-Id: I6c578fd15c4990902e7196501de20f39376e90e8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-05-25 11:15:41 +00:00
David Schulz
9bb126c0d6 Utils: make column of convertPosition 0-based to merge it into Position
Change-Id: I239b3cb33b8ad59ac4097c919155ab5ca7d57b8e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-24 11:53:28 +00:00
Christian Kandeler
aa5ddaf412 ClangCodeModel: Let user decide how to do the header/source switch
While clangd's AST matching can find source files at any location, it also
has a number of annoying bugs that break the functionality for some
users. This patch brings back the previous "try built-in first" logic, but
also lets users choose their preferred backend.

Task-number: QTCREATORBUG-29175
Change-Id: I6b854ed05652e6468509e5748a83a8f9bf76fc20
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-17 13:52:40 +00:00
Jarek Kobus
4195b4e7e2 ILocatorFilter: Remove calls to setDefaultIncludedByDefault(false)
By default, setDefaultIncludedByDefault() is set to false, so
no need to repeat it now in direct subclasses.
Leave it only inside the AllProjectFilesFilter,
as the DirectoryFilter superclass sets it to true.

Change-Id: Ib66d112a3bfeed52315663f6898148cf5c5d88b1
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-05-16 08:34:02 +00:00
Jarek Kobus
7d87233c9c ClangCodeModel: Remove the old matchesFor() implementation
Rename some filter classes to conform to the names for cpp filters.
Remove some unneeded intermediate classes now.

Change-Id: Ib4fa295fa60da61c42c792556751d954ddb936e7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-11 10:24:08 +00:00
Jarek Kobus
c879aeb565 SearchResultItem: Introduce SearchResultItems
And reuse it.

Change-Id: Ia052297340f2bf2478fbfdb2427b45e30bd9d067
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-08 06:41:41 +00:00
Jarek Kobus
8b3aa900da Utils: Move SearchResultItem/Color into Utils
It's going to be reused inside FileSearch.

Change-Id: I8993d7158ff31c311c2283d32bc43465a8946a52
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-05-08 06:41:27 +00:00
Jarek Kobus
b3a595fcfe Tasking::CurrentDocumentSymbolsRequest: Rename
CurrentDocumentSymbolsRequest -> CurrentDocumentSymbolsRequestTask
CurrentDocumentSymbolsRequestTask -> CurrentDocumentSymbolsRequest
currentdocumentsymbolsrequesttask.{cpp,h}
-> currentdocumentsymbolsrequest.{cpp,h}

Task-number: QTCREATORBUG-29102
Change-Id: I5a0b0edf67babf6880682a30a2fd973f849b1880
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-05-04 05:11:27 +00:00
Jarek Kobus
a3a5b8f806 Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}
Follows AsyncTask -> Async rename.

Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 13:24:20 +00:00
Jarek Kobus
187a7640de Tasking::Async: Rename Async into AsyncTask
Rename Utils::AsyncTask into Utils::Async.
Rename AsyncTaskBase into AsyncTask.

Task-number: QTCREATORBUG-29102
Change-Id: I3aa24d84138c19922d4f61b1c9cf15bc8989f60e
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 12:47:28 +00:00
Jarek Kobus
eb41e98b00 ClangCodeModel: Reimplement matchers()
Change-Id: I2d541e24347aa47ec41f88cd7d18004dee7197cf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-26 12:05:23 +00:00
Jarek Kobus
070bfe9387 FutureSynchronizer: Change the default value of cancelOnWait to true
The "false" default wasn't really useful.

This changes the default value to the following usages:

1. AndroidDeployQtStep
   Introduced in 91f136ef3a
   The synchronizer was used to cancel the running tasks inside
   the doCancel(), so the similar behavior should be expected
   when destructing the AndroidDeployQtStep.

2. GitClient
   Introduced in f3106ebafe
   Is used only inside the last line of
   GitSubmitEditor::updateFileModel(). The running function
   (CommitDataFetchResult::fetch) doesn't take QPromise<>,
   so it can't detect if the future was canceled or not.
   In this case this change is no-op.

3. ExtraCompiler
   Introduced in c99ce1f455
   The intention was to make it cancellable and finish
   early on cancel.

4. PluginManager global future synchronizer
   Introduced in 72bddf9f51
   The intention was to make it cancellable and finish
   early on cancel.

The relevant places in code are marked explicitly for
points: 1, 2 and 3.

Change-Id: I1a52deb8d1f81d355950c8772bbaa6d0a202fd7e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-26 08:17:27 +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
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
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
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
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
Jarek Kobus
38d4f3fef3 LocatorFilter: Introduce LocatorMatcherTasks
Change-Id: I775c88b8ac7d7bb0719a6b20d1e5171dbd62a94d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-21 06:45:28 +00:00
Jarek Kobus
c09951d1b7 LocatorFilterEntry: Get rid of filter field
Remove also c'tor taking a pointer to filter.

Change-Id: Ic0fe62daeb6e79a729bee24d07d7eb77559e19c4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-20 13:46:03 +00:00
Jarek Kobus
74322dfedf LocatorFilterEntry: Get rid of internalData
Change-Id: I2bcd64c39bdaf0fe8504b68ba4aaaef7cdcab475
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-04-20 12:14:02 +00:00
Jarek Kobus
99b5d93cfb LocatorMatcher: Introduce MatcherType enum
Use it for registering/getting different kinds of matchers.

Change-Id: I6f944e0332bf8c512892a00b8ba88f9939f34682
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-20 09:18:11 +00:00
Jarek Kobus
0c3789726d LocatorMatcher: Introduce LocatorMatcherTaskCreator
Register cpp and lsp matchers for all symbols,
classes and functions.

Change-Id: Id85c8164077ec395dac7e6ff45acc89db9e6ae08
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-18 11:40:16 +00:00
Eike Ziller
5adb656550 Show locator filter descriptions more prominently
- Sort items in the menu.
- Disable items for disabled filters.
- Show a tool tip when hovering over the magnifying glass menu.
- Add descriptions to all filters and make them more consistent.

Change-Id: Ic03e303c50422f9de5dd3c512fe32bbdc958d2ba
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-18 11:19:17 +00:00
Jarek Kobus
ed120516f6 DocumentLocatorFilter: Get rid of the arg from c'tor
It's always LanguageClientManager::instance().
Pimpl LanguageClientManager's filters, so that they are
constructed after the managerInstance is being assigned.

Change-Id: Ib1f6f0c96d57d0e4cb7332ce322f6c4e9ef9fdb1
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-18 09:03:14 +00:00
Eike Ziller
2bc37de42b Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/python/pipsupport.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/qtsupport/examplesparser.cpp
	tests/auto/examples/tst_examples.cpp

Change-Id: I00273622423fa99d41621969f6ecbbdaa0e18664
2023-04-13 15:59:08 +02:00
Christian Kandeler
4028777743 ClangTools: Prefer .clang-tidy file by default
... and move this setting outside the diagnostic config.

Fixes: QTCREATORBUG-28852
Change-Id: Ie3b19ba7bec2bc96451f3216fa06a6941cad4c94
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-04-13 11:52:04 +00:00
Christian Kandeler
02f2a93503 ClangCodeModel: Let clangd handle cuda sources
Fixes: QTCREATORBUG-28984
Change-Id: I7fbf5a671ff6f1d1ecd928d9be1f619dc32563a9
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-04-13 11:35:22 +00:00
Christian Kandeler
f67f02066c ClangCodeModel: Classify Q_PROPERTY functions as Qt-invokable
Fixes: QTCREATORBUG-28971
Change-Id: Ia60a82aa83ad89fbf6b5d1332d413de029510b34
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-04-13 09:19:12 +00:00
Jarek Kobus
e22d79fbb5 ClangModelManagerSupport: Drop namespace scopes
Change-Id: Id8d9474a35e367469b435d10b3eba0700dffc304
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-04-05 10:48:54 +00:00
Jarek Kobus
3108892c5c DocumentLocatorFilter: Refactor internals
Avoid use of LocatorFilterEntry::internalData inside
LspCurrentDocumentFilter.

Change-Id: I5eb4831919281ab11a630bf7810890a72a1423bb
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-05 08:00:35 +00:00
David Schulz
4d688c932b Clangd: do not modify the default replacement string
Fixes: QTCREATORBUG-28321
Fixes: QTCREATORBUG-28910
Change-Id: I4cfaf5ea3916a0ecbf0b0bae4d0c231513671c73
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-04-04 08:55:15 +00:00