Commit Graph

2867 Commits

Author SHA1 Message Date
Christian Kandeler
33108795d6 CppTools: Turn some classes into pure value types
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>
2021-08-13 12:35:49 +00:00
hjk
2ab2d96753 Utils: Use FilePath in copy helpers
Change-Id: I81b367a5851c0fbcdf45c63c5536c206845a8337
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-10 07:19:10 +00:00
Tor Arne Vestbø
562848f647 Fix warning about format string not being string literal
Change-Id: I54e80b15b7a492acd4ffdb50a28f00511f72355c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-08-04 09:46:13 +00:00
Eike Ziller
17d716118a Merge remote-tracking branch 'origin/5.0'
Change-Id: I4236e3d2f87d56aea787905f4b78b1f5f933c069
2021-08-03 14:19:44 +02:00
Tor Arne Vestbø
53b21b7644 Replace uses of deprecated QWARN macro with qWarning
Change-Id: I71ee2cedaf40197ac52f61e74060656fc4b305d4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-08-03 10:03:34 +00:00
Christian Kandeler
f84e4ea8cc CppTools: Fix semantic highlighting
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>
2021-08-02 08:21:50 +00:00
hjk
5731965045 Utils: Use FilePath in DropSupport
Change-Id: Id048d0dab4c58be367a081bb8041214abd6dbf98
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-02 06:59:53 +00:00
Orgad Shaneh
69c6c9f7d5 Merge remote-tracking branch 'origin/5.0'
Change-Id: I4ea793c0b2d1980e5ed79bcc985c0f26a4de7aa4
2021-07-29 16:03:09 +03:00
Christian Kandeler
2e7891bedd CppEditor: Fix possible crash when following typdefs
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>
2021-07-29 11:12:29 +00:00
Christian Kandeler
1b1e18a869 ClangTools: Make sure clazy doc URL corresponds to tool version
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>
2021-07-29 09:28:05 +00:00
hjk
9b250ea2c0 ProjectExplorer: Use FilePath in ProjectExplorer::openProject{,s}()
Change-Id: Ibfb7ab5ef7226b85452bd37b840408708935453b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-27 11:35:47 +00:00
Christian Kandeler
1275a12582 CppTools: Move SendDocumentTracker tests into plugin
Change-Id: I1d0532b5d0e155f6d53c683d01c4a92e4bae3ce9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-22 08:55:46 +00:00
Christian Kandeler
da588b7cc4 CompilationDatabaseProjectManager: Move tests to plugin
Change-Id: Ife4ee68cdbd1560830f294610f8fab40653a4f5b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-22 07:45:19 +00:00
Christian Kandeler
a3d621fbde CppTools: Move ProjectFileCategorizer tests to plugin
Change-Id: I51d66d9ff9a14e2dd04cf25448ccc8c85bcbce97
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-22 07:29:46 +00:00
Christian Kandeler
709138ce61 CppTools: Remove some unneeded name qualifications in converted tests
Change-Id: Ib14f576d0502adde56e8c8b0af0c5d95fae1eddf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-21 09:48:59 +00:00
Christian Stenger
1a0c9a5ce4 CppTools: Fix compile with gcc7
Amends 18ab828b6b.

Change-Id: I758e0a584769b665eb7215da5a9f42938d3de5fb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-21 09:21:05 +00:00
hjk
f46c8b5c92 Merge remote-tracking branch 'origin/5.0'
Change-Id: I9409f35cb9d1bc2e57631d2bfa3a0931ff5dd259
2021-07-21 09:18:52 +02:00
Christian Kandeler
a7756a72fd CppTools: Fix look-up of top-level virtual function declaration
Fixes: QTCREATORBUG-25749
Change-Id: I7a9e8e406739931df253f14772361f575adbaa3f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-20 14:03:19 +00:00
Christian Kandeler
0adb502457 Unit test: Remove some now-unused CppTools sources
Change-Id: I61a0d15ade5093c6e7eeb005efed5704764fe7a1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-20 12:38:28 +00:00
Christian Kandeler
18ab828b6b CppTools: Move HeaderPathsFilter tests to plugin
Change-Id: Iecbb0942bed51002e85b96f6cc2ab034622cd07f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-20 09:35:52 +00:00
Christian Kandeler
217dfdda7a ClangTools: Fix clang-tidy command-line construction
Fixes: QTCREATORBUG-26015
Change-Id: I2850e6efa5b75748599f55e8b9c96757582f5cb4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-19 12:12:27 +00:00
Christian Kandeler
0636238429 CppTools: Do not access kits in non-UI thread
Amends 9c3420120e.

