summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools
Commit message (Collapse)AuthorAgeFilesLines
* Merge CppTools into CppEditorChristian Kandeler2021-09-01226-55291/+0
| | | | | | | | | | | | | | | | There was no proper separation of responsibilities between these plugins. In particular, CppTools had lots of editor-related functionality, so it's not clear why it was separated out in the first place. In fact, for a lot of code, it seemed quite arbitrary where it was put (just one example: switchHeaderSource() was in CppTools, wheras switchDeclarationDefinition() was in CppEditor). Merging the plugins will enable us to get rid of various convoluted pseudo-abstractions that were only introduced to keep up the artificial separation. Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Add convenience functions for creating ProjectExplorer::HeaderPathsChristian Kandeler2021-08-308-63/+44
| | | | | Change-Id: I7b1f63caca6b70ba4ec1b1870b83cbf20aa6564a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppTools/CppEditor: Rename the TestDocument classesChristian Kandeler2021-08-303-19/+20
| | | | | | | | | It was not helpful that we had four different classes with the same name. Note that they look suspiciously similar and could possibly be merged into a single class at some point. Change-Id: I7d4c10a09408226037bc0d276940bca39dc5f576 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppTools: Use only const pointers for ProjectInfo and ProjectPartChristian Kandeler2021-08-2730-165/+173
| | | | | | | | All members were already const, but this makes it clear at all points of use that these data structures are immutable. Change-Id: Iea615c090bde462c445d15223caccc561b0c713d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* CppTools: Replace a QMutex with a QReadWriteLockChristian Kandeler2021-08-271-18/+21
| | | | | | | ... in CppModelManager. Not all accesses are mutually exclusive. Change-Id: I87fb50db35c5fdfa401f08ad221ca053911eac07 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Merge remote-tracking branch 'origin/5.0'Eike Ziller2021-08-262-4/+19
|\ | | | | | | | | | | | | | | Conflicts: qbs/modules/qtc/qtc.qbs src/plugins/android/androidconfigurations.cpp Change-Id: If8dc2cdf131811e08ca147c6f58dbb3ed3bf7227
| * CppTools: Code model fix for C++20, MSVC, and newer CMake versionsCristian Adam2021-08-202-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | Starting with version 3.20 CMake adds -std:c++20, which breaks the code model when using MSVC. Clang-cl 12 doesn't know about -std:c++20, but clang driver knows about -std=c++20. Fixes: QTCREATORBUG-26146 Change-Id: I696842e11b0a9ba8849455d2f81f8dde6dd95a27 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* | CppTools: Use test objects to group related test functionsChristian Kandeler2021-08-2635-539/+1131
| | | | | | | | | | Change-Id: I9ed2ad222579f49c20c75a53c862bb7251cff28d Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Utils: Rename FilePath::normalizePathName to normalizedPathNamehjk2021-08-231-1/+1
| | | | | | | | | | Change-Id: Idf5faab1cf55d6f7cca493c8ad451825310f5d66 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* | CppTools: Make sure there's only one C++ parsing thread per projectChristian Kandeler2021-08-232-50/+63
| | | | | | | | | | | | | | | | | | | | | | | | Switching back and forth between targets or build configurations could result in an arbitrary amount of C++ parser threads running at the same time, wasting valuable resources. We now cancel a currently running parser thread when starting a new one for the same project. Fixes: QTCREATORBUG-24890 Change-Id: Ie1afc4971515fcad01dae182578fd77daa642cec Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | CppTools: Remove unused additional indexing support objectChristian Kandeler2021-08-233-38/+2
| | | | | | | | | | | | | | Its presence is confusing. Change-Id: I61986e970e0f58cded5b97dae2cd28abcdb3ecff Reviewed-by: hjk <hjk@qt.io>
* | CppTools: Some code cosmeticshjk2021-08-202-31/+30
| | | | | | | | | | | | | | Namespaces, foreach. Change-Id: I0129ee1ed1f5d1625869e8b5cb6173e3f71166e1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Use more FileUtils based file dialogshjk2021-08-191-11/+13
| | | | | | | | | | Change-Id: I1e7ec0493c26afe58e17afb8923a2b1023f6dcd4 Reviewed-by: David Schulz <david.schulz@qt.io>
* | Use new FilePath::setPermissions in a few caseshjk2021-08-191-9/+8
| | | | | | | | | | Change-Id: Ic7122c86c273a87134ea8cd1a00b1bbdf5035971 Reviewed-by: David Schulz <david.schulz@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.0'"The Qt Project2021-08-183-8/+11
|\ \
| * \ Merge remote-tracking branch 'origin/5.0'Eike Ziller2021-08-183-8/+11
| |\ \ | | |/ | | | | | | | | | | | | | | | Conflicts: src/plugins/autotest/testresultdelegate.cpp Change-Id: If172206f231fc2a9f4a672cd2e6eaeaea4988c96
| | * CppTools: Fix indentation of plain stringsOrgad Shaneh2021-08-183-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Raw strings should not be indented, but old-style strings still should. Amends commit ddf7f5f232d70c8598654fdad08af3064f95903f. Fixes: QTCREATORBUG-25817 Change-Id: I7836388efb2d19b8b898c7463c7fa2d2077e80b2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | | ClangTools/CppTools: Code cosmeticshjk2021-08-182-50/+43
|/ / | | | | | | | | | | | | Mostly namespaces. Change-Id: Ife8bbcb128344cf56d444da8f9d76b1204b9fe34 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | ClangTools: Proliferate use of FilePathhjk2021-08-185-14/+18
| | | | | | | | | | Change-Id: I3eb16546a729ab01c10e37572adac9aef83f5cd4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Utils: Introduce a FilePath constructor from char arrayshjk2021-08-176-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for decorations in user code. At the same time, drop some convenience constructors and functions in CommandLine and Icon essentially serving the same purpose. Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | CppTools: Fix testsChristian Kandeler2021-08-162-5/+6
| | | | | | | | | | | | | | | | | | | | - Prevent invalid access to temporary. - Fix typo. - Use accidentally unused class member. Amends 33108795d6. Change-Id: I2cc91e294fb4be7f4e20b383171b06a39f53c99c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | clangd: add setting for document update timeoutDavid Schulz2021-08-163-2/+24
| | | | | | | | | | Change-Id: I4fae2cdff022f6f29566c0316a8ade51d3482466 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | CppTools: Turn some classes into pure value typesChristian Kandeler2021-08-1325-766/+873
| | | | | | | | | | | | | | | | | | | | | | | | | | ProjectInfo, ProjectPart and ProjectUpdateInfo used to carry pointers to Project and/or Toolchain, even though they were used in contexts where these pointers were either unsafe to access or not guaranteed to be valid anymore, which made their use difficult and error-prone. We turn these classes into pure value types by copying in all relevant information before the first async operation takes place. Fixes: QTCREATORBUG-25678 Change-Id: I1914b0dbda6c7dfba6c95e5e92f2d69977755590 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | Utils: Use FilePath in copy helpershjk2021-08-101-6/+4
| | | | | | | | | | Change-Id: I81b367a5851c0fbcdf45c63c5536c206845a8337 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Fix warning about format string not being string literalTor Arne Vestbø2021-08-041-14/+7
| | | | | | | | | | Change-Id: I54e80b15b7a492acd4ffdb50a28f00511f72355c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Merge remote-tracking branch 'origin/5.0'Eike Ziller2021-08-031-1/+7
|\ \ | |/ | | | | Change-Id: I4236e3d2f87d56aea787905f4b78b1f5f933c069
| * CppTools: Fix semantic highlightingChristian Kandeler2021-08-021-1/+7
| | | | | | | | | | | | | | | | | | It turns out the parentheses information for the TextEditor has to be in order of occurrence in the document. Fixes: QTCREATORBUG-26068 Change-Id: I5335160f81355bac6b1431cad25a31b70f03e8f4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Replace uses of deprecated QWARN macro with qWarningTor Arne Vestbø2021-08-031-7/+7
| | | | | | | | | | Change-Id: I71ee2cedaf40197ac52f61e74060656fc4b305d4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Utils: Use FilePath in DropSupporthjk2021-08-021-1/+2
| | | | | | | | | | Change-Id: Id048d0dab4c58be367a081bb8041214abd6dbf98 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Merge remote-tracking branch 'origin/5.0'Orgad Shaneh2021-07-293-10/+11
|\ \ | |/ | | | | Change-Id: I4ea793c0b2d1980e5ed79bcc985c0f26a4de7aa4
| * CppEditor: Fix possible crash when following typdefsChristian Kandeler2021-07-292-3/+11
| | | | | | | | | | | | | | | | | | It's probably also a bug that we don't resolve the identically-named struct correctly, but at least we don't crash anymore. Fixes: QTCREATORBUG-26047 Change-Id: I272e76460c87906c9df23aaf7f37953b451bf1a8 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * ClangTools: Make sure clazy doc URL corresponds to tool versionChristian Kandeler2021-07-291-7/+0
| | | | | | | | | | | | | | | | | | Note that this will only work with clazy >= 1.10. For earlier versions, we fall back to the master branch documentation, as before. Fixes: QTCREATORBUG-25869 Change-Id: I7a8188eda15c4e0548bfaa63aa90f721aa44d6c2 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | ProjectExplorer: Use FilePath in ProjectExplorer::openProject{,s}()hjk2021-07-271-1/+3
| | | | | | | | | | Change-Id: Ibfb7ab5ef7226b85452bd37b840408708935453b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | CppTools: Move SendDocumentTracker tests into pluginChristian Kandeler2021-07-223-4/+196
| | | | | | | | | | | | Change-Id: I1d0532b5d0e155f6d53c683d01c4a92e4bae3ce9 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | CompilationDatabaseProjectManager: Move tests to pluginChristian Kandeler2021-07-221-4/+2
| | | | | | | | | | | | Change-Id: Ife4ee68cdbd1560830f294610f8fab40653a4f5b Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | CppTools: Move ProjectFileCategorizer tests to pluginChristian Kandeler2021-07-223-4/+114
| | | | | | | | | | Change-Id: I51d66d9ff9a14e2dd04cf25448ccc8c85bcbce97 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | CppTools: Remove some unneeded name qualifications in converted testsChristian Kandeler2021-07-212-179/+114
| | | | | | | | | | Change-Id: Ib14f576d0502adde56e8c8b0af0c5d95fae1eddf Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | CppTools: Fix compile with gcc7Christian Stenger2021-07-211-1/+2
| | | | | | | | | | | | | | Amends 18ab828b6b8. Change-Id: I758e0a584769b665eb7215da5a9f42938d3de5fb Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge remote-tracking branch 'origin/5.0'hjk2021-07-214-37/+69
|\ \ | |/ | | | | Change-Id: I9409f35cb9d1bc2e57631d2bfa3a0931ff5dd259
| * CppTools: Fix look-up of top-level virtual function declarationChristian Kandeler2021-07-201-4/+20
| | | | | | | | | | | | Fixes: QTCREATORBUG-25749 Change-Id: I7a9e8e406739931df253f14772361f575adbaa3f Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * ClangTools: Fix clang-tidy command-line constructionChristian Kandeler2021-07-191-2/+2
| | | | | | | | | | | | Fixes: QTCREATORBUG-26015 Change-Id: I2850e6efa5b75748599f55e8b9c96757582f5cb4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * CppTools: Do not access kits in non-UI threadChristian Kandeler2021-07-192-31/+47
| | | | | | | | | | | | | | Amends 9c3420120e. Change-Id: Iba8b1069bf4468119c7f518c562e4229141ac66b Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Unit test: Remove some now-unused CppTools sourcesChristian Kandeler2021-07-201-4/+2
| | | | | | | | | | | | Change-Id: I61a0d15ade5093c6e7eeb005efed5704764fe7a1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | CppTools: Move HeaderPathsFilter tests to pluginChristian Kandeler2021-07-203-4/+263
| | | | | | | | | | Change-Id: Iecbb0942bed51002e85b96f6cc2ab034622cd07f Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | CppTools: Move ProjectInfoGenerator tests into the pluginChristian Kandeler2021-07-163-2/+158
| | | | | | | | | | Change-Id: I40d4b0b9751e77a5bb605349c86b37ad3935ca59 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Merge remote-tracking branch 'origin/5.0'Orgad Shaneh2021-07-0518-92/+522
|\ \ | |/ | | | | Change-Id: Ia018600fb257c9523fc9d15faa5bd8300840e3de
| * Don't update extra compilers individually after project loadEike Ziller2021-07-054-6/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each call of CppModelManager::updateSourceFiles detaches the current snapshot. The extra compilers where set up and triggered individually, and resulted in individual updateSourceFiles calls with the single result file of the extra compiler. For Qt Creator this would lead to 200 calls in quick succession after project load, potentially leading to a freeze of multiple seconds. Instead of updating the result files of the extra compilers individually after project load, integrate the update into the regular project source file update. So we end up with only a single call of updateSourceFiles. For this the project updater needs to trigger the extra compilers, and wait for all to finish as well as the regular project part update, before triggering the parser. Task-number: QTCREATORBUG-25783 Change-Id: I34f6df0fc0f96bcb42ee65019bee39cf49176c1f Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| * ClangCodeModel: Prefer ui headers from ExtraCompilersChristian Kandeler2021-07-022-0/+6
| | | | | | | | | | | | | | | | | | ... to the ones from the actual build. The former are generally more up- to-date. Fixes: QTCREATORBUG-25937 Change-Id: I20859de9816457c340d9e1ec6a3008c536537d8b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
| * Utils: Use FilePath in TemporaryDirectory APIhjk2021-07-022-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | This helps to lower impedance in the using code. Even though TemporaryDirectory will very likely always stay on the local host, this is one of the entry points into path related string manipulation that we want to base on FilePath nowadays. Change-Id: I302016b8d65e54df94296659a54a93935d9e4627 Reviewed-by: David Schulz <david.schulz@qt.io>
| * Utils: Merge FileUtils::removeRecursively() into FilePathhjk2021-07-021-1/+1
| | | | | | | | | | | | | | | | This simplify the interface by removing a possibly wrong choice ensures it works also on remote paths. Change-Id: I01e198958900a91b99dcf2dbb491a593485493ba Reviewed-by: David Schulz <david.schulz@qt.io>