aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangtools
Commit message (Collapse)AuthorAgeFilesLines
* ClangTools: Fix icons in the DiagnosticsView context menuAlessandro Portale2020-07-091-3/+4
| | | | | | | | "Online" instead oof "info" Foreground-colored variant of the filter icon. Change-Id: I88cd824632de4152b4b9153403bd0512417d46dc Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangTools: Fix clazy output parsingChristian Kandeler2020-07-071-1/+1
| | | | | | | | | We must not paste stdout and stderr together, because if there is stderr output (as in some versions of clazy), then the trailing messages will make the JSON parsing fail. Change-Id: Ia31efdf3376eeb2e232b32bb0cdb543345e2dbfc Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Core/Utils: Migrate further to Utils::Idhjk2020-07-0610-17/+16
| | | | | | | | The coreplugin/id.h header is kept for downstream for now. Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66 (cherry picked from commit 430a33dcd9ac80ddb848e41f8f059102857c88aa) Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Clang Tools: Fix UI text capitalizationLeena Miettinen2020-07-031-1/+1
| | | | | Change-Id: I2466706699b82cdcd41e285aa68185eabd4bbb40 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangTools: Fix qbs buildChristian Kandeler2020-06-191-0/+1
| | | | | | | Amends 6e798401a0. Change-Id: I3e2225ec9e6145594479c8f7dfdd09f867d7ad02 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangTools: Use resource dir from tool instead of hard-coded oneNikolai Kosjar2020-06-194-10/+72
| | | | | | | | | | This makes it more likely that using other clang-tidy and clazy binaries than the ones shipped with Qt Creator will work. Done-with: Nikolai Kosjar Fixes: QTCREATORBUG-23672 Change-Id: I8c44e037ca8d50505fe10032034edaf4f408d52c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* All: Use Utils::SkipEmptyPartshjk2020-06-171-2/+3
| | | | | | Task-number: QTCREATORBUG-24098 Change-Id: Iab45de9a9c17ddc39a0e343b1175d4f6cb94b098 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Fix plugin unit tests when using projectsChristian Stenger2020-06-172-5/+17
| | | | | | | | | | | | | | The ClangTools and the AutoTest plugins use an internal mechanism to load and configure a project when performing their integrated unit tests. Both assumed to have exactly one kit present for these tests. Make it possible to have more kits present when starting with existing settings or if more kits get automatically generated when starting with clean settings. Change-Id: If2bc66320c4854f1d34a19d17107e8f0b7d64d39 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix clang warnings about copies in range-for constructsChristian Kandeler2020-06-151-1/+1
| | | | | Change-Id: If50553964483626e72a816b1d23fa81b45ed9ca7 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Various places: performance-for-range-copyAlessandro Portale2020-06-152-2/+2
| | | | | Change-Id: I475990d32a5211d31a77782667a2dfedba134137 Reviewed-by: hjk <hjk@qt.io>
* clang-tidy: Consider context when encountering duplicate filesChristian Kandeler2020-06-121-1/+10
| | | | | | | | | | | Prefer source files from contexts where we know that they actually get built and thus should have includes and compiler flags properly set up. Also fix the qmake and qbs project managers to not mislabel any non- application products as libraries. Fixes: QTCREATORBUG-23394 Change-Id: I0d122c7b58e12d14d68a1ca7337df83074299cd7 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* CMake build: remove dependency of ClangTools on libclangEike Ziller2020-06-081-2/+2
| | | | | | | Amends 9fc2fda07e0e777dd911ed424fb52b9ed4ab09e5 Change-Id: I0bec3d894eae0117a52e6363c1a92cca98cd05b2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge remote-tracking branch 'origin/4.12'Eike Ziller2020-06-031-1/+2
|\ | | | | | | Change-Id: Id1c063ae716c3acf5e6201c15663637040aa9a35
| * CppTools/ClangTools: Fix saving diagnostic configs for code modelNikolai Kosjar2020-05-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | As ClangDiagnosticConfig() has tidy and clazy enabled by default now, the ClangTools' importDiagnosticConfigsFromCodeModel() takes diagnostic configs on start up away from CppCodeModelSettings. Ensure that built-in configs do not have tidy/clazy enabled by default. Also, when importing, look at the actually enabled checks. Fixes: QTCREATORBUG-23717 Change-Id: Id8370ae2fff2392fc94aa957fd33c1954aff5594 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Use dialogParent() instead of mainWindow()Eike Ziller2020-06-021-2/+2
| | | | | | | | | | | | | | | | | | | | There are very few reasons to use mainWindow() directly. Especially for modal dialogs, using dialogParent() is important, since that guarantees the stacking order in case of other dialogs currently being open. Change-Id: I7ad2c23c5034b43195eb35cfe405932a7ea003e6 Reviewed-by: hjk <hjk@qt.io>
* | ClangTools: Work around clazy-standalone behavior fluctuationChristian Kandeler2020-05-271-2/+7
| | | | | | | | | | | | | | | | | | Some versions expect an argument after the -supported-checks-json option, and some don't. They are not easily identifiable, so we try both versions of the command line. Change-Id: I5b265e4ddd4a21c238228dafc60cbc09194f23cc Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | clang-tidy: Override "WarningsAsErrors" from config fileChristian Kandeler2020-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | If WarningsAsErrors is enabled in the config file, any issues that are found will make Qt Creator believe that clang-tidy has failed. So we never want this in our analyzing. Fixes: QTCREATORBUG-23423 Change-Id: I38f15588a9a02e25e0cf2f56c176c95639b97432 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | Merge remote-tracking branch 'origin/4.12'Eike Ziller2020-05-261-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri Change-Id: Ic39945a0e3e140a9467b4b4f572929257ff3a324
| * ClangTools: Fix referencing wrong counter for summary textNikolai Kosjar2020-05-221-1/+1
| | | | | | | | | | | | Fixes: QTCREATORBUG-23585 Change-Id: Icb3002434a728bd0d157190b7079b35bb639d0df Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ClangTools: Remove dependency to libclang and custom clang binaryNikolai Kosjar2020-05-1911-282/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, we've invoked a custom clang binary that had clazy statically compiled into it. The invocation also ensured that the diagnostics were serialized to a file, so that libclang could be used afterwards to read them. As the clazy-standalone executable supports exporting diagnostics to a YAML file now (just as clang-tidy) and Qt Creator ships it already, rely on that executable alone instead of the clang/libclang combo. While we do not depend on any clang header or library at build-time now, the CompilerOptionsBuilder constructor still needs the CLANG_VERSION and CLANG_RESOURCE_DIR pieces from llvm-config. This dependency should be removed as next. Change-Id: I4fa5753ab09008fd24bc5247b28c4836b5e8ca45 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: hjk <hjk@qt.io>
* | Merge remote-tracking branch 'origin/4.12'Eike Ziller2020-05-152-12/+20
|\| | | | | | | | | | | | | Conflicts: src/plugins/mcusupport/mcusupportsdk.cpp Change-Id: I1583fa81adc0218ad4657baa347c08e9e29f88e6
| * ClangTools: Fix crash when starting the analyzer againNikolai Kosjar2020-05-152-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Address a nullptr dereference of m_runWorker in ClangTool::updateForCurrentState() for the case described as (C2) below, reproducible with "./qtcreator -test ClangTools". Two use cases are connected to this: (C1) Run the analyzer twice with clearing app output pane in-between (C2) Run the analyzer twice without clearing app output pane in-between Relevant observations in this context are: (O1) Closing the app output pane destroys the RunControl/RunWorker. (O2) Running the analyzer a second time will first create a new RunControl/RunWorker, then destroy the old one. Now, the change ClangTools: Avoid accessing deleted run worker This reverts commit d02f5664e53df41ff7156eb46069e339479074d2. fixed a use-after-free-crash for (C1), but introduced a nullptr-deref-crash for (C2) as it resets m_runWorker to nullptr on RunControl destruction, which conflicts with the order mentioned in (O2). To fix both use cases, revert the mentioned change and access m_runWorker only when we know that it exists for sure - right after signal emission. Change-Id: I034f0905d635b15c0c6bbe499648b62d5a058c04 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * ClangTools: Fix placeholder in tr()Nikolai Kosjar2020-05-141-1/+1
| | | | | | | | | | Change-Id: I90727287ebdbe12b8e422e7e91adc9f3e5abafbd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | C++: Add tool button in editor for "Analyze File"Eike Ziller2020-05-156-35/+77
| | | | | | | | | | | | | | | | | | Adds a button for analyze file to all text editors that have a C++ source file open. Task-number: QTCREATORBUG-23348 Change-Id: If08f2969304ee0817f00c9ee5ff8c0d4f96f7f72 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | Merge remote-tracking branch 'origin/4.12'Eike Ziller2020-04-241-0/+3
|\| | | | | | | | | | | | | Conflicts: src/plugins/cmakeprojectmanager/cmakekitinformation.cpp Change-Id: I90ef0063ed24e23bcb3d73fff086f50324faa1e2
| * ClangTools: Avoid accessing deleted run workerChristian Stenger2020-04-241-0/+3
| | | | | | | | | | Change-Id: I74b977ede0d153ae4f8d85e03090dfc21facd04b Reviewed-by: hjk <hjk@qt.io>
* | Utils: Rename PathChooser::{f,setF}ileName() to {f,setF}ilePath()hjk2020-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | It's returning a FilePath, so it's a better fit. Keep the old versions as inline function now to ease downstream migration. Change-Id: I535887928018f42b92895c8b0c82527f0d55e5ca Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* | ClangTools: Add text marks for analyzer diagnosticsDavid Schulz2020-04-082-19/+70
| | | | | | | | | | | | | | | | | | | | Bring back the text marks with annotations for diagnostics generated by clang-tidy and clazy. They are visible as long as the file isn't modified. Task-number: QTCREATORBUG-23349 Change-Id: Idf6d01c67c1cc9d1e000a339441f9cf948cdc2b7 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Port QtCreator over to use filterRegularExpressionLars Knoll2020-04-011-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QSortFilterProxyModel::filterRegExp is going to go away in Qt6, so port over to use QRegularExpression instead. This required some changes where setFilterWildcard/FixedString() was being used, as those would instantiate QRegExp based filters in Qt 5, and will use QRegularExpression in Qt 6. Use the generic setFilterRegularExpression here, to keep things portable between 5 and 6. Change-Id: I6379be781aa3821b10ba783c088f82c1a0970911 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Merge remote-tracking branch 'origin/4.12'Eike Ziller2020-03-304-2/+19
|\| | | | | | | | | | | | | Conflicts: src/tools/qml2puppet/CMakeLists.txt Change-Id: Id6243b0f725a68075d789bf35e771113b742645b
| * ClangTools: Add "Analyze Current File" to Tools menu and context menuEike Ziller2020-03-304-2/+19
| | | | | | | | | | | | | | | | Add the action to "Tools > C++" and the C++ editor context menu. Task-number: QTCREATORBUG-23348 Change-Id: I650e4d10e07ba227c6f89ab660ce7fa81263172e Reviewed-by: David Schulz <david.schulz@qt.io>
* | Merge remote-tracking branch 'origin/4.12'Eike Ziller2020-03-161-1/+1
|\| | | | | | | | | | | | | Conflicts: src/plugins/baremetal/debugservers/uvsc/uvtargetdevicemodel.cpp Change-Id: I4a90920e52dbbe9eb46aef3437ee3c5a6e7b31c6
| * Clang Tools: Fix UI text capitalizationLeena Miettinen2020-03-111-1/+1
| | | | | | | | | | | | Task-number: QTCREATORBUG-23683 Change-Id: I81d6a0716fe04dabd6cb80010d5affec96a86ddf Reviewed-by: David Schulz <david.schulz@qt.io>
* | Merge remote-tracking branch 'origin/4.12'Eike Ziller2020-03-041-5/+3
|\| | | | | | | | | | | | | | | | | Conflicts: src/plugins/cmakeprojectmanager/tealeafreader.cpp src/plugins/cmakeprojectmanager/tealeafreader.h src/plugins/projectexplorer/miniprojecttargetselector.cpp Change-Id: I88d85be3903f57a55fddb7901e771a4822db1b85
| * Deduplicate elapsed time formattingAndre Hartmann2020-02-291-5/+3
| | | | | | | | | | | | | | | | While it's nice to see my code spreading, I still prefer to have it at one place. Change-Id: I7bdb13c47ed7e96227deeb14b0a8070aa40148de Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Merge remote-tracking branch 'origin/4.12'Eike Ziller2020-02-271-1/+1
|\| | | | | | | Change-Id: I4523ea36332772a310fd462df55683c93c61bb18
| * ProjectExplorer: Disentangle ProjectExplorer::updateRunActionshjk2020-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enforces a linear pass through [static] ProjectExplorerPlugin::updateRunActions ProjectExplorerPluginPrivate::doUpdateRunAction [emit] ProjectExplorerPluginPrivate::runActionsUpdated instead of the previous direct emission of the signal from user code and connecting also the internal update to it. This is meant to simplify reasoning about execution order and maybe to help elimimating double executation. Change-Id: Id8cc41a46d9dec06afb5514855f2ae80560f3695 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Introduce ToolChainKitAspect::{c,cxx}ToolChainhjk2020-02-194-9/+5
|/ | | | | | | | | Special accessors to the repeatedly used C and C++ cases to denoise and slim down user code. Plus some code cosmetics nearby. Change-Id: Iba4662bd4731d8c4256e658529f39d5c995691ce Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Provide an empty default IPlugin::extensionsInitialized()hjk2020-02-071-1/+0
| | | | | | | And remove all empy re-implementations. Change-Id: I19f0b4e55c042c96693ecb89766f97f0a97b54ae Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Add final specifies to classesIgor Sidorov2020-02-051-1/+1
| | | | | | | Warning -Wfinal-dtor-non-final-class in clang trunk Change-Id: I2bf17064bf8898eab10b82b69583a283157766d0 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangTools: Move OptionsPage to the usual placehjk2020-02-033-19/+22
| | | | | Change-Id: Ic70274a7066c1335ae0263f57d29b1c543b94ffe Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Adapt qbs build to doc changesChristian Kandeler2020-01-271-1/+1
| | | | | | | Amends 5fc456dd22. Change-Id: I342b82248ee84267613dd17583840d1c4daaaef3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Core: Introduce a IOptionsPage::setCategoryIconPathhjk2020-01-161-1/+1
| | | | | | | Less noise on the user side. Change-Id: I34dea09e8a3c8639f5a7db89b22f8b825b946395 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Make various Q_LOGGING_CATEGORY's staticAlessandro Portale2020-01-151-1/+1
| | | | | Change-Id: I43d3a198b0863d85a7fb305c7cb768f68acbd139 Reviewed-by: hjk <hjk@qt.io>
* Core: Provide empty implementation for IOptionPageWidget::finish()hjk2020-01-151-1/+0
| | | | | | | | Having it pure virtual only lead to a lot of unnecessary re-implementation. Change-Id: I37f71d1a160e21b93c7c73a6304b0eb6d5f0441d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangTools: Attach ClangToolsProjectSettings data to project itselfhjk2020-01-148-44/+24
| | | | | | | Easier to reason about life time. Change-Id: I2c61527532f6faa344fc59d858921e66daaf0b7e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangTools: Add help context menu entryNikolai Kosjar2020-01-139-7/+70
| | | | | | | ...that opens the documentation page for the current diagnostic. Change-Id: I398fdc82bb118a80536acbb12420a9bac84e66c9 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* ClangTools: Use new IOptionsPage convenience for ClangToolsOptionsPagehjk2020-01-093-24/+12
| | | | | Change-Id: Ied528676a6040f5b612cf965c539599a8c7b0bbf Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Utils: move text replacement helper to Utils::TextDavid Schulz2020-01-092-6/+6
| | | | | Change-Id: I82b3304f91d575369e74d5f7404c189e14ba4730 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangTools: Use Utils::InfoLabel in DiagnosticConfigsWidgetAlessandro Portale2020-01-033-70/+34
| | | | | | Task-number: QTCREATORBUG-23346 Change-Id: I5eeb40c50b55c4779ee3e4aa144274604f259f32 Reviewed-by: Cristian Adam <cristian.adam@qt.io>