跳到主要内容

GitHub Copilot

定义

GitHub Copilot is an AI assistant that suggests code completions and can generate code from comments or natural language. 它是 powered by LLMs trained on public code.

它专注于 inline completion and short generation (例如 from a comment or docstring). For deeper project context, chat, and edit-in-place, see Cursor. Both are examples of LLM-powered coding tools; Copilot is lightweight and IDE-agnostic.

工作原理

当你输入时,Copilot 建议补全(灰色幽灵文本);Tab 接受。当你添加注释或文档字符串时,它can generate a function or block. You can accept, edit, or reject. The model sees the current file and nearby context (and optionally other open files, depending on the IDE). Integrations exist for VS Code, JetBrains, Neovim, and others. Languages: most mainstream languages and frameworks are supported. Suggestions are based on public code and your current context; quality varies by language and task. No project-level rules; for project-specific behavior, use Cursor rules or similar.

应用场景

GitHub Copilot is for inline completions and generating code from comments across many languages and IDEs.

  • Inline code completion and snippet generation while coding
  • Generating functions or tests from comments or docstrings
  • Speeding up development across many languages and frameworks

外部文档

另请参阅