Skip to main content

Asking GitHub Copilot questions in your IDE

Use Copilot Chat in your editor to give code suggestions, explain code, generate unit tests, and suggest code fixes.

Prerequisites

조직를 통해 GitHub Copilot에 액세스할 수 있는 경우 조직 소유자가 채팅을 사용하지 않도록 설정한 경우 GitHub Copilot Chat을(를) 사용할 수 없습니다. 조직에서 Copilot에 대한 정책 관리을(를) 참조하세요.

Submitting prompts

You can ask Copilot Chat to give code suggestions, explain code, generate unit tests, and suggest code fixes.

  1. 채팅 보기를 열려면 활동 모음에서 채팅 아이콘을 클릭하거나 Control+Command+i (Mac) / Ctrl+Alt+i (Windows/Linux)를 누릅니다.

    Screenshot of the Copilot Chat icon in the Activity Bar.

    Tip

    For additional ways to access Copilot Chat, including inline with your code, see Additional ways to access Copilot Chat below.

  2. Enter a prompt in the prompt box, or click one of the suggested prompts. For an introduction to the kinds of prompts you can use, see Getting started with prompts for Copilot Chat.

  3. Evaluate Copilot's response, and make a follow up request if needed.

    The response may contain text, code blocks, buttons, images, URIs, and file trees. The response often includes interactive elements. For example, the response may include a menu to insert a code block, or a button to invoke a Visual Studio Code command.

    To see the files that Copilot Chat used to generate the response, select the Used n references dropdown at the top of the response. The references may include a link to a custom instructions file for your repository. This file contains additional information that is automatically added to all of your chat questions to improve the quality of the responses. For more information, see Adding repository custom instructions for GitHub Copilot.

Using keywords in your prompt

You can use special keywords to help Copilot understand your prompt. For examples, see Getting started with prompts for Copilot Chat.

Chat participants

Chat participants are like domain experts who have a specialty that they can help you with.

Copilot Chat can infer relevant chat participants based on your natural language prompt, improving discovery of advanced capabilities without you having to explicitly specify the participant you want to use in your prompt.

Note

Automatic inference for chat participants is currently in 공개 미리 보기 and is subject to change.

Alternatively, you can manually specify a chat participant to scope your prompt to a specific domain. To do this, type @ in the chat prompt box, followed by a chat participant name.

For a list of available chat participants, type @ in the chat prompt box. See also GitHub Copilot Chat cheat sheet or Chat participants in the Visual Studio Code documentation.

Copilot Extensions chat participants

You can also install Copilot Extensions that provide chat participants. You can install these extensions from GitHub Marketplace and from Visual Studio Code Marketplace. For information about extensions from GitHub Marketplace that provide chat participants, see 확장을 사용하여 외부 도구를 Copilot 채팅과 통합.

Note

GitHub Copilot Extensions은(는) 공개 미리 보기 버전이며 변경될 수 있습니다.

Slash commands

Use slash commands to avoid writing complex prompts for common scenarios. To use a slash command, type / in the chat prompt box, followed by a command.

To see all available slash commands, type / in the chat prompt box. See also GitHub Copilot Chat cheat sheet or Slash commands in the Visual Studio Code documentation.

Chat variables

Use chat variables to include specific context in your prompt. To use a chat variable, type # in the chat prompt box, followed by a chat variable.

To see all available chat variables, type # in the chat prompt box. See also GitHub Copilot Chat cheat sheet or Chat variables in the Visual Studio Code documentation.

Using GitHub skills for Copilot

Note

This functionality is available with the Copilot Chat extension v0.20.3 or later and VS Code or VS Code Insiders 1.93 or later.

Copilot's GitHub-specific skills expand the type of information Copilot can provide. To access these skills in Copilot Chat, include @github in your question.

When you add @github to a question, Copilot dynamically selects an appropriate skill, based on the content of your question. You can also explicitly ask Copilot Chat to use a particular skill. You can do this in two ways:

  • Use natural language to ask Copilot Chat to use a skill. For example, @github Search the web to find the latest GPT model from OpenAI.
  • To specifically invoke a web search you can include the #web variable in your question. For example, @github #web What is the latest LTS of Node.js?

You can generate a list of currently available skills by asking Copilot: @github What skills are available?

AI models for Copilot Chat

Copilot에서 채팅 프롬프트에 대한 응답을 생성하는 데 사용하는 큰 언어 모델을 변경할 수 있습니다. 질문 유형에 따라 다른 모델이 더 잘 수행되거나 더 유용한 응답을 제공할 수 있습니다. 자세한 내용은 Copilot Chat에 대한 AI 모델 변경을(를) 참조하세요.

