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>
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 11 KiB |
@@ -132,10 +132,14 @@
|
|||||||
to run in parallel to make the analysis faster on multi-core
|
to run in parallel to make the analysis faster on multi-core
|
||||||
processors.
|
processors.
|
||||||
|
|
||||||
\li In the \uicontrol {Diagnostic Configuration} group, select
|
\li The \uicontrol {Diagnostic configuration} field shows the
|
||||||
\uicontrol Manage to create or edit a custom configuration.
|
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"
|
\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
|
system to the Clang code model for displaying annotations in the
|
||||||
code editor.
|
code editor.
|
||||||
|
|
||||||
\image qtcreator-clang-tools-diagnostics-configuration.png "Diagnostics Configuration dialog"
|
|
||||||
|
|
||||||
\li In the \uicontrol {Clang-Tidy Checks} tab, select
|
\li In the \uicontrol {Clang-Tidy Checks} tab, select
|
||||||
\uicontrol {Select Checks} to select the checks to perform.
|
\uicontrol {Select Checks} to select the checks to perform.
|
||||||
To filter the checks, enter a string in the
|
To filter the checks, enter a string in the
|
||||||
|
@@ -716,4 +716,23 @@
|
|||||||
\uicontrol {Enable auto format on file save}.
|
\uicontrol {Enable auto format on file save}.
|
||||||
|
|
||||||
\image qtcreator-qml-js-editing.png "QML/JS Editing preferences"
|
\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
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@@ -114,6 +114,14 @@
|
|||||||
\li To process precompiled headers, deselect the
|
\li To process precompiled headers, deselect the
|
||||||
\uicontrol {Ignore precompiled headers} check box.
|
\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
|
\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
|
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,
|
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
|
re-scanning is incremental, so nothing is lost by closing and re-starting
|
||||||
\QC.
|
\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}
|
The document outline in the \l{Viewing Defined Types and Symbols}
|
||||||
{Outline} view is backed by clangd's document symbol support, which
|
{Outline} view is backed by clangd's document symbol support, which
|
||||||
makes the results more reliable than before.
|
makes the results more reliable than before.
|
||||||
@@ -144,11 +157,11 @@
|
|||||||
\image qtcreator-options-clangd.png "clangd preferences"
|
\image qtcreator-options-clangd.png "clangd preferences"
|
||||||
\li In \uicontrol {Path to executable}, enter the path to clangd
|
\li In \uicontrol {Path to executable}, enter the path to clangd
|
||||||
version 14, or later.
|
version 14, or later.
|
||||||
\li For more accurate results during global symbol searches, select
|
\li In the \uicontrol {Background indexing} field, select \uicontrol Off
|
||||||
\uicontrol {Enable background indexing}. However, this increases the
|
to use a faster, but less accurate built-in indexer than the one used
|
||||||
CPU load the first time you open the project. If clangd background
|
by default. You can set the indexing priority depending on whether
|
||||||
indexing is disabled, \QC falls back to a faster, but less accurate
|
the accuracy of results or speed is more important to you during
|
||||||
built-in indexer.
|
global symbol searches.
|
||||||
\li By default, clangd attempts to use all unused cores. You can set a
|
\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}.
|
fixed number of cores to use in \uicontrol {Worker thread count}.
|
||||||
Background indexing also uses this many worker threads.
|
Background indexing also uses this many worker threads.
|
||||||
@@ -164,10 +177,12 @@
|
|||||||
\li Select \uicontrol {Ignore files greater than} to make parsing faster
|
\li Select \uicontrol {Ignore files greater than} to make parsing faster
|
||||||
by ignoring big files. Specify the maximum size of files to parse in
|
by ignoring big files. Specify the maximum size of files to parse in
|
||||||
the field next to the check box.
|
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
|
checks to perform. Click the value of the field to open the
|
||||||
\uicontrol {Diagnostic Configurations} dialog, where you can
|
\uicontrol {Diagnostic Configurations} dialog, where you can
|
||||||
select and edit the checks to perform.
|
select and edit the checks to perform.
|
||||||
|
\li Select \uicontrol Add to select sessions that should use a single
|
||||||
|
clangd process for indexing.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section1 Clang Checks
|
\section1 Clang Checks
|
||||||
|
@@ -38,9 +38,15 @@
|
|||||||
To specify global code style settings sets for C++ files, select
|
To specify global code style settings sets for C++ files, select
|
||||||
\uicontrol Edit > \uicontrol Preferences > \uicontrol C++.
|
\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
|
To specify global code style settings sets for QML files, select
|
||||||
\uicontrol Edit > \uicontrol Preferences > \uicontrol {Qt Quick}.
|
\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:
|
To configure the editor behavior for the current project:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
@@ -58,12 +64,6 @@
|
|||||||
|
|
||||||
\li Click \uicontrol Edit to specify code style settings for the project.
|
\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
|
\endlist
|
||||||
|
|
||||||
For more information about the settings, see \l{Indenting Text or Code}.
|
For more information about the settings, see \l{Indenting Text or Code}.
|
||||||
|