# 修复问题

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

默认情况下，CLion 会分析所有打开文件中的代码，并突出显示检测到的代码问题。 您可以通过 [应用快速修复](intention-actions.html)立即修复大多数问题。

将插入符号放在高亮显示的代码片段上，然后按 `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `⌥ ⏎` (Xcode), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Alt+Enter` (ReSharper), `⌥ ⏎` (ReSharper (macOS)), `Alt+Enter` (QtCreator), `⌥ ⏎` (QtCreator (macOS)), `Alt+Enter` (NetBeans), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS))：

![在编辑器中应用快速修复](https://resources.jetbrains.com/help/img/idea/2026.3/cl_inspection_fix.png)

您还可以将鼠标悬停在高亮显示的元素上，并从检查弹出窗口中应用快速修复：

![在编辑器中应用快速修复](https://resources.jetbrains.com/help/img/idea/2026.3/cl_inspection_fix_popup.png)

对于某些检查，您可以通过按 `Ctrl+Shift+I` (Windows), `⌥ Space` (macOS), `⌘ ⇧ I` (IntelliJ IDEA Classic (macOS)), `⌘ Y` (macOS System Shortcuts), `Ctrl+Shift+I` (XWin), `Ctrl+Shift+I` (GNOME), `Ctrl+Shift+I` (KDE), `Ctrl+Shift+I` (Emacs), `Ctrl+Shift+I` (Sublime Text), `⌥ Space` (Sublime Text (macOS)), `⌃ F1` (Xcode), `Alt+F12` (Visual Studio), `⌥ Space` (Visual Studio (macOS)), `Ctrl+Shift+I` (ReSharper), `⌥ Space` (ReSharper (macOS)), `Ctrl+Shift+I` (QtCreator), `Ctrl+Shift+I` (QtCreator (macOS)), `Ctrl+Shift+I` (NetBeans), `Ctrl+Shift+I` (Eclipse), `⌥ Space` (Eclipse (macOS))打开预览。

如果您在更大作用域的源文件中 [执行代码分析](running-inspections.html)或 [执行单个检查](running-inspections.html#run-one-inspection)，CLion 会在 [问题工具窗口](problems-tool-window.html)中显示检测到的代码问题。 当您在此窗口中选择特定问题时，其报告会显示在窗口的右侧部分。

> **Tip:**
> * 要在编辑器中显示问题的源代码，请在 [问题工具窗口](problems-tool-window.html)中选择问题时，切换 单击导航 ![单击导航](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.autoscrollToSource.svg) 按钮。
>
> * 如果您发现某些报告的问题较小或对您无帮助，您可以通过 [禁用](disabling-and-enabling-inspections.html)相应的检查或 [在特定代码片段中抑制](disabling-and-enabling-inspections.html#suppress-inspections)它来忽略这些问题。

Procedure: 从检查结果中应用快速修复

在 [问题工具窗口](problems-tool-window.html)中，选择问题并执行以下操作之一：

* 如果 CLion 提供了如上所述的任何修复建议，您可以使用其中之一立即修复问题：

![检查结果的快速修复](https://resources.jetbrains.com/help/img/idea/2026.3/cl_resolveProblems.png)

您还可以一次性批量应用多个问题的快速修复。 在结果描述选项卡中点击   部分修复  ：

![对多个检查结果应用快速修复](https://resources.jetbrains.com/help/img/idea/2026.3/cl_inspections_results_fixpartially.png)

或者，您可以选择多个问题，并从上下文菜单中选择适当的快速修复。

* 如果未建议任何解决方案，请使用上下文菜单中的  `跳转到源` 命令手动修复问题。

## 导出结果

您运行检查后，结果会显示在   问题   工具窗口的专用选项卡上。 您可以将它们导出为其中一种可用格式。

Procedure:

1. 在   问题  工具窗口（  `视图 | 工具窗口 | 问题` 或 `Alt+6` (Windows), `⌘ 6` (macOS), `⌘ 6` (IntelliJ IDEA Classic (macOS)), `⌘ 6` (macOS System Shortcuts), `Alt+6` (XWin), `Alt+6` (GNOME), `Alt+6` (KDE), `Alt+6` (Emacs), `Alt+6` (Sublime Text), `⌘ 6` (Sublime Text (macOS)), `Alt+6` (Xcode), `Alt+6` (Visual Studio), `⌘ 6` (Visual Studio (macOS)), `Alt+6` (ReSharper), `⌘ 6` (ReSharper (macOS)), `Alt+1` (QtCreator), `⌘ 1` (QtCreator (macOS)), `Alt+6` (NetBeans), `Alt+6` (Eclipse), `⌘ 6` (Eclipse (macOS))）中，切换到包含您想要导出的检查结果的选项卡，然后点击 ![导出按钮](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.general.export.svg)。

![“Inspection Results 工具窗口中的 Export 按钮”](https://resources.jetbrains.com/help/img/idea/2026.3/cl_export_inspection_results.png)

2. 选择您要保存报告的格式：   HTML   或   XML  。

3. 指定目标目录，然后点击   保存  。

## See also

### 概念

[静态代码分析](code-inspection.html)

### 操作指南

[意图操作](intention-actions.html)

### 参考

[问题工具窗口](problems-tool-window.html)