Change-Id: Iba8b1069bf4468119c7f518c562e4229141ac66b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-19 08:40:35 +00:00
Christian Kandeler
5ec52eef31 CppTools: Move ProjectInfoGenerator tests into the plugin
Change-Id: I40d4b0b9751e77a5bb605349c86b37ad3935ca59
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-16 12:09:48 +00:00
Orgad Shaneh
84839ee397 Merge remote-tracking branch 'origin/5.0'
Change-Id: Ia018600fb257c9523fc9d15faa5bd8300840e3de
2021-07-05 12:17:45 +03:00
Eike Ziller
e3b639047f Don't update extra compilers individually after project load
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>
2021-07-05 08:16:25 +00:00
Christian Kandeler
32f46e55ed CppTools: Move ProjectPartChooser tests into the plugin
Change-Id: Ic2ef95d4d6a5bd65cbc611b66a0b297c7468bbcb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-05 07:38:10 +00:00
Christian Kandeler
85797068bb CppTools: Move CompilerOptionsBuilder tests to plugin
... where they belong.

Change-Id: Ifc6aebc218f9f85ffeb6a4b7121f97379b53b69d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-02 13:12:54 +00:00
Christian Kandeler
4d27740baf ClangCodeModel: Prefer ui headers from ExtraCompilers
... 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>
2021-07-02 08:20:51 +00:00
hjk
a58dd22f2d Utils: Use FilePath in TemporaryDirectory API
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>
2021-07-02 05:05:12 +00:00
hjk
92904480f0 Utils: Merge FileUtils::removeRecursively() into FilePath
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>
2021-07-02 04:57:24 +00:00
Christian Kandeler
c0a44be27b ClangCodeModel: Provide outline via clangd
Note that we used to encode the information about symbol visibility and
static-ness in the icons, which we can't do anymore, because clangd does
not provide this information.
On the upside, this change likely fixes a ton of bugs, as our own outline
was rather "quirky".

Change-Id: I099f11ec4e3c6f52cd461fb43080bbdde3bed5e5
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-07-01 08:36:20 +00:00
Christian Kandeler
f4a3310059 Clangd: Handle settings changes
Users no longer have to re-load a project for settings changes to take
effect.

Change-Id: I86dccccac14a30514c8dac292c7765ee4806f6ba
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-07-01 08:34:51 +00:00
Christian Kandeler
fbb804c442 Clangd: Add per-project settings
Users might want to use clangd for certain project, but not for others.

Change-Id: Id29ce3349f0acd359cf7c824ece073b147ed2280
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-30 15:09:56 +00:00
Christian Kandeler
6f5e20bf64 ClangTools: Fix applying check options
The algorithm we used to determine whether an option was applicable did
not take the wildcard syntax into account that is used when all sub-
checks of a group are enabled.

Fixes: QTCREATORBUG-25827
Change-Id: I1d385bcc90ea9bf0bfac5cffe8739a8148aa740f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-29 06:59:21 +00:00
Christian Kandeler
74385cc10c ClangTools: Make sure URL for clang-tidy checks is always correct
Fixes: QTCREATORBUG-25902
Change-Id: Ifadb6c90cf9a86fc4efb734d6105217b70f9419d
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-29 06:58:58 +00:00
David Schulz
44f0f9ae18 Clangd: use special value text for automatic worker count
Change-Id: Iddb75b6716724b5994d8093a8e389f5cb8e2d044
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-29 04:45:47 +00:00
Christian Kandeler
56cddf38b3 Clangd: Let users limit the worker thread count
This is particularly interesting for indexing, where users might prefer
a slower-building index with less CPU load.

