You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace stale inline-comment explain section with Copilot Actions > Explain
The inline comment explain trick no longer works reliably. Modern approach:
- Select code > right-click > Copilot Actions > Explain
- Or use /explain slash command in Chat panel
Also adds a tip about other slash commands (/fix, /doc).
Co-authored-by: Copilot <[email protected]>
Copy file name to clipboardExpand all lines: hub/apps/how-tos/github-copilot-winui-vs.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,11 +80,18 @@ Alternatively, for inline completions you can use temporary comments to paste th
80
80
81
81
:::image type="content" source="images/github-copilot-winui-vs/4-add-context-temporary-comments.png" alt-text="Screenshot that shows the code completion capabilities of GitHub Copilot (context expansion).":::
82
82
83
-
### Ask Copilot to explain how something works with inline comments
83
+
### Ask Copilot to explain how something works
84
84
85
-
You can use inline comments to ask Copilot to explain how a specific piece of code works. This is similar to using the inline Ask Copilot feature or the Copilot Chat window, except your prompt is typed directly into the code editor:
85
+
The best way to ask Copilot to explain code is to select it in the editor, then right-click and choose **Copilot Actions** > **Explain**. This opens the Chat panel with your selected code already attached as context, and Copilot provides a detailed explanation.
86
86
87
-
:::image type="content" source="images/github-copilot-winui-vs/5-ask-copilot-inline-explanation.png" alt-text="Screenshot that shows the code completion capabilities of GitHub Copilot (explain).":::
87
+
You can also ask for explanations directly in the Chat panel using the `/explain` slash command:
88
+
89
+
```
90
+
/explain What does this DispatcherQueue.TryEnqueue call do?
91
+
```
92
+
93
+
> [!TIP]
94
+
> Slash commands like `/explain`, `/fix`, and `/doc` are shortcuts in the Chat panel that tell Copilot exactly what kind of help you want. Type `/` in the Chat input to see all available commands.
88
95
89
96
### Use Copilot to test code standards
90
97
@@ -117,7 +124,7 @@ In this how-to, we demonstrated how to use GitHub Copilot in Visual Studio to as
117
124
- Generate autocomplete suggestions inline with Ask Copilot.
118
125
- Prompt Copilot with plain-language comments.
119
126
- Use `#file` references or temporary comments to add context from other files.
120
-
- Ask Copilot to explain how something works with inline comments.
127
+
- Ask Copilot to explain code using **Copilot Actions** > **Explain** or the `/explain` slash command in Chat.
121
128
- Use Copilot to test and enforce code standards.
122
129
- Identify and correct UWP patterns that Copilot may suggest in WinUI 3 projects.
0 commit comments