Additional ways to access Copilot Chat

In addition to submitting prompts through the chat view, you can submit prompts in other ways:

  • Inline: To start an inline chat directly in the editor or integrated terminal, enter Command+i (Mac) / Ctrl+i (Windows/Linux).
  • Quick chat: To open the quick chat dropdown, enter Shift+Command+i (Mac) / Shift+Ctrl+i (Windows/Linux)
  • Smart actions: To submit prompts via the context menu, right click in your editor, select Copilot in the menu that appears, then select one of the actions. Smart actions can also be accessed via the sparkle icon that sometimes appears when you select a line of code.

See inline chat, quick chat, and chat smart actions in the Visual Studio Code documentation for more details.

Copilot Edits

Copilot Edits을 사용하여 단일 Copilot Chat 프롬프트에서 직접 여러 파일을 변경합니다. Copilot Edits에는 다음과 같은 모드가 있습니다.

  • 편집 모드: Copilot에서 제안하는 편집 내용을 보다 세부적으로 제어하려면 편집 모드를 사용합니다. 편집 모드에서는 Copilot이 변경할 수 있는 파일을 선택하고, 반복할 때마다 Copilot에 컨텍스트를 제공하고, 각 차례 후에 제안된 편집 내용을 수락할지 여부를 결정합니다.
  • 에이전트 모드(퍼블릭 미리 보기): 특정 작업을 염두에 두고 Copilot이 코드를 자동으로 편집하려는 경우 에이전트 모드를 사용합니다. 에이전트 모드에서는 Copilot이 변경할 파일을 결정하고, 작업을 완료하기 위한 코드 변경 및 터미널 명령을 제공하고, 원래 작업이 완료될 때까지 문제를 해결하기 위해 반복합니다.

Using edit mode

  1. To start an edit session, select Open Copilot Edits from the Copilot Chat menu.
  2. Optionally, add relevant files to the working set to indicate to GitHub Copilot which files you want to work on.
  3. Submit a prompt. In response to your prompt, Copilot Edits determines which files in your working set to change and adds a short description of the change.
  4. Review the changes and Apply or Discard the edits for each file.

For more detailed instructions, see Copilot Edits in the Visual Studio Code documentation.

Using agent mode

Note

에이전트 모드는 현재 VS Code 참가자에 공개 미리 보기로 제공되며 변경될 수 있습니다. Visual Studio Code 설명서의 Copilot Edits를 참조하세요.

  1. To start an edit session, select Open Copilot Edits from the Copilot Chat menu.
  2. Select Agent from the mode dropdown menu.
  3. Submit a prompt. In response to your prompt, Copilot streams the edits in the editor, updates the working set, and if necessary, suggests terminal commands to run.
  4. Review the changes. If Copilot suggested terminal commands, confirm whether or not Copilot can run them. In response, Copilot iterates and performs additional actions to complete the task in your original prompt.

For more information, see Copilot Edits in the Visual Studio Code documentation.

Vision

Note

Vision is currently available to VS Code Insiders as a 공개 미리 보기 and is subject to change.

Vision requires that you use the GPT-4o model and upload one of the following file types: JPEG (.jpg, .jpeg), PNG (.png), GIF (.gif), or WEBP (.webp).

You can attach images to your chat prompts to help Copilot understand your question. For example, you can attach a screenshot of a code snippet to ask Copilot to explain the code, or share mockups of new designs to ask Copilot to generate code.

You can drag and drop images into the chat window, or attach them through the VS Code UI.

Sharing feedback

To indicate whether a response was helpful, use the thumbs up and thumbs down icons that appear next to the response.

To leave feedback about the GitHub Copilot Chat extension, open an issue in the microsoft/vscode-copilot-release repository.

Further reading

Prerequisites

조직를 통해 GitHub Copilot에 액세스할 수 있는 경우 조직 소유자가 채팅을 사용하지 않도록 설정한 경우 GitHub Copilot Chat을(를) 사용할 수 없습니다. 조직에서 Copilot에 대한 정책 관리을(를) 참조하세요.

Submitting prompts

You can ask Copilot Chat to give code suggestions, explain code, generate unit tests, and suggest code fixes.

  1. In the Visual Studio menu bar, click View, then click GitHub Copilot Chat.

  2. In the Copilot Chat window, enter a prompt, then press Enter. For example prompts, see Getting started with prompts for Copilot Chat.

  3. Evaluate Copilot's response, and submit a follow up prompt if needed.

    The response often includes interactive elements. For example, the response may include buttons to copy, insert, or preview the result of a code block.

    To see the files that Copilot Chat used to generate the response, click the References link below the response. The references may include a link to a custom instructions file for your repository. This file contains additional information that is automatically added to all of your chat questions to improve the quality of the responses. For more information, see Adding repository custom instructions for GitHub Copilot.

