Skip to main content
Skip to content

Asking GitHub Copilot questions in your IDE

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

Introduction

This guide describes how to use Copilot Chat and agents to automate coding tasks by breaking them into steps, using tools to read files, edit code, and run commands, and self-correcting when something goes wrong. You can also ask general questions about software development, or specific questions about the code in your project. For more information, see О GitHub Copilot Chat.

To learn how to use Copilot for agent-driven workflows in a desktop app, see Начало работы с GitHub приложение Copilot.

Prerequisites

Если у вас есть доступ через GitHub Copilot организацию или предприятие, вы не сможете использовать, если владелец организацииGitHub Copilot Chat или администратор предприятия отключил чат. См . раздел AUTOTITLE.

Chat modes

You can use Copilot Chat in the following modes:

  • Ask mode: to get answers to coding questions and get Copilot to provide code suggestions.
  • Agent mode: to get Copilot to autonomously accomplish a set task. See Using agent mode in your IDE.
  • Plan mode: to get Copilot to create detailed implementation plans to ensure all requirements are met. See Using plan mode in your IDE.

To switch between modes, use the agents dropdown at the bottom of the chat view.

Примечание.

If you don’t see the Agent option in the mode selector, your enterprise or organization administrator may have disabled agent mode for your IDE.

Using ask mode

Ask mode is optimized for answering questions about your codebase, coding, and general technology concepts. Use ask mode when you want to understand how something works, explore ideas, or get help with coding tasks.

To use ask mode, select Ask from the agents dropdown at the bottom of the chat view, then submit a prompt as described below.

Submitting prompts

You can give the agent a high-level description of what you want to build and it gets to work. Each task runs inside an agent session, a persistent conversation you can track, pause, resume, or hand off to another agent.

  1. To open the chat view, click the chat icon in the title bar of Visual Studio Code. If the chat icon is not displayed, right-click the title bar and make sure that Command Center is selected.

    Screenshot of the 'Copilot Chat' button, highlighted with a dark orange outline.

  2. Enter a prompt in the prompt box. For an introduction to the kinds of prompts you can use, see Getting started with prompts for GitHub Copilot Chat in your IDE.

  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 Добавление пользовательских инструкций репозитория для 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 GitHub Copilot Chat in your IDE.

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.

Примечание.

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 or Chat participants in the Visual Studio Code documentation.

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 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.

Using GitHub skills for Copilot

Copilot% данных GitHub- специальные навыки расширяют тип информации Copilot может предоставлять. Чтобы получить доступ к этим навыкам в Copilot Chat, включите @github в свой вопрос.

При добавлении @github к вопросу Copilot динамически выбирает соответствующий навык на основе содержимого вопроса. Вы также можете явно попросить Copilot Chat использовать определенный навык. Это можно сделать двумя способами.

  • Используйте естественный язык, чтобы попросить Copilot Chat использовать навык. Например: @github Search the web to find the latest GPT model from OpenAI.
  • Чтобы специально вызвать веб-поиск, можно включить #web переменную в свой вопрос. Например: @github #web What is the latest LTS of Node.js?

Список доступных навыков можно создать, задав Copilot: @github What skills are available?

Using Model Context Protocol (MCP) servers

Вы можете использовать MCP для расширения возможностей Copilot Chat путем интеграции его с широким спектром существующих средств и служб. Дополнительные сведения см. в разделе О протоколе контекста модели (MCP).

AI models for Copilot Chat

Вы можете менять использование модели Copilot для генерации ответов. Вы можете найти, что различные модели работают лучше или предоставляют более полезные ответы в зависимости от типа задаваемых вопросов. К ним относятся модели уровня "Премиум" с расширенными возможностями.

Additional ways to access Copilot Chat

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

  • Quick chat: To open the quick chat dropdown, enter Shift+Option+Command+L (Mac) / Ctrl+Shift+Alt+L (Windows/Linux).
  • Inline: To start an inline chat directly in the editor or integrated terminal, enter Command+i (Mac) / 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.

