{"meta":{"title":"GitHub Copilot Chat 指南","intro":"查找与 GitHub Copilot 聊天功能 配合使用的提示示例。","product":"GitHub Copilot","breadcrumbs":[{"href":"/zh/copilot","title":"GitHub Copilot"},{"href":"/zh/copilot/tutorials","title":"教程"},{"href":"/zh/copilot/tutorials/copilot-chat-cookbook","title":"GitHub Copilot Chat 指南"}],"documentType":"subcategory"},"body":"# GitHub Copilot Chat 指南\n\n查找与 GitHub Copilot 聊天功能 配合使用的提示示例。\n\n## Spotlight\n\n* [生成单元测试](/zh/copilot/tutorials/copilot-chat-cookbook/testing-code/generate-unit-tests)\n\n  副驾驶聊天 可帮助生成函数的单元测试。 (Image: /assets/images/copilot-landing/generating\\_unit\\_tests.png)\n\n* [提高代码可读性和可维护性](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/improve-code-readability)\n\n  副驾驶聊天 可以建议使代码更易于理解和维护的方法。 (Image: /assets/images/copilot-landing/improving\\_code\\_readability.png)\n\n* [调试无效的 JSON](/zh/copilot/tutorials/copilot-chat-cookbook/debug-errors/debug-invalid-json)\n\n  副驾驶聊天 能够识别并解决 JSON 数据中的语法错误或结构问题。 (Image: /assets/images/copilot-landing/debugging\\_invalid\\_json.png)\n\n## Links\n\n* [创建模板](/zh/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/creating-templates)\n\n  副驾驶聊天 可帮助你创建模板，以便简化工作流并确保项目间的一致性。\n\n* [提取信息](/zh/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/extracting-information)\n\n  GitHub中的 Copilot Chat 可以帮助你从问题和讨论中提取关键信息。\n\n* [合成研究](/zh/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/synthesizing-research)\n\n  Copilot 对话助手可帮助你将来自多个来源的研究结果和见解合成为一份连贯的摘要。\n\n* [创建关系图](/zh/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/creating-diagrams)\n\n  GitHub Copilot Chat 可以帮助你创建图表，以便更好地了解数据并传达见解。\n\n* [表格生成](/zh/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/generating-tables)\n\n  副驾驶聊天 可以帮助你创建表，以便组织信息并清晰呈现。\n\n* [调试无效的 JSON](/zh/copilot/tutorials/copilot-chat-cookbook/debug-errors/debug-invalid-json)\n\n  副驾驶聊天 能够识别并解决 JSON 数据中的语法错误或结构问题。\n\n* [处理 API 速率限制](/zh/copilot/tutorials/copilot-chat-cookbook/debug-errors/handle-api-rate-limits)\n\n  副驾驶聊天 可以通过建议检测速率限制并实现重试逻辑的代码，来帮助处理 API 速率限制问题。\n\n* [诊断测试中的失败](/zh/copilot/tutorials/copilot-chat-cookbook/debug-errors/diagnose-test-failures)\n\n  副驾驶聊天 可以帮助了解测试失败的原因，并建议解决方法。\n\n* [探索潜在的功能实现](/zh/copilot/tutorials/copilot-chat-cookbook/analyze-functionality/explore-implementations)\n\n  副驾驶聊天 可以帮助探索实现单一功能的不同方法。\n\n* [分析和采纳用户反馈](/zh/copilot/tutorials/copilot-chat-cookbook/analyze-functionality/analyze-feedback)\n\n  副驾驶聊天 可以加强将用户反馈纳入项目的过程。\n\n* [提高代码可读性和可维护性](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/improve-code-readability)\n\n  副驾驶聊天 可以建议使代码更易于理解和维护的方法。\n\n* [修复 lint 错误](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/fix-lint-errors)\n\n  副驾驶聊天 可以建议修复由代码 linter 标识的问题的方法。\n\n* [为性能优化而重构](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-for-optimization)\n\n  副驾驶聊天 可以提出加快运行缓慢的代码的方法建议。\n\n* [为环境可持续性进行重构](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-for-sustainability)\n\n  副驾驶聊天 可以建议如何使代码更加环保。\n\n* [重构以实现设计模式](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-design-patterns)\n\n  副驾驶聊天 可以建议可用于改进代码的设计模式。\n\n* [重构数据访问层](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-data-access-layers)\n\n  副驾驶聊天 可以建议将数据访问代码与业务逻辑分离的方法，从而使应用程序更易于维护和缩放。\n\n* [将业务逻辑从 UI 组件中分离出来](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/decouple-business-logic)\n\n  副驾驶聊天 可帮助你将业务逻辑与用户界面代码分离，从而更易于维护和缩放你的应用程序。\n\n* [处理横切关注点](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/handle-cross-cutting)\n\n  副驾驶聊天 可帮助避免与代码所在方法或函数的核心关注点以外的关注点相关的代码。\n\n* [简化复杂的继承层次结构](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/simplify-inheritance-hierarchies)\n\n  副驾驶聊天 可帮助你重构代码，以避免具有多层继承的类。\n\n* [修复数据库死锁或数据一致性问题](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/fix-database-deadlocks)\n\n  副驾驶聊天 可帮助避免编写导致数据库操作缓慢、阻塞，或产生缺失/错误数据的代码。\n\n* [将代码转换为其他编程语言](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/translate-code)\n\n  副驾驶聊天 可以帮助你重写代码以便执行相同的操作，但采用不同的编程语言。\n\n* [创建问题](/zh/copilot/tutorials/copilot-chat-cookbook/document-code/creating-issues)\n\n  副驾驶聊天 可以帮助你快速创建问题，而不需要你手动填写每一字段。\n\n* [为旧代码编写文档](/zh/copilot/tutorials/copilot-chat-cookbook/document-code/document-legacy-code)\n\n  副驾驶聊天 可帮助记录旧代码。\n\n* [解释旧代码](/zh/copilot/tutorials/copilot-chat-cookbook/document-code/explain-legacy-code)\n\n  副驾驶聊天 能够帮助解释不熟悉的代码。\n\n* [解释复杂算法或逻辑](/zh/copilot/tutorials/copilot-chat-cookbook/document-code/explain-complex-logic)\n\n  副驾驶聊天 可以帮助添加关于复杂算法或逻辑的清晰简洁的文档。\n\n* [同步文档以适应代码更改](/zh/copilot/tutorials/copilot-chat-cookbook/document-code/sync-documentation)\n\n  副驾驶聊天 可帮助使代码文档保持最新状态。\n\n* [撰写讨论或博客文章](/zh/copilot/tutorials/copilot-chat-cookbook/document-code/write-discussions-or-blog-posts)\n\n  副驾驶聊天 可帮助你为讨论或博客文章生成创意、大纲或草稿。\n\n* [生成单元测试](/zh/copilot/tutorials/copilot-chat-cookbook/testing-code/generate-unit-tests)\n\n  副驾驶聊天 可帮助生成函数的单元测试。\n\n* [创建模拟对象来使层抽象化](/zh/copilot/tutorials/copilot-chat-cookbook/testing-code/create-mock-objects)\n\n  副驾驶聊天 可帮助创建模拟对象用于单元测试。\n\n* [为网页创建端到端测试](/zh/copilot/tutorials/copilot-chat-cookbook/testing-code/create-end-to-end-tests)\n\n  副驾驶聊天 可帮助生成端到端测试。\n\n* [更新单元测试以匹配代码更改](/zh/copilot/tutorials/copilot-chat-cookbook/testing-code/update-unit-tests)\n\n  副驾驶聊天 可帮助更新测试。\n\n* [保护您的仓库](/zh/copilot/tutorials/copilot-chat-cookbook/analyze-security/secure-your-repository)\n\n  副驾驶聊天 可以帮助保护仓库和代码。\n\n* [管理依赖项更新](/zh/copilot/tutorials/copilot-chat-cookbook/analyze-security/manage-dependency-updates)\n\n  副驾驶聊天 可以帮助你设置 Dependabot 以简化依赖项更新。\n\n* [在代码中查找现有漏洞](/zh/copilot/tutorials/copilot-chat-cookbook/analyze-security/find-vulnerabilities)\n\n  Copilot Chat 可以帮助查找代码中的常见漏洞并提供修复建议。"}