Commit Graph

28 Commits

Author SHA1 Message Date
hjk
072489829d Utils: Make port.h slimmer
Fix the fallout. Also make comparisons hidden friends.

Change-Id: Ib16a294391f5732f94f9f411a48220b497691de2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-27 12:07:59 +00:00
Eike Ziller
3d4d7c7e14 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/plugins/clangtools/clangtoolssettings.cpp
	src/plugins/clangtools/executableinfo.cpp
	src/plugins/clangtools/executableinfo.h

Change-Id: Id8caf63e3e594792467d3447870086bd2d8f73b9
2021-09-13 17:03:55 +02:00
Christian Kandeler
3d64cf0d82 ClangTools: Fix clazy documentation URL
There is no patch version in the URL.
Amends 1b1e18a869.

Change-Id: I8d17b6aea3283e9a78744a28ad9a98e1c7c087e8
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-08 11:18:53 +00:00
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
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>
2021-09-01 14:53:58 +00:00
hjk
09ae643153 ClangTools/CppTools: Code cosmetics
Mostly namespaces.

Change-Id: Ife8bbcb128344cf56d444da8f9d76b1204b9fe34
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-18 14:13:03 +00:00
hjk
04235535a5 ClangTools: Simplify Internal::fullPath()
Change-Id: I3b546acdd64c40899c98893c42e9827db2d99b27
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-08-18 12:02:54 +00:00
hjk
f29bc8c787 ClangTools: Proliferate use of FilePath
Change-Id: I3eb16546a729ab01c10e37572adac9aef83f5cd4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-18 11:43:30 +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
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
0cfe27a53d Debugger: filepathify DiagnosticLocation
Change-Id: Ibbbf137231b313ec10e3d57c0230217b0c1e0a6c
Reviewed-by: hjk <hjk@qt.io>
2021-06-09 06:57:42 +00:00
hjk
7cb7e221bd ClangTools: Avoid one use of mutable ProcessArgs::iterator
splitArgs() is more compact and sufficient here.

Change-Id: I789b9ee37899b3d26bd4fabea7ab1756a6d8ac2b
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-05-11 10:00:25 +00:00
hjk
f2f40efa03 Utils: Move process arguments class out of QtcProcess
The main QtcProcess interface is nowadays a CommandLine, with no
explicit references left to QtcProcess::Arguments and related static
helper functions, so it only clutters the QtcProcess class interface

So move these items out of QtcProcess, later potentially to a separate
file pair.

Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-11 09:45:24 +00:00
hjk
c23cdd9262 Utils: Merge {synchronous,qtc}process.{h,cpp} file pairs
Mechanical to prepare merging the actual classes.
Adapting #includes.

Change-Id: I77a2c28129287778bc870c30cb890cd26bc2e62b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-10 09:47:51 +00:00
Christian Kandeler
5066ddd908 ClangTools: Add documentation for current diagnostic to tooltip
Fixes: QTCREATORBUG-25163
Change-Id: I284c50c0b9b73c74ba328624c5238368de05839d
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-20 10:01:29 +00:00
Christian Kandeler
ab91e547da ClangTools: Allow to disable a specific type of diagnostic
... from the results list.
This is much more convenient for the user than having to locate the
diagnostic in the settings first.
This patch deals with the global settings. We plan to offer the same for
project-level settings in a follow-up patch.

Task-number: QTCREATORBUG-24852
Change-Id: I7a97189c393048b98b9c2cdb6f21861a34670e8f
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-17 12:40:58 +00:00
David Schulz
e176958da1 ClangTools: Add automatic clang tool runner for open documents
Fixes: QTCREATORBUG-23349
Change-Id: I81197180c9d69c7df6184f8fcbf05f2256eaf7f6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-08-28 07:20:32 +00:00
David Schulz
7f562c4d33 ClangTools: Add diagnostic mark class
These marks can now be disabled.
This greys out the annotation color and the icon of the mark.

Change-Id: I5af4591db4baaaef55c986252f77d5d977427b56
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-28 07:20:19 +00:00
Alessandro Portale
0be309bcf1 Various places: performance-for-range-copy
Change-Id: I475990d32a5211d31a77782667a2dfedba134137
Reviewed-by: hjk <hjk@qt.io>
2020-06-15 05:58:46 +00:00
Nikolai Kosjar
9fc2fda07e ClangTools: Remove dependency to libclang and custom clang binary
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>
2020-05-19 12:28:49 +00:00
Nikolai Kosjar
1b4de8d769 ClangTools: Add help context menu entry
...that opens the documentation page for the current diagnostic.

Change-Id: I398fdc82bb118a80536acbb12420a9bac84e66c9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-13 14:33:55 +00:00
Nikolai Kosjar
fbd350f31f ClangTools: Introduce an info bar
...displaying status information and errors.

Change-Id: I4f86b440b28e82786299700dee572e77de7334f3
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-03 13:24:24 +00:00
Nikolai Kosjar
dcb35676df Clang: Clean up TidyMode/ClazyMode enumerators
Change-Id: Ie3ff0d629fd3c115df9c527e9ae8d7962fcfa156
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-03 13:23:38 +00:00
Nikolai Kosjar
0d7a30cdfe ClangTools: Query the tools for supported checks
...instead of hardcoding them for a particular version of
clang-tidy/clazy.

While at it, move also the tidy/clazy widgets to ClangTools as this
simplifies feeding data to them.

Reduce also the built-in configs to a single one using clang-tidy's and
clazy's default checks as they look very reasonable and saves us some
porting effort. Also, our previous built-in configs were just too
numerous.

Change-Id: Ib9297acb7810a940b86a23a8695530506a570394
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-03 13:23:13 +00:00
Nikolai Kosjar
b895dfa382 Clang/ClangTools: Separate custom diagnostic configs
Add a separate pool of custom diagnostic configs for the
ClangTools plugin. That is, the diagnostic configs in

  Menu: Tools > C++ > Code Model

are not shared anymore with the configs at

  Menu: Tools > Analyzer > ClangTools

On plugin initialization of ClangTools, move tidy/clazy related configs
to ClangTools.

Change-Id: Id06087a58b53e466a3d7bbac669550c5fbe9899d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-10-01 14:10:28 +00:00
Nikolai Kosjar
fc37ea4276 ClangTools: Add UI for specifying executables
Add a new group box "Executables" for this. Hide the UI for
clazy-standalone unless QTC_USE_CLAZY_STANDALONE_PATH is set as there is
no released version with the needed -export-fixes option.

Rename the previous group box from "General" to "Run Options".

Change-Id: Ia9daf66c40d3a7eea98b31d9c086886d29466490
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-12 13:35:01 +00:00
Nikolai Kosjar
f223c094a1 ClangTools: Show hint when disabling "Build the project before analysis."
Show also the same hint as a tooltip.

Fixes: QTCREATORBUG-22382
Change-Id: If1b594994cea387d6727775ce4c28c21d51f2d86
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-06-26 08:55:10 +00:00
Ivan Donchevskii
52ac74b61c ClangTools: Remove clang executable settings
We use custom clang executable and it does not make
sense anymore to give a choice of changing it.

Change-Id: Icf86042ac3fcd08c320ef2bbdaabef1102b023b5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-05-04 09:58:37 +00:00
Ivan Donchevskii
e9c462391e ClangTools: Split generic part from static analyzer tool
To reuse it for other clang-based tools.

Change-Id: I6c0d8e9eee543fa08faf3bf93c9fac33e43c6820
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-04-13 12:34:53 +00:00