aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
| * CppEditor: Fix indentation with inline namespacesChristian Kandeler2024-02-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | After encountering the namespace keyword, we have to backtrack the state change introduced by the inline keyword. Fixes: QTCREATORBUG-22071 Change-Id: I543976622d1a56b2c61d68da6ec3eee8b6d0d5b3 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>
| * CppUseSelectionsUpdater: Ensure the old futures are synchronizedJarek Kobus2024-02-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | When scheduling a new async run (via FindUses::find()), keep track for the canceled futures, otherwise they may still be running after the shutdown. So, add all new futures into the future synchronizer (without canceling them). Task-number: QTCREATORBUG-30401 Change-Id: I83a82f706175060f7f29886b57c69c77667a0805 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>
| * SemanticHighlighter: Add internal FutureSynchronizerJarek Kobus2024-02-202-12/+7
| | | | | | | | | | | | | | | | | | | | | | As it's not clear whether canceled future may continue to run when the SemanticHighlighter instance is destructed, add internal FutureSynchronizer that ensures that all old, canceled futures are finished from the SemanticHighlighter's d'tor. Change-Id: I3128999f1250d666fcc3aa04599bb4a9c675ca3e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| * CppEditor: Do not access document manager when gathering local symbolsChristian Kandeler2024-02-2010-47/+77
| | | | | | | | | | | | | | | | | | | | As it turns out, that code runs in a dedicated thread. Task-number: QTCREATORBUG-30401 Change-Id: I66236fa00b8ddb55276d822357517fdccb0e61df Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * SemanticHighlighter: Simplify disconnecting from the watcherJarek Kobus2024-02-202-24/+6
| | | | | | | | | | Change-Id: I92c78f71a209ac428354284649e0f4b6522a947f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| * CppUseSelectionsUpdater: Don't delete the watcher from its signal handlerJarek Kobus2024-02-202-7/+5
| | | | | | | | | | | | | | | | | | | | Use std::unique_ptr instead, as QScopedPointer doesn't offer release(). Task-number: QTCREATORBUG-30401 Change-Id: If8f922fb52363a2e866cfacf770f617a00aa7fe5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * SemanticHighlighter: Don't delete the watcher from its signal handlerJarek Kobus2024-02-192-7/+7
| | | | | | | | | | | | | | | | Use std::unique_ptr instead, as QScopedPointer doesn't offer release(). Change-Id: I8e885e477d1aeb8ce9462e8fd249a5196424df18 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | CppEditor: Fix indentation of function call argumentsChristian Kandeler2024-02-261-1/+1
| | | | | | | | | | | | | | | | ... following an argument with an array subscript operator. Fixes: QTCREATORBUG-29225 Change-Id: Iba38043d94be718efee30ce50f5b55aac4ba6ecd Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | CppEditor: Refactor CppCodeModelSettingsChristian Kandeler2024-02-265-209/+123
| | | | | | | | | | | | | | | | Preparation for per-project settings. Change-Id: I78ecf0cde6150e40353c4aea6a98717d119f05c7 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | CppEditor: Un-export CppProjectUpdaterhjk2024-02-222-35/+23
| | | | | | | | | | | | | | Does not seem to be used outside. Change-Id: I9ed27e20ebb23ffd59b7f557b1ff56dbcadd6a2d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | CppEditor: Remove unused signalChristian Kandeler2024-02-221-1/+0
| | | | | | | | | | | | | | Amends 760cf632afddbdbc6cf1ded0655e8286ccbffd1f. Change-Id: I4b5b1c74549d293a3664825bee461c9a3cfbd342 Reviewed-by: David Schulz <david.schulz@qt.io>
* | CppEditor: Use Utils::Store in CppCodeModelSettingsChristian Kandeler2024-02-212-44/+53
| | | | | | | | | | | | | | Preparation for introducing a per-project variant. Change-Id: I40897f3ad5261e0d28e6c1332a6951f61f5e749b Reviewed-by: David Schulz <david.schulz@qt.io>
* | CppEditor: Do not store default values for code model settingsChristian Kandeler2024-02-212-43/+39
| | | | | | | | | | | | Change-Id: I707135c4256953457ca2f6a4abc3245e45d8b5eb Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | CppEditor: Make check for clangd more fine-grainedChristian Kandeler2024-02-218-13/+28
| | | | | | | | | | | | | | | | | | | | | | ... in the quickfix factories. We want to be able to offer or not offer certain quickfixes based on the current clangd version. Change-Id: I7dca69ff990ab9f1a691785cd72e633f7882ae3d 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-192-2/+1
|\| | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs Change-Id: I2a3d92a14e4dd16897d19f7d8a8c7b0ec30d14a5
| * CppEditor: Do not duplicate minimum clangd versionChristian Kandeler2024-02-161-1/+1
| | | | | | | | | | | | | | | | | | Amends 55161882900b459da6bc76e2d5c48e3c32ea4b34. Change-Id: I1de7249c06c0e262d0c36f980cc687f0e792f755 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>
| * Clangd: Fix version check to use (remote) executableMarcus Tillmanns2024-02-152-2/+1
| | | | | | | | | | | | Fixes: QTCREATORBUG-30374 Change-Id: I4a98a82ea24bb55a2ab3eed72f13d3d6f648df8a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | CppEditor: Add curly braces for more control statementsChristian Kandeler2024-02-154-46/+166
| | | | | | | | | | | | | | | | Fixes: QTCREATORBUG-24542 Change-Id: I3e0893e1c736730d94e2c9ab2baa0aa580393fe4 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-148-35/+64
|\| | | | | | | Change-Id: Iaf7373d449668bba57e53810858b58e2ec83dcc0
| * CppEditor: Re-add function decl/def switch handlerChristian Kandeler2024-02-131-0/+4
| | | | | | | | | | | | | | | | Was accidentally removed in 3771eb196b066314d427d7343cb1d4c6e2c5d6a4. Fixes: QTCREATORBUG-30363 Change-Id: Ifef1266b144d2eb5b7b69ff3e721f781b4455e96 Reviewed-by: hjk <hjk@qt.io>
| * CppEditor: Use a hidden friend to compare ↵hjk2024-02-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BaseEditorDocumentParser::Configuration Posh, and avoids an upcoming warning with C++20: /data/dev/creator/src/plugins/clangcodemodel/clangdclient.cpp:907:40: warning: C++20 says that these are ambiguous, even though the second is reversed: In file included from /data/dev/creator/src/plugins/clangcodemodel/clangdclient.h:6, from /data/dev/creator/src/plugins/clangcodemodel/clangdclient.cpp:4: /data/dev/creator/src/plugins/cppeditor/baseeditordocumentparser.h:37:14: note: candidate 1: 'bool CppEditor::BaseEditorDocumentParser::Configuration::operator==(const CppEditor::BaseEditorDocumentParser::Configuration&)' /data/dev/creator/src/plugins/cppeditor/baseeditordocumentparser.h:37:14: note: candidate 2: 'bool CppEditor::BaseEditorDocumentParser::Configuration::operator==(const CppEditor::BaseEditorDocumentParser::Configuration&)' (reversed) /data/dev/creator/src/plugins/cppeditor/baseeditordocumentparser.h:37:14: note: try making the operator a 'const' member function Change-Id: I98ed9d907b673b9353f540bab2ff7239e018b4f2 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| * CppEditorOutline: Remove unused methodJarek Kobus2024-02-082-8/+0
| | | | | | | | | | | | | | | | Remove also unused include and forward declaration. Change-Id: I67d9ea45bc1073653b17faa3433f132a5e43f924 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| * ModelManagerSupport: Remove unused PtrJarek Kobus2024-02-081-6/+0
| | | | | | | | | | | | Change-Id: Ibdc81d1c6fecb808cbd7ca91f56a4869b6e26dc1 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>