aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangcodemodel/clangcodemodelplugin.cpp
Commit message (Collapse)AuthorAgeFilesLines
* TaskTree: Switch to qt-ified QtTaskTreeJarek Kobus2025-10-311-4/+4
| | | | | | | Remove the old Tasking lib. Change-Id: Iacb4939cc873e25d6039efae7dd23510a7baa5f9 Reviewed-by: hjk <hjk@qt.io>
* ClangCodeModel: Fix compilation db generator name getting out of syncChristian Kandeler2025-10-171-13/+15
| | | | | | Fixes: QTCREATORBUG-33633 Change-Id: Ic31e192706384aeb92eb73491e5cfab3ec92e7a0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangCodeModel: Use TaskTree for compilation DBJarek Kobus2025-08-191-38/+39
| | | | | Change-Id: I733947c2588338dd9c6ecfb33c2241f3496a2cfe Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* PE: Add convenience function for clearing and removing a TaskChristian Kandeler2025-07-181-4/+1
| | | | | Change-Id: I819cb6ae31bc6f83fffeb9f406108cc4a7b17025 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* PE: Add Task::Type value for triggering a pop-up of the issues paneChristian Kandeler2025-07-161-2/+1
| | | | | | | | Almost all occurrences of requestPopup() were following a call to addTask(). Change-Id: I9d87edd1ae4935d85cc3b9b0e8d53175e4f0f0b9 Reviewed-by: hjk <hjk@qt.io>
* ClangCodeModel: Create entry in issues paneChristian Kandeler2025-07-161-17/+18
| | | | | | | ... when interactively generating a compilation DB fails. Change-Id: I5e601154cd86afec5de20eee38b452609037af2b Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Improve UI text for project generatorsEike Ziller2025-05-161-4/+5
| | | | | | | | | | | These are listed in Build > Run Generator, so it doesn't really make sense to repeat the "Generate" in the display name for the menus. This is already the case for the generators coming from CMake (e.g. "Unix Makefiles (via CMake)") Change-Id: Ia4585d798754603356af1dac61705309e614c53f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* ProjectExplorer: Add convenience accessors to some classesChristian Kandeler2025-01-231-5/+5
| | | | | | | | | | | | Namely, Kit, BuildConfiguration, BuildSystem and RunConfiguration get functions to retrieve the active instance for a given project as well as the one for the current and active projects, respectively. This saves a ton of annoying null pointer checks. Some of these functions replace existing ones with the same purpose that were scattered around the code base. Change-Id: I18247061229bbeb8b8ad1e15a2bd7a6626438bc0 Reviewed-by: hjk <hjk@qt.io>
* ClangCodeModel: Move compilation database creation to CppEditorChristian Kandeler2024-09-021-6/+4
| | | | | | | | We'd like to re-use it elsewhere. Task-number: QTCREATORBUG-29529 Change-Id: Idafd53308218932f596d57ed5c8786720c6c0314 Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangUtils: Get rid of GenerateCompilationDbResult structJarek Kobus2024-05-271-5/+11
| | | | | | | | | | | | | | Replace it with expected_str<FilePath>. Check periodically for cancel request inside generateCompilationDB() body. Cancel the possibly running task on ClangCodeModelPlugin destruction. Handle the cancellation. Change-Id: I8bcb956bc03627b4a17a3510a76810e66c82815d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Also rename parameteraction.{h,cpp} to action.{h,cpp}hjk2024-01-291-1/+1
| | | | | | Change-Id: I203909d9b2d460012b9347d507ac7a701700c48a Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Rename ParameterAction into Actionhjk2024-01-291-1/+1
| | | | | | | | It became the defacto-type for action when ActionBuilder started creating them as default. Change-Id: I1008d60b78ea83919ce1c80a7ef828527fe9902c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangcodeModel: Move test creation closer to tested codehjk2024-01-241-10/+10
| | | | | | Change-Id: Ifb6771673aa8639d2ee23d1f34b1ff821000e348 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* ClangCodeModel: Use ActionBuilder for Generating Compilation DB actionhjk2024-01-221-10/+9
| | | | | Change-Id: I89d8345351cb6da26b7ae899066a7ddfdb17fe9c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangCodeModel: Move plugin class definition to .cpphjk2023-12-141-22/+44
| | | | | | Change-Id: I437ca5df1981b11809cbf52efe7aa9aacc1159d7 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Core: Rename ActionBuilder::setOn* to addOn*hjk2023-12-131-1/+1
| | | | | | | There could be multiple connections. Change-Id: I7dbca9d24599f776b7d1f1bfa11826e3eeb5640a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Core: Rename ActionBuilder::setContainer to addToContainerhjk2023-12-131-2/+2
| | | | | | | An action/command can be used in several places. Change-Id: Ifa26f64f7d200d93ada13f272de0fa833f886997 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangCodeModel: Use ActionBuilderhjk2023-11-161-13/+5
| | | | | Change-Id: I40cd7fc9eb346b0b70ea24f980846d175cfde3d4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangCodeModel: Fix capitalization of menu itemEike Ziller2023-11-141-2/+2
| | | | | | | | Amends d0203a39fa9ec63ee155d536151c39447e83e056 Change-Id: Ie7d63927907027dfddc579f66e6e9b1c51a10bd9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* ClangCodeModel: Add menu action to re-index filesVolodymyr Zibarov2023-11-031-0/+15
| | | | | | | | | | | | | | | | ... that depend on changed headers. When changing a header file the clangd code model is not updated for files that including it if they are not opened in editor. This is not to be done automatically, as it would be a performance hazard to rescan many files, for example when changing a widely used header. Add a menu action to trigger such re-indexing manually to solve the issue. Task-number: QTCREATORBUG-27387 Change-Id: Ia8033401f847627cee041b102f9ac6f3af3dd709 Reviewed-by: Volodymyr Zibarov <gogan419@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangCodeModel: Take changes from header files into account immediatelyChristian Kandeler2023-08-221-0/+1
| | | | | | | | ... in the dependent sources. That's also how the built-in code model behaves, but clangd itself only does this when a document is saved. Change-Id: I52d6badb0b7f063e5924c05dbf83a6e9849c9f6f Reviewed-by: David Schulz <david.schulz@qt.io>
* Tasks: Show tool tips with information about the categoriesEike Ziller2023-07-131-3/+4
| | | | | | | | When hovering an entry in the filter menu in the Issues view. Also remove some categories that shouldn't be there. Change-Id: Ifb367d69b9396c2fdc45b83ec5ffd88ac2f0eda7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppEditor: Make a few CppModelManager functions statichjk2023-07-121-4/+4
| | | | | | | ... to simplify code using it. Change-Id: Ib2bfbb5a17a1d48088a9cf4973d4c3f006cd34e4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Tasks: Create a container class for category dataEike Ziller2023-07-121-1/+1
| | | | | | | | Reduce the number of arguments that need to be passed around. Change-Id: I9fbfdcdf7b20f8f26e35f435bf8d65ba483e4114 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}Jarek Kobus2023-05-031-1/+1
| | | | | | | Follows AsyncTask -> Async rename. Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225 Reviewed-by: hjk <hjk@qt.io>
* ClangCodeModel: Use QtConcurrent invocation for async runJarek Kobus2023-03-091-2/+2
| | | | | Change-Id: Id404d3a7699f12cdbc1e51390b3e5218ab3459b6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Move some not-fully-session related bitshjk2023-03-011-9/+10
| | | | | | | | | | | | | | | ... 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>
* Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-02-161-24/+16
|\ | | | | | | | | | | | | Conflicts: src/plugins/clangcodemodel/clangcodemodelplugin.cpp Change-Id: Idb3d6e8fdfd278979f6180dc3795a2138bc2e61d
| * Clang*: Use new plugin test setup schemehjk2023-02-151-23/+15
| | | | | | | | | | Change-Id: I636b93d74b4f9ab9ade28c46c6e84b461ccf34be Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | ClangCodeModel: Remove unneeded codeChristian Kandeler2023-02-151-20/+0
|/ | | | | | | This was liblclang-specific. Change-Id: I3fe8a8d2d49b1c7b92a54a90864e4ead7152e4ae Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Use simpler Plugin::initialize() when feasiblehjk2023-01-201-6/+1
| | | | | Change-Id: I567965d266f20526bda9f823e31a04b354d53fb1 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangCodeModel: Tr::trhjk2023-01-191-37/+34
| | | | | Change-Id: I60aeadd38471cc65de250f66f0f09ba2931b3da2 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | 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>
* ProjectExplorer: Add "Generate" sub-menu to build menuChristian Kandeler2022-12-081-25/+28
| | | | | | | | Preparation for adding more generators. Task-number: QTCREATORBUG-28149 Change-Id: I4afa183a6fbd8ee88fc978b382f28cf9e52f09e9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangTools: Pass context object to lambda connectionsJarek Kobus2022-12-081-1/+1
| | | | | | | | | Remove some unneeded lambda () brackets. Change-Id: I502eb5cd89505fb77c02abf44b7ce19541a8ac2f 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>
* ClangCodeModel: Implement per-session mode for clangdChristian Kandeler2022-09-051-1/+1
| | | | | | | Fixes: QTCREATORBUG-26526 Change-Id: If9e018475b4e2f0557d9bf64ad9a7921c9dd6046 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* Clang/C++: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*Eike Ziller2022-08-291-2/+3
| | | | | | | | | | | | And instead of qgetenv. Takes Qt Creator's setting at "Environment > System > Environment" into account, which makes it easier on some platforms to set them (e.g. macOS), can be configured differently in different settings paths, and potentially can be changed at runtime (depending on usage). Change-Id: I7678b8e429b5eff79f87eb637f6f2131be43d904 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CppEditor: Clean up ModelManagerSupport creationChristian Kandeler2022-08-021-1/+3
| | | | | | | | No need for "providers" etc. Change-Id: I4ae9e8ecd6b3554711e002f233c13fd7758f01e4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ProjectExplorer: Remove unneeded #include in projectexplorer.hhjk2022-07-271-0/+1
| | | | | | | | | And fix side effects. Change-Id: Ib6f0c5618092f80204b409edec0a92004f2350d2 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Code cosmeticshjk2022-06-241-0/+1
| | | | | | | | | | Mostly unused #include's, also sort them or reduce scope. A few namespaces, ... Change-Id: I9ee71e07de7157c9942125672addf87dd41e78f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* ClangCodeModel: Move a test over from unittestChristian Kandeler2022-06-231-1/+2
| | | | | | Change-Id: Iac295216fff274fbe4a109477b1a4c2bd2c98d5d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangCodeModel: Do not dump compile_commands.json into project dirChristian Kandeler2022-06-151-3/+8
| | | | | | | | | | | We can't know if it's safe to put there; e.g. we might overwrite an existing one. Fixes: QTCREATORBUG-27573 Change-Id: I928408996759aaccb84332fcf95cf43d7f3bf083 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>
* Move clang diagnostics config settings to clangd settings pageChristian Kandeler2022-05-231-17/+3
| | | | | | | | | | | It was confusing to have both "Clang Code Model" and "clangd" project settings pages, so we merge them. Along the way, a lot of code dropped off. Change-Id: I780850b716195c3729403ae59f0794c11b5c556d 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>
* ClangCodeModel: Use Utils::runAsync instead of QtConcurrent::runEike Ziller2022-05-121-7/+7
| | | | | | | | | | That works the same with Qt 5 and Qt 6. This reverts commit c1fcaa28775240af47c62c479918d6f08e74617d. Change-Id: I603e50c793c2477454253a57bfe01eb25ecab6e3 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangCodeModel: Fix build with Qt 5.15Christian Kandeler2022-05-111-2/+2
| | | | | | | | | | Artificially lower the number of function parameters in generateCompilationDB(), to accommodate Qt5's QtConcurrent::run(). Change-Id: Ide88925deb443378b9308d924406ec6f6f90e8aa 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>
* ClangCodeModel: Use clangd's include pathChristian Kandeler2022-05-101-1/+2
| | | | | | | | | ... rather than the one from the LLVM that Qt Creator was compiled against. Task-number: QTCREATORBUG-27120 Change-Id: I4f211345ed547cd13f0b0774b99bc0f199a9cd44 Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Speed up compilation db generationChristian Kandeler2022-05-061-2/+4
| | | | | | | | | | | We needlessly re-evaluated the same compiler options again and again for all files in a project part. Now we only do the actual file-related work per file. Along the way, we dissolved some unneeded classes and made CompilerOptionsBuilder non- polymorphic. Change-Id: I9710d641a57032936cc0812515974dbc91676c8c Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Move fix-it tests into pluginChristian Kandeler2022-05-041-0/+2
| | | | | Change-Id: If53df602a42d8c1ffde5db6c8cb1e7fc269bb272 Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Remove libclang-based completion and function hintsChristian Kandeler2022-05-021-2/+0
| | | | | Change-Id: I742fb14b1aba3ba1f35a5c80bf553d2a735cac48 Reviewed-by: David Schulz <david.schulz@qt.io>