Absortio

Email → Summary → Bookmark → Email

Extracto

Documentation for GitHub Copilot. Contribute to github/copilot-docs development by creating an account on GitHub.

Resumen

Resumen Principal

La documentación oficial de GitHub Copilot proporciona una guía integral para desarrolladores interesados en implementar esta herramienta de asistencia de código impulsada por IA. El contenido está estructurado para facilitar la incorporación efectiva de Copilot en flujos de trabajo de desarrollo, abarcando desde la instalación inicial hasta casos de uso avanzados. La plataforma se posiciona como un asistente inteligente que complementa las capacidades humanas mediante sugerencias de código contextualizadas y automatización de tareas repetitivas. La documentación resalta cómo Copilot interpreta comentarios, firmas de funciones y contexto existente para generar código relevante en múltiples lenguajes de programación. Este enfoque colaborativo entre humano e inteligencia artificial representa una evolución significativa en prácticas de desarrollo moderno, permitiendo mayor productividad sin comprometer la calidad del código. La estructura del documento refleja una comprensión profunda de las necesidades del desarrollador, ofreciendo soluciones prácticas respaldadas por la inteligencia artificial de vanguardia de GitHub.

Elementos Clave

  • Integración Multi-IDE: La documentación detalla el soporte nativo para Visual Studio Code, Visual Studio, JetBrains IDEs, Neovim y Azure Data Studio, permitiendo a los desarrolladores mantener sus entornos preferidos mientras acceden a capacidades avanzadas de asistencia de código que se adaptan a diferentes estilos de trabajo y preferencias tecnológicas.

  • Personalización Contextual: El sistema analiza comentarios, firmas de funciones y código existente para proporcionar sugerencias altamente relevantes, demostrando una comprensión sofisticada de contexto que va más allá de simples completados de línea hacia generación de bloques funcionales completos adaptados a necesidades específicas del proyecto.

  • Compatibilidad Multi-lenguaje: La plataforma ofrece soporte extensivo para diversos lenguajes de programación incluyendo Python, JavaScript, TypeScript, Ruby, Go, entre otros, permitiendo a equipos heterogéneos beneficiarse uniformemente independientemente de sus stacks tecnológicos específicos y preferencias lingüísticas.

  • Flujos de Trabajo Colaborativos: La documentación enfatiza cómo Copilot facilita desarrollo en equipo mediante sugerencias consistentes y estandarizadas que ayudan a mantener coherencia en bases de código grandes, reduciendo fricciones comunes en proyectos colaborativos donde múltiples desarrolladores contribuyen con estilos y enfoques diversos.

Análisis e Implicaciones

La implementación de GitHub Copilot representa una transformación fundamental en cómo los desarrolladores interactúan con herramientas de asistencia, estableciendo nuevos estándares para productividad técnica mediante inteligencia artificial contextualizada. Esta evolución tecnológica tiene el potencial de acelerar significativamente ciclos de desarrollo mientras democratiza acceso a conocimiento especializado, permitiendo a desarrolladores de diferentes niveles de experiencia producir código de mayor calidad con menor esfuerzo cognitivo.

Contexto Adicional

La documentación forma parte de un repositorio colaborativo en GitHub que permite contribuciones comunitarias, reflejando el compromiso de la plataforma con mejora continua y adaptación basada en retroalimentación directa de usuarios. Esta aproximación open-source al desarrollo de documentación complementa la naturaleza colaborativa del propio producto, creando un ecosistema de aprendizaje y mejora mutua entre GitHub y su comunidad de desarrolladores.

Contenido

Getting Started with GitHub Copilot in JetBrains