Using keywords in your prompt

You can use special keywords to help Copilot understand your prompt.

Extending Copilot Chat

Note

GitHub Copilot Extensions은(는) 공개 미리 보기 버전이며 변경될 수 있습니다.

GitHub Copilot Extensions은(는) 외부 도구의 기능을 Copilot Chat에 통합하여 컨텍스트 전환을 줄이고 도메인별 컨텍스트로 응답을 받을 수 있도록 지원합니다. GitHub Marketplace에서 Copilot Extensions을(를) 설치하거나 조직 내에서 비공개로 구축한 다음 채팅 창에 @을(를) 입력하면 사용 가능한 확장 프로그램 목록을 볼 수 있습니다. 확장을 사용하려면 목록에서 확장을 선택하거나 전체 슬러그 이름을 입력한 다음 프롬프트를 입력합니다.

자세히 알아보려면 확장을 사용하여 외부 도구를 Copilot 채팅과 통합을(를) 참조하세요.

Slash commands

Use slash commands to avoid writing complex prompts for common scenarios. To use a slash command, type / in the chat prompt box, followed by a command.

To see all available slash commands, type / in the chat prompt box. See also GitHub Copilot Chat cheat sheet or Slash commands in the Visual Studio documentation.

References

By default, Copilot Chat will reference the file that you have open or the code that you have selected. You can also use # followed by a file name, file name and line numbers, or solution to reference a specific file, lines, or solution.

See also GitHub Copilot Chat cheat sheet or Reference in the Visual Studio documentation.

Using GitHub skills for Copilot (preview)

Note

The @github chat participant is currently in preview, and only available in Visual Studio 2022 Preview 2 onwards.

Copilot's GitHub-specific skills expand the type of information Copilot can provide. To access these skills in Copilot Chat in Visual Studio, include @github in your question.

When you add @github to a question, Copilot dynamically selects an appropriate skill, based on the content of your question. You can also explicitly ask Copilot Chat to use a particular skill. For example, @github Search the web to find the latest GPT4 model from OpenAI.

You can generate a list of currently available skills by asking Copilot: @github What skills are available?

AI models for Copilot Chat

Copilot에서 채팅 프롬프트에 대한 응답을 생성하는 데 사용하는 큰 언어 모델을 변경할 수 있습니다. 질문 유형에 따라 다른 모델이 더 잘 수행되거나 더 유용한 응답을 제공할 수 있습니다. 자세한 내용은 Copilot Chat에 대한 AI 모델 변경을(를) 참조하세요.

Additional ways to access Copilot Chat

In addition to submitting prompts through the chat window, you can submit prompts inline. To start an inline chat, right click in your editor window and select Ask Copilot.

See Ask questions in the inline chat view in the Visual Studio documentation for more details.

Sharing feedback

To share feedback about Copilot Chat, you can use the Send feedback button in Visual Studio. For more information on providing feedback for Visual Studio, see the Visual Studio Feedback documentation.

  1. In the top right corner of the Visual Studio window, click the Send feedback button.

    Screenshot of the share feedback button in Visual Studio.

  2. Choose the option that best describes your feedback.

    • To report a bug, click Report a problem.
    • To request a feature, click Suggest a feature.

Further reading

Prerequisites

조직를 통해 GitHub Copilot에 액세스할 수 있는 경우 조직 소유자가 채팅을 사용하지 않도록 설정한 경우 GitHub Copilot Chat을(를) 사용할 수 없습니다. 조직에서 Copilot에 대한 정책 관리을(를) 참조하세요.

Submitting prompts

You can ask Copilot Chat to give code suggestions, explain code, generate unit tests, and suggest code fixes.

  1. Open the Copilot Chat window by clicking the Copilot Chat icon at the right side of the JetBrains IDE window.

    Screenshot of the Copilot Chat icon in the Activity Bar.

  2. Enter a prompt in the prompt box. For example prompts, see Getting started with prompts for Copilot Chat.

  3. Evaluate Copilot's response, and submit a follow up prompt if needed.

    The response often includes interactive elements. For example, the response may include buttons to copy or insert a code block.

    To see the files that Copilot Chat used to generate the response, select the References dropdown below the response.

Using keywords in your prompt

You can use special keywords to help Copilot understand your prompt.

Chat participants

Chat participants are like domain experts who have a specialty that they can help you with. You can use a chat participant to scope your prompt to a specific domain. To do this, type @ in the chat prompt box, followed by a chat participant name.

For a list of available chat participants, type @ in the chat prompt box. See also GitHub Copilot Chat cheat sheet.