Using images in Copilot Chat

Вы можете прикреплять изображения и PDF-файлы к вашим подсказкам, используя модель, поддерживающую ввод изображений.

Copilot Поддерживает следующие типы файлов:

  • JPEG (.jpg, .jpeg)
  • Папуа (.pngНовая Гвинея)
  • GIF (.gif)
  • WEBP (.webp)
  • PDF (.pdf)
  • HEIC (.heic)
  • HEIF (.heif)

Например, можно присоединить следующее:

  • Скриншот фрагмента кода и просьба Copilot объяснить код.
  • Макет пользовательского интерфейса приложения и запрос Copilot на генерацию кода.
  • Блок-схема и попросите Copilot описать процессы, показанные на изображении.
  • Скриншот веб-страницы и просьба Copilot сгенерировать HTML для похожей страницы.

Вложения с изображениями и PDF доступны на всех Copilot тарифах и включены по умолчанию, без необходимости включать или выключать эту функцию.

Attaching images to your chat prompt

  1. Do one of the following:

    • Copy an image and paste it into the chat view.
    • Drag and drop one or more image file from your operating system's file explorer—or from the Explorer in VS Code—into the chat view.
    • Right-click an image file in the VS Code Explorer and click Copilot then Add File to Chat.
  2. Введите запрос в представление чата, чтобы сопровождать изображение. Например explain this diagram, describe each of these images in detail, what does this error message mean.

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 или администратор предприятия отключил чат. См . раздел AUTOTITLE.

Chat modes

Visual Studio supports the following chat modes:

  • Ask mode: Get answers and guidance without making changes to your code.
  • Agent mode: Give Copilot a high-level task and allow it to edit code, run commands, and iterate on the results. See Using agent mode in your IDE.

To switch between modes, use the mode dropdown at the bottom of the chat panel. Chat modes are available in Visual Studio 17.14 and later.

Using ask mode

Use ask mode when you want Copilot to explain code, answer a question, or suggest an approach without modifying your project.

To use ask mode, select Ask from the mode dropdown at the bottom of the chat panel, then submit a prompt as described below.

Submitting prompts

You can ask Copilot Chat to give you 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 GitHub Copilot Chat in your IDE.

  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 Добавление пользовательских инструкций репозитория для GitHub Copilot.

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. See also Шпаргалка для чатов GitHub Copilot 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 or Reference in the Visual Studio documentation.

Using GitHub skills for Copilot (preview)

Примечание.

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?

Using Model Context Protocol (MCP) servers

Вы можете использовать MCP для расширения возможностей Copilot Chat путем интеграции его с широким спектром существующих средств и служб. Дополнительные сведения см. в разделе О протоколе контекста модели (MCP).

AI models for Copilot Chat

Вы можете менять использование модели Copilot для генерации ответов. Вы можете найти, что различные модели работают лучше или предоставляют более полезные ответы в зависимости от типа задаваемых вопросов. К ним относятся модели уровня "Премиум" с расширенными возможностями.

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.

Using images in Copilot Chat

Вы можете прикреплять изображения и PDF-файлы к вашим подсказкам, используя модель, поддерживающую ввод изображений.

Copilot Поддерживает следующие типы файлов:

  • JPEG (.jpg, .jpeg)
  • Папуа (.pngНовая Гвинея)
  • GIF (.gif)
  • WEBP (.webp)
  • PDF (.pdf)
  • HEIC (.heic)
  • HEIF (.heif)

Например, можно присоединить следующее:

  • Скриншот фрагмента кода и просьба Copilot объяснить код.
  • Макет пользовательского интерфейса приложения и запрос Copilot на генерацию кода.
  • Блок-схема и попросите Copilot описать процессы, показанные на изображении.
  • Скриншот веб-страницы и просьба Copilot сгенерировать HTML для похожей страницы.

