aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor
Commit message (Collapse)AuthorAgeFilesLines
* C++: Do not freeze Qt Creator while checking file sizesEike Ziller22 hours3-26/+41
| | | | | | | | | | | | | | Before actually indexing files, the C++ model checks the files against a file size limit (if set, which is the default). Do not iterate over all files and check their size in the main thread. If the files are on a device, this operation is not fast. Move the filtering to the parsing thread itself. Change-Id: I2202cc44c28f38159ca593db2399dde30f95f9bd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* CppEditor: Let users disable the built-in indexerChristian Kandeler5 days6-15/+204
| | | | | | Fixes: QTCREATORBUG-29147 Change-Id: Ib7e791362782f5b40c5678de95d2309a6396ccb9 Reviewed-by: David Schulz <david.schulz@qt.io>
* CPlusPlus: Support completion of list iteratorsChristian Stenger7 days1-0/+10
| | | | | | | Fixes: QTCREATORBUG-30608 Change-Id: I169efe675e13540ecc5fbbd6b15dd13d8522db7d Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppEditor: Adapt includes also when the including file was movedChristian Kandeler11 days4-17/+160
| | | | | | | Task-number: QTCREATORBUG-26545 Change-Id: Ica2d8c8504387f4ab15f0a974dfc1566d1fcaa91 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* ClangTools: Support inline suppression of diagnosticsChristian Kandeler2024-04-222-5/+25
| | | | | | | | | ... via clang-tidy's and clazy's respective code annotation features. Fixes: QTCREATORBUG-24847 Change-Id: I1b571e9e22caa3432d73940cb93d140e250b6a1c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* CppEditor: Remove some unneeded includes from cppcodemodelsettings.hChristian Kandeler2024-04-162-6/+5
| | | | | | Change-Id: I06bc37a100677c59488f5be3044462cda092640c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* CppEditor: Hide CppCodeModelProjectSettingsChristian Kandeler2024-04-163-26/+45
| | | | | | Change-Id: Ie0e10610e7428f94e487261d2ffbc1cc44011f36 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* CppEditor: Hide writable global instance of CppCodeModelSettingsChristian Kandeler2024-04-162-5/+6
| | | | | | Change-Id: I87300fc1bb7a9621ae4b41a93cdc8639500a5155 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Make "live update" of dependent sources opt-inChristian Kandeler2024-04-152-4/+27
| | | | | | | | | | | | | Not everyone wants to invest the extra computing resources needed for this feature. Amends b33b99e2d9e4c343f7427bcf1ccdf652e7575557. See 6d805195f6d35df932d666f86af026c051c785f8 for the original motivation. Task-number: QTCREATORBUG-29943 Change-Id: I4c8cce5bb58b34d930a409ea3e0995377c90d4ab Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* CppEditor: Simplify CppCodeModelSettingsChristian Kandeler2024-04-159-123/+101
| | | | | | | | We don't need the QObject wrapper. Change-Id: Ief0e1314db40cb403c56fe0e660c5dffa326f83c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* CppEditor: Move CppCodeModelSettingsPage alongside CppCodeModelSettingsChristian Kandeler2024-04-127-239/+202
| | | | | | | | | The colocation will enable various improvements that we intend to do in follow-up patches. Change-Id: I1624396b953c80c327b971977a5fd6095ad1b5c0 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* CppEditor: Move ClangdSettingsPage alongside ClangdSettingsChristian Kandeler2024-04-115-529/+546
| | | | | | Change-Id: Ib22438817ff3a14904decbb23f3c2288f355e378 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* TextEditor: remove text editor action handlerDavid Schulz2024-04-091-9/+8
| | | | | | | | | | Give each editor a context and register editor actions individually for that context. This removes the need to tell the action handler the current editor. Additionally all actions are now available in editor widgets outside of the EditorManager. Change-Id: I0109866b180889762f8bd8aa07874d8d7c55bfa6 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* CppEditor: Make renameIncludes() also work for moved filesChristian Kandeler2024-04-093-42/+87
| | | | | | | | Task-number: QTCREATORBUG-26545 Change-Id: I0bfe203af8f091562cdd91411dbe502fc5a76956 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>
* CppEditor: Move ClangdSettings into a dedicated set of filesChristian Kandeler2024-03-289-620/+660
| | | | | | | | | | They were originally put alongside the CppCodeModelSettings for simplicity, but there is no coupling (anymore?) between these two classes. Change-Id: Ic24df109b74a5b5c39de073c938c6de12f4aa319 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: handle syntax highlight in batchesDavid Schulz2024-03-256-27/+32
| | | | | | | | | | | | | | | | | Use an elapsed timer in the syntax highlighter to periodically return from the highlight and push a continue highlight to the end of the event loop. This allows the user to interact with the editor in between those batches. If the user modifies the document in between highlighting batches, the area that still needs a rehighlight is increased if needed. This also reverts 62ea85ee6ad15c8e4d9cb5e35b1f10bee3c49ac7 and the related changes. Task-number: QTCREATORBUG-28727 Change-Id: I7c394dbdff658330bb72f3b68b9928980947db75 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppEditor: Fix soft assert when serializing clangd settingChristian Kandeler2024-03-201-2/+1
| | | | | | | | | This was probably introduced by a merge commit. Change-Id: I5360b8fb25aa9cfbf8e6d3563b0219152a144815 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>
* CppEditor: Do not emit a signal when setting "categorize references"Christian Kandeler2024-03-201-3/+1
| | | | | | | | | | This is not an actual setting and should not result in a signal emission. Amends faa595e38b830690a79904df413376996f728bb6. Change-Id: Ic3816ca80090594659be66f5558ce52b921c0f02 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Clang: Use -isystem for system headersCristian Adam2024-03-192-11/+10
| | | | | | | | | | | | The project manager was passing correctly the system headers, but the compileroptionsbuilder was ignoring them by having UseSystemHeader::No. This change makes the project's view to be reflected in clangd's compile_commands.json. Fixes: QTCREATORBUG-30474 Change-Id: Ie3b80642e27ada4c8c8725f21e3cfbb2a4051aa0 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppEditor: Tell clangd about path to CUDAChristian Kandeler2024-03-191-1/+28
| | | | | | | | | | | | At the very least, this fixes an ugly warning message for .cu files. May or may not improve other things as well. Task-number: QTCREATORBUG-23113 Change-Id: If389fd67a153f7da13e5d4d465189aaef352c976 Reviewed-by: Cristian Adam <cristian.adam@qt.io> 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>
* CppEditor: Introduce per-project code model settingsChristian Kandeler2024-03-1515-54/+387
| | | | | | Change-Id: I325cc39e60d4b1f0fba1651502d772bfb9c6a91c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* CppEditor: Support try/catch in built-in indenterChristian Kandeler2024-03-152-0/+15
| | | | | | | Fixes: QTCREATORBUG-29452 Change-Id: Icf3d86a6080aeb741436800ae77af7c8bec3155c Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* LSP: Add type hierarchy supportChristian Kandeler2024-03-151-1/+1
| | | | | | | Fixes: QTCREATORBUG-28116 Change-Id: Ibaed23144f63fa84fa97ae9106d0f0baf8f53118 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* CppEditor: Consider all "else" branchesChristian Kandeler2024-03-142-3/+331
| | | | | | | | | ... in "Add braces to control statement" quickfix. Change-Id: Ie9dde7692e72300d350029cac01b712795c6e200 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>
* Merge remote-tracking branch 'origin/13.0'Eike Ziller2024-03-141-3/+3
|\ | | | | | | | | | | | | | | | | Conflicts: src/plugins/cmakeprojectmanager/cmaketool.cpp src/plugins/python/pythonutils.cpp src/plugins/qtsupport/baseqtversion.cpp Change-Id: Ia3e35c763ff9475d17ad922718b54152209893b8
| * CppEditor: Don't leak CppCodeStylePreferencesJarek Kobus2024-03-121-3/+3
| | | | | | | | | | Change-Id: I4414c69cebaeb429c5b6dfea6e6fa97b118e353e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | CppEditor: Code cosmetics in cppeditoroutline.cpphjk2024-03-131-29/+15
| | | | | | | | | | | | | | Mostly inlining and namepsaces. Change-Id: Ib5d22d40844d55ae029158d8cf3d694ecf2bc4c4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | TextEditor: Add type hierarchy infrastructureChristian Kandeler2024-03-125-54/+32
| | | | | | | | | | | | | | | | We want to support more than one back-end in the future. Task-number: QTCREATORBUG-28116 Change-Id: I72020c94b36072a297e13f44130e5e2482922cd4 Reviewed-by: David Schulz <david.schulz@qt.io>
* | CppEditor: Move some convenience functions to CppCodeModelSettings classChristian Kandeler2024-03-1212-59/+50
| | | | | | | | | | | | Change-Id: I0af8560c23374ce4f6c46f98d498d44f7cb50db3 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* | Merge "Merge remote-tracking branch 'origin/13.0'"The Qt Project2024-03-124-24/+34
|\ \
| * | Merge remote-tracking branch 'origin/13.0'Eike Ziller2024-03-124-24/+34
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/debugger/gdb/gdbsettings.cpp src/plugins/perfprofiler/perfprofilerruncontrol.cpp Change-Id: I0d5b914f9d9b5499920a5db484ef77af6ae748d5
| | * LanguageClient: improve clangd function hintDavid Schulz2024-03-113-21/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a Clangd specific function hint model that alwys highlights the current parameter based on the number of commas in front of the cursor position, like the builtin code model. It also correctly closes the proposal after typing the closing parenthesis. Fixes: QTCREATORBUG-26346 Fixes: QTCREATORBUG-30489 Change-Id: I09d3ac6856acfe5e0f206d8c3a96dbb561ea2ce7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| | * ClangFormat: Fix General tab is missingArtem Sokolovskii2024-03-071-3/+5
| | | | | | | | | | | | | | | | | | Fixes: QTCREATORBUG-30501 Change-Id: Ic1f09e513114acf6fb6ee52c8b5f066a2071e202 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | | CppEditor: Try to handle "declaration macros"Christian Kandeler2024-03-112-7/+27
|/ / | | | | | | | | | | | | | | Fixes: QTCREATORBUG-13640 Change-Id: I6566add09011388627c62394dfc3e47d29bac9cd Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | CppEditor: Refactor AddBracesToControlStatement quickfixChristian Kandeler2024-03-111-17/+17
| | | | | | | | | | | | | | | | | | Preparation for bracifying if-else chains. No functional changes. Change-Id: Idc101131c02aac88598a6de1f8f511f89c958346 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | CppEditor: Skip redundant check for large filesChristian Kandeler2024-03-111-3/+0
| | | | | | | | | | | | | | | | | | | | The only caller of refreshSourceFiles() is updateSourceFiles(), which already does the respective filtering. Amends 1960503ae994d14d79bad6507f2ed692e5c2230d. Change-Id: Ief7b2a728138c3693276edbd1912fa59cadaf4a6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* | CppEditor: Let users provide statement macrosChristian Kandeler2024-03-075-3/+36
| | | | | | | | | | | | | | | | | | Like ClangFormat has. Fixes: QTCREATORBUG-15069 Fixes: QTCREATORBUG-18789 Change-Id: I0ffb70be502d1c73aaaf436484ddc6704f152621 Reviewed-by: David Schulz <david.schulz@qt.io>
* | ClangTools: Put a clazy setting to its proper placeChristian Kandeler2024-03-072-17/+0
| | | | | | | | | | | | | | | | | | We do not go out of our way to retain the old settings value, as the setting affects only the UI behavior in the same widget it is displayed in. Change-Id: Ie0d66b3909364e15a05013eddaf742b161941f67 Reviewed-by: David Schulz <david.schulz@qt.io>
* | Merge remote-tracking branch 'origin/13.0'Eike Ziller2024-03-066-121/+86
|\| | | | | | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs src/plugins/cppeditor/cppcodemodelsettings.cpp src/plugins/cppeditor/cppcodemodelsettings.h Change-Id: I54937c39b06897a72a105e4e0a8b5f8a76c38e26
| * Cpp Editor: Fix serializing clangd settingsChristian Kandeler2024-03-042-86/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | A "store with default operation" makes no sense on the level of the map itself, as it does not have knowledge about the current on-disk settings. This reverts commit a4fbc5f00dddde39871c25bca652de7842baa1dd. Change-Id: I008b0b5c24428c71182dac5d1f151d25cf4f7467 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> 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>
| * CppEditor: Mark two tests as incompatible with ClangFormatChristian Kandeler2024-02-294-8/+21
| | | | | | | | | | | | Change-Id: I95771a3f7fb78d0b7700dc52fdbe7c1e17d00f74 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * CppEditor: Make two test cases ClangFormat-compatibleChristian Kandeler2024-02-291-6/+10
| | | | | | | | | | | | | | Change-Id: I5e9df40de3e13f0941c0f8c14385de43e828b5d2 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/13.0'Eike Ziller2024-02-293-23/+23
|\| | | | | | | | | | | | | Conflicts: src/plugins/android/androidsettingswidget.cpp Change-Id: Ifcb16aa16c7bc2792de25d0ee7a22cf0e39a05f8
| * CppEditor: Mark some tests as XFAIL when running with clangdChristian Kandeler2024-02-281-0/+7
| | | | | | | | | | | | | | | | These are fuzzy decl/def switches, where clangd does not fail, but returns the original location. Change-Id: I86814c2dc5e1b8ec9085fd1486c0120e2f98a3b6 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * CppEditor: Fix running tests with clangdChristian Kandeler2024-02-281-1/+3
| | | | | | | | | | | | | | | | | | | | Try harder to find a suitable kit: - Pick one without warnings. - Pick one with a Qt, as otherwise configureAsExampleProject() will fail. Change-Id: I5a38e86bd81840c6794de365980618c904936d3a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * TextEditor: Fix folding for async syntax highlighterArtem Sokolovskii2024-02-282-22/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Made restoreState, ensureBlockIsUnfolded, fold, unfold and unfoldAll functions to be called only after highlighting is done - Improved management of foldValidator in async case - Removed optimizations in cpphighlighter and glshighlighter. The highlighters are async now and optimization is not necessary. In these optimizations in the function highlightBlock the highlighting changes not only for currentBlock but and for several next. Which is contradict with the function name. Change-Id: Ib413e6b982eb39d52f36c3066ff0fa8c28fbe231 Reviewed-by: David Schulz <david.schulz@qt.io>
* | Utils: Fix build with MSVC with C++20Eike Ziller2024-02-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename process.h back to qtcprocess.h MSVC's "threads" standard header includes <process.h>, and that ends up including our process.h from Utils. There already was a hacky workaround in place for a similar issue with MINGW, but that doesn't work with MSVC because that doesn't have Simply use a name that doesn't conflict. Change-Id: I1159cd2096b4f2dbc4a1728d0131dd6edd30ebd3 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>
* | Merge remote-tracking branch 'origin/13.0'Eike Ziller2024-02-2716-99/+113
|\| | | | | | | Change-Id: If752e3383b35873b696e8beca27d8838a4096c8a
| * FunctionDeclDefLinkFinder: Ensure the old futures are synchronizedJarek Kobus2024-02-231-2/+7
| | | | | | | | | | Change-Id: I68b271f85d2bb319230529d4b0b074c05c12ba4c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| * FunctionDeclDefLinkFinder: Don't delete the watcher from its signal handlerJarek Kobus2024-02-232-7/+6
| | | | | | | | | | | | | | Use std::unique_ptr instead, as QScopedPointer doesn't offer release(). Change-Id: Ifbe42dca5b266930e1000a50441995023b89b802 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>