Change-Id: Id44c58e9041df2857cd0772e71345673b14623f3
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-28 10:35:33 +00:00
Christian Kandeler
876cd8e975 Clangd: Allow to switch off background indexing
It is conceivable that users don't want to spend the extra CPU time on
this.

Change-Id: Ic3611c8d17d201ae986fad08b344369a8728ce1b
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-28 10:35:06 +00:00
Christian Kandeler
ba138a1855 CppTools: Add dedicated settings and settings page for clangd
We plan to add more clangd settings, and it makes sense to have a
dedicated place for them both in the code and the UI.

Change-Id: Ideb92935b7a5a6a98e07980f4011736fb82042d1
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-28 10:34:24 +00:00
David Schulz
e13c2b7403 MimeDatabase: add FilePath convenience function
Change-Id: I59c825490b3b5c49f3c177584ea4cc885c4f920b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 12:03:28 +00:00
David Schulz
b6367b6359 Core: use FilePaths to notify files changed internally
Change-Id: I2fce65ad340f18292fc0286233e78aaf769a130d
Reviewed-by: hjk <hjk@qt.io>
2021-06-23 12:03:10 +00:00
Christian Kandeler
41dafc8132 ClangCodeModel: Implement declaration/definition switch via clangd
Change-Id: I522a415d76fbc5332e5cc1fdfd2d7ab19cb9ed64
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-18 11:11:17 +00:00
David Schulz
f66df921d7 Core: filepathify file renaming
Change-Id: I3d4f39e34e65cde3df7b7c19570e3a54d0625d53
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-17 11:13:51 +00:00
Kai Köhne
bf04c98c1c Do not pass QStringView by const reference
That's what the documentation says:

  https://doc.qt.io/qt-6/qstringview.html#details

Change-Id: I0b41fc4abad1601c0ed416a505534cf7ae7633e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-17 09:54:42 +00:00
Eike Ziller
baa83725f6 Remove ClangRefactoring and ClangPchManager
This removes the plugins and tools, and removes all the tests that would
fail to build because of that.

Fixes: QTCREATORBUG-25659
Change-Id: I8adb5d503fc8eea313bcaada421f309dbbfa8c26
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-06-15 10:07:57 +00:00
David Schulz
79b9a2fea6 TextEditor: filepathify RefactoringChanges
Change-Id: Ie97e484bcdeaa0cb2f5d04b3c79ace55ff2e426c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-08 11:40:10 +00:00
Christian Kandeler
eba2f2df84 CppEditor: Run test cases for virtual functions also with clangd
This uncovered some bugs, of which we fixed the ones that we could do
something about.

Change-Id: Id8494793bec4d25635bf920133d9f9331bd36228
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-08 09:51:09 +00:00
David Schulz
6008c5f673 Core: filepathify LocatorFilterEntry
Change-Id: I279af30f6b57e8d1279d96e5cbae4025cf4ef473
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-08 07:46:37 +00:00
Christian Kandeler
a5ba33cbeb CppEditor: Add second "Find References" Action
This one includes access type categorization, while the "normal" one
does not.
We need this now, because with clangd, the categorization is too slow to
enable it by default.

Change-Id: I2eb4608630d34452ae28f0836befd5d9053f42bf
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-07 08:28:49 +00:00
Eike Ziller
098637b758 Merge remote-tracking branch 'origin/4.15'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp
	src/plugins/ios/iosprobe.cpp
	src/plugins/mcusupport/mcusupportsdk.cpp

Change-Id: I6c2136b576c44fc35def397191db97069599f183
2021-06-07 08:37:56 +02:00