Skip to main content

Preguntas sobre GitHub Copilot en el IDE

Usa Copilot Chat en el editor para proporcionar sugerencias de código, explicar el código, generar pruebas unitarias y sugerir correcciones de código.

Prerequisites

If you have access to GitHub Copilot via your organization, you won't be able to use GitHub Copilot Chat if your organization owner has disabled chat. See Managing policies for Copilot in your organization.

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

GitHub Copilot Extensions integrate the power of external tools into Copilot Chat, helping you reduce context switching and receive responses with domain-specific context. You can install Copilot Extensions from the GitHub Marketplace or build private ones within your organization, then type @ in a chat window to see a list of your available extensions. To use an extension, select the extension from the list or type the full slug name, then type your prompt.

To learn more, see Using extensions to integrate external tools with Copilot Chat.

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