1
0
mirror of synced 2026-01-23 21:03:52 -05:00
Files
docs/translations/es-ES/content/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-visual-studio-code.md
docubot 92468788c4 New translation batch for es (#29413)
* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/fix-translation-errors.js

* Run script/i18n/lint-translation-files.js --check rendering

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=es

* run script/i18n/reset-known-broken-translation-files.js

Co-authored-by: Robert Sese <734194+rsese@users.noreply.github.com>
2022-07-28 02:39:36 +00:00

7.2 KiB

title, shortTitle, intro, product, versions, topics
title shortTitle intro product versions topics
Getting started with GitHub Copilot in Visual Studio Code Visual Studio Code Learn how to install {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vscode %}, and start seeing suggestions as you write comments and code. {% data reusables.gated-features.copilot %}
feature
copilot
Copilot

Acerca del {% data variables.product.prodname_copilot %} y de las {% data variables.product.prodname_vscode %}

{% data reusables.copilot.procedural-intro %}

If you use {% data variables.product.prodname_vscode %}, you can view and incorporate suggestions from {% data variables.product.prodname_copilot %} directly within the editor. This guide demonstrates how to use {% data variables.product.prodname_copilot %} within {% data variables.product.prodname_vscode %} for macOS, Windows, or Linux.

Prerrequisitos

To use {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vscode %}, you must have {% data variables.product.prodname_vscode %} installed. For more information, see the {% data variables.product.prodname_vscode %} download page.

Installing the {% data variables.product.prodname_vscode %} extension

To use {% data variables.product.prodname_copilot %}, you must first install the {% data variables.product.prodname_vscode %} extension.

  1. In the {% data variables.product.prodname_vscode %} Marketplace, go to the {% data variables.product.prodname_copilot %} extension page and click Install. Install {% data variables.product.prodname_copilot %} extension {% data variables.product.prodname_vscode %}
  2. A popup will appear, asking to open {% data variables.product.prodname_vscode %}. Click Open {% data variables.product.prodname_vscode %}.
  3. In the "Extension: {% data variables.product.prodname_copilot %}" tab in {% data variables.product.prodname_vscode %}, click Install. Install button in {% data variables.product.prodname_vscode %}
  4. If you have not previously authorized {% data variables.product.prodname_vscode %} in your {% data variables.product.prodname_dotcom %} account, you will be prompted to sign in to {% data variables.product.prodname_dotcom %} in {% data variables.product.prodname_vscode %}.
    • If you have previously authorized {% data variables.product.prodname_vscode %} for your account on {% data variables.product.prodname_dotcom %}, {% data variables.product.prodname_copilot %} will be automatically authorized. Screen shot of {% data variables.product.prodname_vscode %} authorization screen
  5. In your browser, {% data variables.product.prodname_dotcom %} will request the necessary permissions for {% data variables.product.prodname_copilot %}. To approve these permissions, click Authorize {% data variables.product.prodname_vscode %}.
  6. In {% data variables.product.prodname_vscode %}, in the "{% data variables.product.prodname_vscode %}" dialog box, to confirm the authentication, click Open.

Enviar tu primer sugerencia

{% data reusables.copilot.supported-languages %} The following samples are in JavaScript, but other languages will work similarly.

{% data reusables.copilot.create-js-file %}

  1. In the JavaScript file, type the following function header. {% data variables.product.prodname_copilot %} sugerirá automáticamente todo el cuerpo de una función en texto gris, tal como se muestra a continuación. La sugerencia exacta podría variar.
function calculateDaysBetweenDates(begin, end) {

Screenshot of a first suggestion {% data variables.product.prodname_vscode %} {% data reusables.copilot.accept-suggestion %}

Ver sugerencias alternativas

{% data reusables.copilot.alternative-suggestions %}

{% data reusables.copilot.create-js-file %}

  1. En el archivo de JavaScript, escribe el siguiente encabezado de función. El {% data variables.product.prodname_copilot %} te mostrará una sugerencia.
function calculateDaysBetweenDates(begin, end) {

{% data reusables.copilot.see-alternative-suggestions %}

OS Ver la siguiente sugerencia Ver sugerencia anterior
macOS Option (⌥) or Alt+] Option (⌥) or Alt+[
Windows Alt+] Alt+[
Linux Alt+] Alt+[
  1. Alternatively, you can hover over the suggestion to see the {% data variables.product.prodname_copilot %} command palette for choosing suggestions. {% data reusables.copilot.accept-or-reject-suggestion %}

Ver varias sugerencias en una pestaña nueva

{% data reusables.copilot.suggestions-new-tab %}

{% data reusables.copilot.create-js-file %}

  1. En el archivo de JavaScript, escribe el siguiente encabezado de función. El {% data variables.product.prodname_copilot %} te mostrará una sugerencia.
function calculateDaysBetweenDates(begin, end) {
  1. To open a new tab with multiple additional options, press Ctrl+Enter.
  2. Para aceptar una sugerencia, sobre esta, haz clic en Aceptar solución. Para rechazar todas las sugerencias, cierra la pestaña.

Generar sugerencias de código desde los comentarios

{% data reusables.copilot.generating-suggestions-from-comments %}

{% data reusables.copilot.create-js-file %}

  1. In the JavaScript file, type the following comment. El {% data variables.product.prodname_copilot %} te sugerirá una implementación de la función.
    // find all images without alternate text
    // and give them a red border
    function process() {
    

Using a framework

You can also use {% data variables.product.prodname_copilot %} to generate suggestions for APIs and frameworks. The following example uses {% data variables.product.prodname_copilot %} to create a simple Express server that returns the current time.

{% data reusables.copilot.create-js-file %}

  1. In the JavaScript file, type the following comment and then press Enter. {% data variables.product.prodname_copilot %} will suggest an implementation of the Express app.
    // Express server on port 3000
    
  2. To accept each line, press Tab, then Enter.
  3. Type the following comment and then press Enter. {% data variables.product.prodname_copilot %} will suggest an implementation for the default handler.
    // Return the current time
    
  4. To accept each line, press Tab.

{% data reusables.copilot.enabling-or-disabling-in-vsc %}

Leer más