1. Installing the JetBrains extension

  1. We have tested with the following JetBrains IDEs: IntelliJ and PyCharm versions 2021.2 and above.

  2. From the JetBrains marketplace, search for 'github copilot'. (You must include the 'github' to avoid other plug-ins with similar names.)

    Search for `github copilot`
  3. Click the 'Install' button.

  4. Accept the Third-Party Plugins Privacy Notice.

  5. Exit and restart the IDE.

  6. In the Tools menu you will now see a GitHub Copilot option.

    Tools GitHub Copilot option`
  7. Login to GitHub Copilot using the device auth flow and authorized GitHub Copilot IntelliJ plugin with your GitHub Account in an external browser.

  8. Read and agree to the GitHub Copilot additional telemetry terms.

  9. Click OK.

    Now when you start editing, you should see GitHub Copilot suggestions.

    If you receive the following message, you have not yet been added to the GitHub Copilot Technical Preview.

    Not in the preview

    The Technical Preview is open to a limited number of testers. To join the waitlist, visit copilot.github.com.

    Having problems installing? Visit the Feedback forum.

2. Seeing your first suggestion

GitHub Copilot provides code suggestions for dozens of languages and a wide variety of frameworks, but it works especially well for Python, JavaScript, TypeScript, Ruby, Java, and Go. The following samples are in Java, but other languages will work similarly.

  1. Create a new Java (.java) file.

  2. Create a class by typing class Test

    Copilot will suggest a class body.

    Class code suggested by GitHub Copilot

    Press tab to accept the suggestion.

  3. Below the bracket of the main function, type the following function header:

    int calculateDaysBetweenDates(
    
  4. GitHub Copilot will automatically suggest an entire function body in grayed text, as shown below. The exact suggestion may vary.

    Code suggested by GitHub Copilot

  5. Press Tab to accept the suggestion.

GitHub Copilot will attempt to match your code's context and style. You can edit the suggested code as you choose.

3. Choosing alternate suggestions

For any given input, GitHub Copilot can provide multiple suggestions. As the developer you are always in charge; you can select which suggestion to use, or reject them all.

  1. Remove the function you entered and type the following again:

    int calculateDaysBetweenDates(
    
  2. GitHub Copilot will again show you a suggested completion.

  3. Instead of pressing Tab:

    • On macOS, press Option+] for next or Option+[) for previous.
    • On Windows or Linux, press Alt+] for next or Alt+[ for previous.

    GitHub Copilot will cycle through other alternative suggestions.

  4. When you see a suggestion you like, press Tab to accept it.

  5. If you don't like any of the suggestions, press Esc.

4. Getting more suggestions

Sometimes, you may not want to use any of the initial suggestions. You can ask GitHub Copilot to return more.

  1. Remove the function you entered and type the following again:

    int calculateDaysBetweenDates(
    
  2. GitHub Copilot will again show you a suggested completion.

  3. Open GitHub Copilot.

    • On macOS, press Option+Enter.
    • On Windows or Linux, press Alt+Enter.

    Open GitHub Copilot

    Select "Open Copilot". GitHub Copilot will open a new tab and suggest multiple options, as shown below.

    Suggestions window

  4. Pick a suggestion that you want to use, then click "Accept solution."

  5. If you don't like any of the returned suggestions, just close the suggestions tab.

5. Generating code from a comment

GitHub Copilot can understand significantly more context than most code assistants, and can generate entire functions from something as simple as a comment.

  1. Remove the function you entered and type the following:

    // find all images without alternate text
    // and give them a red border
    void process() {
    
  2. GitHub Copilot will automatically suggest an implementation:

    Suggestions window

6. More examples

GitHub Copilot has even more capabilities. Check out the examples on copilot.github.com to see more, or the Gallery in this repository for the latest examples from us and the community.

Got an example of your own? We welcome you to share it on our Feedback forum.

7. Keyboard shortcuts

The following lists the most common keyboard shortcuts relevant for GitHub Copilot. If you wish to rebind them, check out the configuration guide.

  • Accept an inline suggestion: Tab.

  • Dismiss an inline suggestion: Esc.

  • Show next inline suggestion: Alt + ] or Option + ].

  • Show previous inline suggestion: Alt + [ or Option + [.

  • Trigger inline suggestion: Alt + \ or Option + \.

  • Open Copilot (up to 10 suggestions in separate pane): Alt + Enter or Option + Enter then pick "Open Copilot".

8. Enabling and disabling GitHub Copilot

There's a setting to turn on or off the automatic completions. You can find the setting at Preferences... > Languages & Frameworks > GitHub Copilot.

The GitHub Copilot preferences

You can also logout (or login) from Copilot from the Tools/GitHub Copilot menu.

The GitHub Copilot submenu in the Tools menu

9. Learn More

To learn more about configuring GitHub Copilot, go to the documentation table of contents.

Fuente: GitHub