line chat, and type: /explain
def calculate_average(
看其他人编写的代码。
自动测试生成
单元测试对于确保代码质量和可靠性至关重要。 Copilot 可以通过
为函数或类生成单元测试来节省时间和精力。
选择函数或类。
使用命令面板选择 Copilot:生成单元测试
。
查看 Copilot 为代码建议的测试用例。
下面是一个示例:
Python
def add(a,
本文转载自:Microsoft Learn
原文链接:https://learn.microsoft.com/zh-cn/training/modules/introduction-to-github-copilot/3-interacting-with-copilot
本文由 XZ导师app 自动发布 | 发布时间:2026/8/11 17:35:07