Code Model
The Clang code model offers services such as code completion, syntactic and semantic highlighting, and diagnostics.
To configure the Clang code model globally:
- Select Preferences > C++ > Code Model.
- To instruct the code model to interpret ambiguous header files as C language files if you develop mainly using C, select the Interpret ambiguous headers as C headers check box.
- To process precompiled headers, deselect the Ignore precompiled headers check box.
- When you select 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 Use built-in preprocessor to show pre-processed files check box. For more information, see Inspecting Preprocessed C++ Code.
- 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 Do not index files greater than check box. To index all files, deselect the check box.
- To ignore files that match wildcard patterns, select the Ignore files check box and enter each wildcard pattern on a separate line in the field.
See also Specify clangd settings, Clang Code Model, and Clangd.