Skip to content

Commit f405ad5

Browse files
authored
Add step to use doc slash command to document the newly added function in add endpoint module
Added a link to inline chat in resources
1 parent 3ab0095 commit f405ad5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

content/1-hour/1-add-endpoint.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ Let's build our new route in our Flask backend with the help of code completion.
6868
> [!IMPORTANT]
6969
> Because LLMs are probabilistic, not deterministic, the exact code generated can vary. The above is a representative example. If your code is different, that's just fine as long as it works!
7070

71-
8. **Save** the file.
71+
8. Add a comment to the newly created function. To do this, place your cursor inside the function (anywhere between the lines `def get_breeds...` and `return jsonify...`). Then, press <kbd>cmd/control</kbd>+<kbd>I</kbd> or right-click and select `Copilot -> Editor Inline Chat` to open the editor inline chat. In the input box, type `/doc` (you can optionally provide additional details, but it's not required). This will prompt GitHub Copilot to generate a documentation comment for the function. The suggested comment will appear inline in the code (highlighted in green). Click `Accept` to apply the comment to your code, or click `Close` to discard the suggestion. You just used a slash command, a shortcut to streamline a task, these commands eliminate the need for verbose prompts.
72+
73+
9. **Save** the file.
7274

7375
## Validate the endpoint
7476

@@ -85,6 +87,7 @@ You've added a new endpoint with the help of GitHub Copilot! You saw how Copilot
8587
- [Code suggestions in your IDE with GitHub Copilot][copilot-suggestions]
8688
- [Code completions with GitHub Copilot in VS Code][vscode-copilot]
8789
- [Prompt crafting][prompt-crafting]
90+
- [Inline chat][inline-chat]
8891

8992

9093
| [← Workshop setup][walkthrough-previous] | [Next: Helping GitHub Copilot understand context →][walkthrough-next] |
@@ -96,6 +99,7 @@ You've added a new endpoint with the help of GitHub Copilot! You saw how Copilot
9699
[flask-routing]: https://flask.palletsprojects.com/en/stable/quickstart/#routing
97100
[http-methods]: https://www.w3schools.com/tags/ref_httpmethods.asp
98101
[prompt-crafting]: https://code.visualstudio.com/docs/copilot/prompt-crafting
102+
[inline-chat]: https://code.visualstudio.com/docs/copilot/chat/inline-chat
99103
[server-code]: /server/
100104
[vscode-copilot]: https://code.visualstudio.com/docs/copilot/ai-powered-suggestions
101105
[walkthrough-previous]: ./0-setup.md

0 commit comments

Comments
 (0)