Skip to content

Commit f1b2a02

Browse files
authored
Merge pull request #11821 from TartanLlama/main
Document Problem Details window
2 parents 56e83f7 + ba6ee14 commit f1b2a02

File tree

7 files changed

+70
-7
lines changed

7 files changed

+70
-7
lines changed

docs/ide/reference/error-list-window.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.author: ghogen
1313
manager: jmartens
1414
ms.technology: vs-ide-general
1515
---
16-
# Error List Window
16+
# Error List window
1717

1818
[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)]
1919

@@ -69,26 +69,30 @@ You can copy the error list and save it to a file. Select the errors you want to
6969

7070
## UI Element List
7171

72-
Severity
72+
**Severity**
7373

7474
Displays the different types of **Error List** entry (**Error**, **Message**, **Warning**, **Warning (active)**, **Warning (inactive)**.
7575

76-
Code
76+
**Code**
7777

7878
Displays the error code.
7979

80-
Description
80+
**Description**
8181

8282
Displays the text of the entry.
8383

84-
Project
84+
**Project**
8585

8686
Displays the name of the current project.
8787

88-
File
88+
**File**
8989

9090
Displays the file name.
9191

92-
Line
92+
**Line**
9393

9494
Displays the line where the problem occurs.
95+
96+
**Details**
97+
98+
Displays a clickable icon to open the [Problem Details window](../../ide/reference/problem-details-window.md) if this entry has additional details.
Loading
Loading
Loading

docs/ide/reference/output-window.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ In C++, you can create custom build steps and build events whose warnings and er
6767

6868
If you use autoscrolling in the **Output** window and then navigate by using the mouse or arrow keys, autoscrolling stops. To resume autoscrolling, press **Ctrl**+**End**.
6969

70+
## Structured Diagnostics
71+
72+
C++ MSBuild projects might emit structured diagnostics. The level of indentation of a diagnostic in the **Output** window represents the nested structure of the information. Enable or disable indentation with the **Project** > **Properties** > **Advanced** > **Enable MSVC Structured Output** option. You can affect several projects by creating a [Directory.Build.props](/visualstudio/msbuild/customize-by-directory) file with the **UseStructuredOutput** property defined to true or false.
73+
7074
## See also
7175

7276
- [Diagnostic messages in the Output window](../../debugger/diagnostic-messages-in-the-output-window.md)
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: Problem Details Window
3+
description: Learn about the Problem Details window and how to use it to navigate structured diagnostics.
4+
ms.date: 10/24/2023
5+
ms.topic: reference
6+
helpviewer_keywords:
7+
- Problem Details window
8+
- build errors
9+
- Error List window../
10+
author: tartanllama
11+
ms.author: sybrand
12+
manager: mluparu
13+
ms.technology: vs-ide-general
14+
---
15+
16+
# Problem Details window
17+
18+
[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)]
19+
20+
The **Problem Details** window shows structured diagnostics issued by the MSVC compiler or [code analysis for C/C++](/cpp/code-quality/code-analysis-for-c-cpp-overview).
21+
22+
Select entries in the [**Error List** window](error-list-window.md) that show an icon in the **Details** column to open the **Problem Details** window. The **Problem Details** window shows the structured diagnostics for the selected entry.
23+
24+
:::image type="complex" source="media/error-list-details-column.png" alt-text="Screenshot of the Visual Studio Error List with one entry that has an icon in its details column.":::
25+
Screenshot of the Visual Studio Error List. It shows a table with a single row. The row represents a compiler error and contains the error code C2665, the description "pet: no overloaded function could convert all the argument types", and an icon of a square with the corner magnified in the column named Details. This icon is highlighted.
26+
:::image-end:::
27+
28+
Two scenarios produce these diagnostics:
29+
30+
- C++ compilations using [**MSBuild**](/cpp/build/creating-and-managing-visual-cpp-projects) and the MSVC compiler may emit structured diagnostics.
31+
- Code analysis warnings that support [**Key Event**](https://devblogs.microsoft.com/cppblog/microsoft-cpp-code-analysis-warnings-with-key-events) data emit structured diagnostics.
32+
33+
Open the **Problem Details** window by doing one of the following:
34+
35+
- While the entry is highlighted, double-click it or press **Enter**. Disable this behavior with **Tools** > **Options** > **Text Editor** > **C/C++** > **Advanced** > **Show Problem Details on Double Click**.
36+
- Select the icon in the **Details** column.
37+
- Open the shortcut menu for the entry and select the **Open Problem Details** option.
38+
39+
By default, the **Problem Details** window opens in the same location as the **Error List** window. Change where the **Problem Details** window opens by moving it to the desired position.
40+
41+
The **Problem Details** window displays structured information that may be nested. When the window opens, all entries that have nested children begin collapsed.
42+
43+
:::image type="complex" source="media/problem-details-collapsed.png" alt-text="Screenshot of the Visual Studio Problem Details window with all children collapsed.":::
44+
Screenshot of the Visual Studio Problem Details window. There is a header showing the same error code and description as the Error List entry from before. There is also a selectable link with the text cppcon-diag.cpp (Line 23). Below this header there are entries explaining that the potential overloads are void pet(cat), void pet(dog), or void pet(_T0). The final entry states "while trying to match the argument list (lizard)." To the right of each line is grey text showing the file and line numbers for each entry. All of them belong to cppcon-diag.cpp and the line numbers are 7, 6, 18, and 23, respectively. To the left of the first three entries are small hollow arrows pointing right that signify that these entries can be expanded, but are currently not.
45+
:::image-end:::
46+
47+
Expand an entry to view its children by either selecting the arrow at the left-hand side of an entry, or by pressing **Right** with the entry highlighted.
48+
49+
:::image type="complex" source="media/problem-details-expanded.png" alt-text="Screenshot of the Visual Studio Problem Details window with some children expanded.":::
50+
Screenshot of the Visual Studio Problem Details window. The contents are mostly the same as the previous screenshot, however some of the entries are expanded so their child entries are visible. The first entry is expanded. There is a nested entry with the text "void pet(cat) cannot convert argument 1 from lizard to cat." This entry is indented and can be expanded. The second line from before is expanded, revealing an unexpanded entry reading "void pet(dog) cannot convert argument 1 from lizard to dog." The third entry is expanded, revealing an entry reading "the associated constraints are not satisfied." This entry has an expanded child reading "the concept pettable lizard evaluated to false." This entry has two children. The first is unexpanded and reads "the concept has_member_pet lizard evaluated to false." The second is expanded and reads "the concept has_default_pet lizard evaluated to false." This second child has two children, neither of which is expandable. They read "is_pettable is not a member of lizard" and "see declaration of lizard."
51+
:::image-end:::
52+
53+
Enable or disable structured diagnostics with the **Project** > **Properties** > **Advanced** > **Enable MSVC Structured Output** option. You can affect several projects by creating a [Directory.Build.props](/visualstudio/msbuild/customize-by-directory) file with the **UseStructuredOutput** property defined to true or false.

docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,8 @@
991991
href: ide/reference/xaml-designer.md
992992
- name: Output window
993993
href: ide/reference/output-window.md
994+
- name: Problem Details window
995+
href: ide/reference/problem-details-window.md
994996
- name: Project Designer & project properties
995997
items:
996998
- name: Project Designer reference

0 commit comments

Comments
 (0)