Вложения с изображениями и PDF доступны на всех Copilot тарифах и включены по умолчанию, без необходимости включать или выключать эту функцию.

Attaching images to your chat prompt

  1. If you see the AI model picker at the bottom right of the chat view, select one of the models that supports adding images to prompts:

  2. Do one of the following:

    • Copy an image and paste it into the chat view.
    • Click the paperclip icon at the bottom right of the chat view, click Upload Image, browse to the image file you want to attach, select it and click Open.

    You can add multiple images if required.

  3. Type your prompt into the chat view to accompany the image. For example, explain this image, or describe each of these images in detail.

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 или администратор предприятия отключил чат. См . раздел AUTOTITLE.

Chat modes

The agent picker in the Copilot Chat panel lets you choose which agent drives your conversation. To switch agents, use the Agents dropdown at the bottom of the chat panel.

The following agents are available:

  • Agent mode (default): Full agentic experience with autonomous task execution. See Using agent mode in your IDE.
  • Ask mode: Get quick answers and assistance without making code changes.
  • Plan mode: Collaborate on planning before implementation—Copilot analyzes your request and builds a structured plan for your review. See Using plan mode in your IDE.
  • Edit mode: Make controlled edits across multiple files that you review and accept individually.
  • Copilot CLI: Runs Copilot through Copilot CLI, providing a terminal-first agentic experience with support for multiple isolation modes, live session progress, and tool call visibility. For more information, see О GitHub Copilot CLI.
  • Custom agents: Use personalized agents tailored to your specific needs. See Using custom agents in your IDE.

Copilot Edits lets you make changes across multiple files directly from a single Copilot Chat prompt, using edit mode and agent mode.

Совет

You can also access Copilot from JetBrains AI Assistant without installing the Copilot plugin. For more information, see Использование GitHub Copilot в IDE JetBrains.

Using edit mode

Режим редактирования доступен только в Visual Studio Code и идентификаторах JetBrains.

Используйте режим редактирования, если требуется более детализированный контроль над изменениями, которые предлагает Copilot . В режиме редактирования вы выбираете, какие файлы Copilot могут вносить изменения, предоставлять контекст Copilot с каждой итерацией и решать, принимать ли предложенные изменения после каждой очереди.

Режим редактирования лучше всего подходит для вариантов использования:

  • Вы хотите быстро обновить определенный набор файлов.
  • Вы хотите полный контроль над количеством запросов LLM Copilot используется.
  1. To start an edit session, click Copilot in the menu bar, then select Open GitHub Copilot Chat.
  2. At the top of the chat panel, click Copilot Edits.
  3. Add relevant files to the working set to indicate to GitHub Copilot which files you want to work on. You can add all open files by clicking Add all open files or individually search for single files.
  4. 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.
  5. Review the changes and Accept or Discard the edits for each file.

Submitting prompts

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

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

    Screenshot of the GitHub Copilot Chat icon in the Activity Bar.

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

  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, 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 Добавление пользовательских инструкций репозитория для GitHub Copilot.

Supplementing your prompt

You can use slash commands and file references to help Copilot understand your what you are asking it to do.

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.

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% данных GitHub- специальные навыки расширяют тип информации Copilot может предоставлять. Чтобы получить доступ к этим навыкам в Copilot Chat, включите @github в свой вопрос.

При добавлении @github к вопросу Copilot динамически выбирает соответствующий навык на основе содержимого вопроса. Вы также можете явно попросить Copilot Chat использовать определенный навык. Это можно сделать двумя способами.

  • Используйте естественный язык, чтобы попросить Copilot Chat использовать навык. Например: @github Search the web to find the latest GPT model from OpenAI.
  • Чтобы специально вызвать веб-поиск, можно включить #web переменную в свой вопрос. Например: @github #web What is the latest LTS of Node.js?

Список доступных навыков можно создать, задав Copilot: @github What skills are available?

