Doc: Update info about Clang and clangd preferences

And the Show Preprocessed Source action in the code editor
context menu.

Task-number: QTCREATORBUG-27876
Change-Id: I43ca26d6ee7bb5e0441a37aeb1f7eecbb4ba8fde
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Leena Miettinen
2022-10-04 15:23:05 +02:00
parent 94ab264d45
commit 9accbdac02
10 changed files with 53 additions and 17 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -132,10 +132,14 @@
to run in parallel to make the analysis faster on multi-core
processors.
\li In the \uicontrol {Diagnostic Configuration} group, select
\uicontrol Manage to create or edit a custom configuration.
\li The \uicontrol {Diagnostic configuration} field shows the
checks to perform. Click the value of the field to open the
\uicontrol {Diagnostic Configurations} dialog, where you can
select and edit the checks to perform.
\li Select \uicontrol Copy to create a custom Clang configuration.
\image qtcreator-clang-tools-diagnostics-configuration.png "Diagnostics Configuration dialog"
\li Select \uicontrol Copy to copy the selected diagnostics for editing.
\image qtcreator-clang-copy-diagnostic-configuration.png "Copy Diagnostic Configuration dialog"
@@ -148,8 +152,6 @@
system to the Clang code model for displaying annotations in the
code editor.
\image qtcreator-clang-tools-diagnostics-configuration.png "Diagnostics Configuration dialog"
\li In the \uicontrol {Clang-Tidy Checks} tab, select
\uicontrol {Select Checks} to select the checks to perform.
To filter the checks, enter a string in the

View File

@@ -716,4 +716,23 @@
\uicontrol {Enable auto format on file save}.
\image qtcreator-qml-js-editing.png "QML/JS Editing preferences"
\if defined(qtcreator)
\section1 Inspecting Preprocessed C++ Code
To analyze the causes of compile errors or errors caused by wrong includes
pulled in by dependencies or C++ macros expanding to something unexpected,
select \uicontrol {Show Preprocessed Source} in the editor context menu.
This action expands all C++ macros to their actual code and removes code that
is guarded by a currently inactive \c {#ifdef} statements. If you deselect
the \uicontrol {Use built-in preprocessor to show pre-processed files} check
box in \uicontrol Edit > \uicontrol Preferences > \uicontrol C++ >
\uicontrol {Code Model}, this action also expands all
\c {"#include <foo.h>"} statements to their actual contents.
\image qtcreator-clang-code-model-options.png "C++ Code Model preferences"
\endif
*/

View File

@@ -114,6 +114,14 @@
\li To process precompiled headers, deselect the
\uicontrol {Ignore precompiled headers} check box.
\li When you select \uicontrol {Show Preprocessed Source} in the code
editor context menu, the built-in preprocessor is used to show the
pre-processed source file in the editor. To invoke the actual
compiler for showing the code, deselect the
\uicontrol {Use built-in preprocessor to show pre-processed files}
check box. For more information, see
\l {Inspecting Preprocessed C++ Code}.
\li To avoid out-of-memory crashes caused by indexing huge source files
that are typically auto-generated by scripts or code, the size of
files to index is limited to 5MB by default. To adjust the limit,
@@ -132,6 +140,11 @@
re-scanning is incremental, so nothing is lost by closing and re-starting
\QC.
By default, \QC runs one clangd process per project. If you have created
\l{Managing Sessions}{sessions} that contain related projects, you can
specify that the projects in the session should be managed by a single
clangd process.
The document outline in the \l{Viewing Defined Types and Symbols}
{Outline} view is backed by clangd's document symbol support, which
makes the results more reliable than before.
@@ -144,11 +157,11 @@
\image qtcreator-options-clangd.png "clangd preferences"
\li In \uicontrol {Path to executable}, enter the path to clangd
version 14, or later.
\li For more accurate results during global symbol searches, select
\uicontrol {Enable background indexing}. However, this increases the
CPU load the first time you open the project. If clangd background
indexing is disabled, \QC falls back to a faster, but less accurate
built-in indexer.
\li In the \uicontrol {Background indexing} field, select \uicontrol Off
to use a faster, but less accurate built-in indexer than the one used
by default. You can set the indexing priority depending on whether
the accuracy of results or speed is more important to you during
global symbol searches.
\li By default, clangd attempts to use all unused cores. You can set a
fixed number of cores to use in \uicontrol {Worker thread count}.
Background indexing also uses this many worker threads.
@@ -164,10 +177,12 @@
\li Select \uicontrol {Ignore files greater than} to make parsing faster
by ignoring big files. Specify the maximum size of files to parse in
the field next to the check box.
\li The \uicontrol {Diagnostic Configuration} field shows the Clang
\li The \uicontrol {Diagnostic configuration} field shows the Clang
checks to perform. Click the value of the field to open the
\uicontrol {Diagnostic Configurations} dialog, where you can
select and edit the checks to perform.
\li Select \uicontrol Add to select sessions that should use a single
clangd process for indexing.
\endlist
\section1 Clang Checks

View File

@@ -38,9 +38,15 @@
To specify global code style settings sets for C++ files, select
\uicontrol Edit > \uicontrol Preferences > \uicontrol C++.
\image qtcreator-code-style-settings-edit-cpp.png "Edit Code Style Settings dialog"
To specify global code style settings sets for QML files, select
\uicontrol Edit > \uicontrol Preferences > \uicontrol {Qt Quick}.
\image qtcreator-code-style-settings-edit-qtquick.png "Edit Code Style Settings view"
Only \uicontrol General settings are available for QML files.
To configure the editor behavior for the current project:
\list 1
@@ -58,12 +64,6 @@
\li Click \uicontrol Edit to specify code style settings for the project.
\image qtcreator-code-style-settings-edit-cpp.png "Edit Code Style Settings dialog"
\note Only \uicontrol General settings are available for QML files.
\image qtcreator-code-style-settings-edit-qtquick.png "Edit Code Style Settings view"
\endlist
For more information about the settings, see \l{Indenting Text or Code}.