forked from qt-creator/qt-creator
Doc: Describe configuring C++ code model for a project
Task-number: QTCREATORBUG-30604 Change-Id: I8f3634fe4282ebe3d364f7762fe651ddb872313f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
BIN
doc/qtcreator/images/qtcreator-projects-cpp-code-model.webp
Normal file
BIN
doc/qtcreator/images/qtcreator-projects-cpp-code-model.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
@@ -124,8 +124,34 @@
|
||||
The document outline in the \l{Outline} view is backed by clangd's document
|
||||
symbol support, which makes the results more reliable than before.
|
||||
|
||||
\sa {Code Model}, {Clangd}, {Specify clangd settings},
|
||||
{Specify Clang tools settings}, {Use compilation databases}
|
||||
\sa {Configure C++ code model}, {Specify clangd settings},
|
||||
{Specify Clang tools settings}, {Use compilation databases},
|
||||
{Code Model}, {Clangd}
|
||||
*/
|
||||
|
||||
/*!
|
||||
\page creator-how-to-cpp-code-model.html
|
||||
\previouspage creator-how-tos.html
|
||||
|
||||
\ingroup creator-how-to-configure-editors
|
||||
\ingroup creator-how-to-projects-configure
|
||||
|
||||
\title Configure C++ code model
|
||||
|
||||
The code model offers services such as code completion, syntactic and
|
||||
semantic highlighting, and diagnostics.
|
||||
|
||||
To configure the C++ code model for a project:
|
||||
|
||||
\list 1
|
||||
\li Go to \uicontrol Projects > \uicontrol {Project Settings} >
|
||||
\uicontrol {C++ Code Model}.
|
||||
\image qtcreator-projects-cpp-code-model.webp {C++ Code Model settings}
|
||||
\li Clear \uicontrol {Use global settings}.
|
||||
\li Set \uicontrol {C++ Code Model} settings for the project.
|
||||
\endlist
|
||||
|
||||
\sa {Code Model}
|
||||
*/
|
||||
|
||||
/*!
|
||||
@@ -138,40 +164,43 @@
|
||||
|
||||
\brief Sets global preferences for the code model.
|
||||
|
||||
The Clang code model offers services such as code completion, syntactic and
|
||||
The code model offers services such as code completion, syntactic and
|
||||
semantic highlighting, and diagnostics.
|
||||
|
||||
To configure the Clang code model globally:
|
||||
To configure the C++ code model globally, go to \preferences >
|
||||
\uicontrol C++ > \uicontrol {Code Model}.
|
||||
|
||||
\list 1
|
||||
\image qtcreator-preferences-code-model.webp {C++ Code Model preferences}
|
||||
|
||||
\li Select \preferences > \uicontrol C++ >
|
||||
\uicontrol {Code Model}.
|
||||
|
||||
\image qtcreator-preferences-code-model.webp {C++ Code Model preferences}
|
||||
|
||||
\li To instruct the code model to interpret ambiguous header files as C
|
||||
language files if you develop mainly using C, select the
|
||||
\uicontrol {Interpret ambiguous headers as C headers} check box.
|
||||
|
||||
\li To process precompiled headers, deselect the
|
||||
\uicontrol {Ignore precompiled headers} check box.
|
||||
|
||||
\li To use the built-in preprocessor to show the
|
||||
pre-processed source file in the editor, select
|
||||
\uicontrol {Use built-in preprocessor to show pre-processed files}.
|
||||
The following table summarizes the preferences.
|
||||
|
||||
\table
|
||||
\header
|
||||
\li Setting
|
||||
\li Value
|
||||
\row
|
||||
\li \uicontrol {Interpret ambiguous headers as C headers}
|
||||
\li Instructs the code model to interpret ambiguous header files as C
|
||||
language files. Select this checkbox if you develop mainly using C.
|
||||
\row
|
||||
\li \uicontrol {Ignore precompiled headers}
|
||||
\li Clear this checkbox to process precompiled headers.
|
||||
\row
|
||||
\li \uicontrol {Use built-in preprocessor to show pre-processed files}
|
||||
\li Uses the built-in preprocessor to show the
|
||||
pre-processed source file in the editor.
|
||||
\row
|
||||
\li \uicontrol {Do not index files greater than}
|
||||
\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,
|
||||
edit the value for the \uicontrol {Do not index files greater than}
|
||||
check box. To index all files, deselect the check box.
|
||||
files to index is limited to 5MB by default.
|
||||
|
||||
\li To ignore files that match wildcard patterns, select the
|
||||
\uicontrol {Ignore files} check box and enter each wildcard pattern
|
||||
on a separate line in the field.
|
||||
|
||||
\endlist
|
||||
To index all files, clear the checkbox.
|
||||
\row
|
||||
\li \uicontrol {Ignore files}
|
||||
\li To ignore files that match wildcard patterns, enter each wildcard
|
||||
pattern on a separate line in the field.
|
||||
\endtable
|
||||
|
||||
\section1 Inspect preprocessed C++ code
|
||||
|
||||
@@ -186,7 +215,8 @@
|
||||
this action also expands all \c {"#include <foo.h>"} statements to their
|
||||
actual contents.
|
||||
|
||||
\sa {Specify clangd settings}, {Clang Code Model}, {Clangd}
|
||||
\sa {Configure C++ code model}, {Specify clangd settings},
|
||||
{Clang Code Model}, {Clangd}
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
@@ -85,6 +85,7 @@
|
||||
\li \l{Specify clangd settings}{Clangd}
|
||||
\li \l{Specify Clang tools settings}{Clang Tools}
|
||||
\li \l{Set Copilot preferences}{Copilot}
|
||||
\li \l{Configure C++ code model}{C++ Code Model}
|
||||
\li \l{Specify code style}{C++ Code Style}
|
||||
\li \l{Set C++ file naming preferences}{C++ File Naming}
|
||||
\li \l{Specify dependencies}{Dependencies}
|
||||
|
Reference in New Issue
Block a user