Using Model Context Protocol (MCP) servers

Вы можете использовать MCP для расширения возможностей Copilot Chat путем интеграции его с широким спектром существующих средств и служб. Дополнительные сведения см. в разделе О протоколе контекста модели (MCP).

AI models for Copilot Chat

Вы можете менять использование модели Copilot для генерации ответов. Вы можете найти, что различные модели работают лучше или предоставляют более полезные ответы в зависимости от типа задаваемых вопросов. К ним относятся модели уровня "Премиум" с расширенными возможностями.

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

Prerequisites

Если у вас есть доступ через GitHub Copilot организацию или предприятие, вы не сможете использовать, если владелец организацииGitHub Copilot Chat или администратор предприятия отключил чат. См . раздел AUTOTITLE.

Chat modes

You can use Copilot Chat in agent mode to autonomously accomplish a set task, or in plan mode to draft an implementation plan before any code changes are made. To switch between modes, use the agents dropdown at the bottom of the chat window.

Submitting prompts

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

  1. To open the chat window, click Editor in the menu bar, then click GitHub Copilot then Open Chat. Copilot Chat opens in a new window.

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

  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, 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 Добавление пользовательских инструкций репозитория для GitHub Copilot.

Using Model Context Protocol (MCP) servers

Вы можете использовать MCP для расширения возможностей Copilot Chat путем интеграции его с широким спектром существующих средств и служб. Дополнительные сведения см. в разделе О протоколе контекста модели (MCP).

AI models for Copilot Chat

Вы можете менять использование модели Copilot для генерации ответов. Вы можете найти, что различные модели работают лучше или предоставляют более полезные ответы в зависимости от типа задаваемых вопросов. К ним относятся модели уровня "Премиум" с расширенными возможностями.

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.

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

Prerequisites

  • Доступ к Copilot. См . раздел AUTOTITLE.
  • Совместимая версия Eclipse. Чтобы использовать расширение GitHub Copilot, необходимо иметь Eclipse версии 2024-09 или более поздней. См. страницу скачивания Eclipse.
  • Если вы являетесь членом организации или предприятия с планом Copilot Business или Copilot Enterprise, политика MCP в Copilot должна быть включена, чтобы использовать MCP с Copilot.
  • Latest version of the GitHub Copilot extension. Download this from the Eclipse Marketplace. For more information, see Installing the GitHub Copilot extension in your environment.
  • Sign in to GitHub in Eclipse.

Если у вас есть доступ через GitHub Copilot организацию или предприятие, вы не сможете использовать, если владелец организацииGitHub Copilot Chat или администратор предприятия отключил чат. См . раздел AUTOTITLE.

Chat modes

You can use Copilot Chat in agent mode to autonomously accomplish a set task, or in plan mode to draft an implementation plan before any code changes are made. To switch between modes, use the agents dropdown at the bottom of the chat panel.

Submitting prompts

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

  1. To open the Copilot Chat panel, click the Copilot icon () in the status bar at the bottom of Eclipse, then click Open Chat.

  2. Enter a prompt in the prompt box, then press Enter.

    For an introduction to the kinds of prompts you can use, see Getting started with prompts for GitHub Copilot Chat in your IDE.

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

Using keywords in your prompt

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

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. For example, use /explain to ask Copilot to explain the code in the file currently displayed in the editor.

To see all available slash commands, type / in the chat prompt box.

Using Model Context Protocol (MCP) servers

Вы можете использовать MCP для расширения возможностей Copilot Chat путем интеграции его с широким спектром существующих средств и служб. Дополнительные сведения см. в разделе О протоколе контекста модели (MCP).

AI models for Copilot Chat

Вы можете менять использование модели Copilot для генерации ответов. Вы можете найти, что различные модели работают лучше или предоставляют более полезные ответы в зависимости от типа задаваемых вопросов. К ним относятся модели уровня "Премиум" с расширенными возможностями.

Further reading