Doc: Adapt clang code model documentation

We use clangd now.

Update screenshots and remove duplicates.

Change-Id: Ie3e7e565c2b564b7c20284a5f752b4accf12f37a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
Christian Kandeler
2022-05-20 16:49:12 +02:00
parent a4d6956c73
commit 6c05ed7920
6 changed files with 18 additions and 26 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -65,7 +65,7 @@
\endlist
\QC comes with a plugin that provides some of these services
for C++ on top of \l{http://clang.llvm.org/}{Clang}.
for C++ on top of \l{https://clangd.llvm.org/}{Clangd}.
\section1 About the Clang Code Model
@@ -75,6 +75,8 @@
set or a close approximation, as when using the built-in \QC code model.
Clang focuses on detailed information for diagnostics, which is really
useful if the code contains typos, for example.
We make use of these libraries via the clangd tool, which implements
an \l{https://microsoft.github.io/language-server-protocol/}{LSP} server.
Clang keeps up with the development of the C++ language. At the time of this
writing, it supports C++98/03, C++11, C++14, C++17, C89, C99, Objective-C,
@@ -98,14 +100,16 @@
\li \l{Using Clang Tools}{Diagnostics}
\li Outline of symbols
\li Tooltips
\li Renaming of local symbols
\li Following symbols
\li Renaming symbols
\li Finding occurrences of symbols
\endlist
To use the built-in code model instead, select \uicontrol Help >
\uicontrol {About Plugins} > \uicontrol C++, and deselect the
\uicontrol ClangCodeModel check box. Select \uicontrol {Restart Now}
to restart \QC and have the changes take effect.
To use the built-in code model instead, select \uicontrol Tools > \uicontrol Options >
\uicontrol C++ > \uicontrol clangd, and deselect the \uicontrol {Use clangd} check box.
This setting also exists on the project level, so that you can have the clang-based
services generally enabled, but switch them off for for certain projects, or vice versa.
You can configure Clang diagnostics either globally or separately for:
@@ -138,13 +142,6 @@
edit the value for the \uicontrol {Do not index files greater than}
check box. To index all files, deselect the check box.
\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.
\image qtcreator-diagnostics-configuration.png
\endlist
\section1 Configuring clangd
@@ -179,6 +176,10 @@
\li In \uicontrol {Document update threshold}, specify the amount of
time \QC waits before sending document changes to the server.
If the document changes again while waiting, this timeout is reset.
\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.
\endlist
\section1 Clang Checks
@@ -203,16 +204,7 @@
\section1 Specifying Clang Code Model Settings at Project Level
You can specify Clang code model settings at project level by selecting
\uicontrol Projects > \uicontrol {Clang Code Model}.
In addition to configuring the diagnostics,
you can select the \uicontrol {Enable MSVC-compliant template parsing} check
box to parse templates in a MSVC-compliant way. This enables Clang to parse
headers for example from Active Template Library (ATL) or Windows Runtime
Library (WRL). However, using the relaxed and extended rules means that no
highlighting or completion can be provided within template functions.
\image qtcreator-clang-code-model-build-settings.png
\uicontrol Projects > \uicontrol {clangd}.
\include creator-compilation-database.qdocinc using compilation databases

View File

@@ -112,15 +112,15 @@
\li \l{Using Custom Output Parsers}{Custom Output Parsers}
\li \l{Parsing C++ Files with the Clang Code Model}
{Clang Code Model}
\li \l{Applying Refactoring Actions}{Quick Fixes}
\li \l{Using Clang Tools}{Clang Tools}
\li \l{To-Do Entries}{To-Do} (experimental)
\li \l{Parsing C++ Files with the Clang Code Model}
{Clangd}
\endlist
If you have multiple projects open in \QC, select the project to configure