# 解析上下文

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/zh-cn/help/clion/llms.txt).

语法高亮以及其他代码智能功能（如 [查找用法](find-highlight-usages.html)、 [重构](refactoring-source-code.html)、 [代码生成](generating-code.html)和 [代码分析](code-inspection.html)）可能依赖于预处理器定义集，这些定义集决定了解析和解析代码的规则。 这些规则也被称为  解析上下文 。

> **Note:**
> 切换解析上下文仅适用于 [CMake](quick-cmake-tutorial.html)项目。 对于 [编译数据库](compilation-database.html)和 [Makefile](makefiles-support.html)项目，解析上下文是为每个源文件定义的。

Procedure: 为当前打开的文件（CMake 项目）切换解析上下文

对于 CMake 项目，解析上下文由相应的 [CMake 配置文件](cmake-profile.html)定义。

在切换器中选择所需的配置或配置文件。 解析上下文将自动切换。

![CMake 配置文件切换器](https://resources.jetbrains.com/help/img/idea/2026.3/cl_resolvecontext_configswitcher.png)

## See also

### 操作指南

[快速 CMake 教程](quick-cmake-tutorial.html) [CMake Profiles](cmake-profile.html)

