Skip to content

Commit 8d8b2d0

Browse files
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]>
1 parent 040a88e commit 8d8b2d0

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

hub/apps/how-tos/github-copilot-winui-vs.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,18 @@ Alternatively, for inline completions you can use temporary comments to paste th
8080

8181
:::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).":::
8282

83-
### Ask Copilot to explain how something works with inline comments
83+
### Ask Copilot to explain how something works
8484

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.
8686

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.
8895
8996
### Use Copilot to test code standards
9097

@@ -117,7 +124,7 @@ In this how-to, we demonstrated how to use GitHub Copilot in Visual Studio to as
117124
- Generate autocomplete suggestions inline with Ask Copilot.
118125
- Prompt Copilot with plain-language comments.
119126
- 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.
121128
- Use Copilot to test and enforce code standards.
122129
- Identify and correct UWP patterns that Copilot may suggest in WinUI 3 projects.
123130

0 commit comments

Comments
 (0)