Extending Copilot Chat

Note

GitHub Copilot Extensions은(는) 공개 미리 보기 버전이며 변경될 수 있습니다.

GitHub Copilot Extensions은(는) 외부 도구의 기능을 Copilot Chat에 통합하여 컨텍스트 전환을 줄이고 도메인별 컨텍스트로 응답을 받을 수 있도록 지원합니다. GitHub Marketplace에서 Copilot Extensions을(를) 설치하거나 조직 내에서 비공개로 구축한 다음 채팅 창에 @을(를) 입력하면 사용 가능한 확장 프로그램 목록을 볼 수 있습니다. 확장을 사용하려면 목록에서 확장을 선택하거나 전체 슬러그 이름을 입력한 다음 프롬프트를 입력합니다.

자세히 알아보려면 확장을 사용하여 외부 도구를 Copilot 채팅과 통합을(를) 참조하세요.

Slash commands

Use slash commands to avoid writing complex prompts for common scenarios. To use a slash command, type / in the chat prompt box, followed by a command.

To see all available slash commands, type / in the chat prompt box. See also GitHub Copilot Chat cheat sheet

File references

By default, Copilot Chat will reference the file that you have open or the code that you have selected. You can also tell Copilot Chat which files to reference by dragging a file into the chat prompt box. Alternatively, you can right click on a file, select GitHub Copilot, then select Reference File in Chat.

Using GitHub skills for Copilot

Copilot's GitHub-specific skills expand the type of information Copilot can provide. To access these skills in Copilot Chat, include @github in your question.

When you add @github to a question, Copilot dynamically selects an appropriate skill, based on the content of your question. You can also explicitly ask Copilot Chat to use a particular skill. You can do this in two ways:

  • Use natural language to ask Copilot Chat to use a skill. For example, @github Search the web to find the latest GPT model from OpenAI.
  • To specifically invoke a web search you can include the #web variable in your question. For example, @github #web What is the latest LTS of Node.js?

You can generate a list of currently available skills by asking Copilot: @github What skills are available?

Additional ways to access Copilot Chat

  • Built-in requests. In addition to submitting prompts through the chat window, you can submit built-in requests by right clicking in a file, selecting GitHub Copilot, then selecting one of the options.
  • Inline. You can submit a chat prompt inline, and scope it to a highlighted code block or your current file.
    • To start an inline chat, right click on a code block or anywhere in your current file, hover over GitHub Copilot, then select Copilot: Inline Chat, or enter Ctrl+Shift+I.

Sharing feedback

To share feedback about Copilot Chat, you can use the share feedback link in JetBrains.

  1. At the right side of the JetBrains IDE window, click the Copilot Chat icon to open the Copilot Chat window.

    Screenshot of the Copilot Chat icon in the Activity Bar.

  2. At the top of the Copilot Chat window, click the share feedback link.

    Screenshot of the share feedback link in the Copilot Chat window.

Further reading

Note

Copilot Chat in Xcode is in 공개 미리 보기 and subject to change.

Prerequisites

To use GitHub Copilot for Xcode, you must install the GitHub Copilot for Xcode extension. See 사용자 환경에 GitHub Copilot 확장 설치.

조직를 통해 GitHub Copilot에 액세스할 수 있는 경우 조직 소유자가 채팅을 사용하지 않도록 설정한 경우 GitHub Copilot Chat을(를) 사용할 수 없습니다. 조직에서 Copilot에 대한 정책 관리을(를) 참조하세요.

Submitting prompts

You can ask Copilot Chat to give code suggestions, explain code, generate unit tests, and suggest code fixes.

  1. To open the chat view, click Copilot in the menu bar, then click Open Chat.

  2. Enter a prompt in the prompt box. For example prompts, see Getting started with prompts for Copilot Chat.

  3. Evaluate Copilot's response, and submit a follow up prompt if needed.

    The response often includes interactive elements. For example, the response may include buttons to copy or insert a code block.

Using keywords in your prompt

You can use special keywords to help Copilot understand your prompt.

Slash commands

Use slash commands to avoid writing complex prompts for common scenarios. To use a slash command, type / in the chat prompt box, followed by a command.

To see all available slash commands, type / in the chat prompt box. For more information, see GitHub Copilot Chat cheat sheet.

File references

By default, Copilot Chat will reference the file that you have open or the code that you have selected. To attach a specific file as reference, click in the chat prompt box.

Chat management

You can open a conversation thread for each Xcode IDE to keep discussions organized across different contexts. You can also revisit previous conversations and reference past suggestions through the chat history.

Sharing feedback

To indicate whether a response was helpful, use or that appear next to the response.

Further reading