copilot-docs/gettingstarted.md at main · github/copilot-docs
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
- Installing the JetBrains extension
- Seeing your first suggestion
- Choosing alternate suggestions
- Getting more suggestions
- Generating code from a comment
- More examples
- Keyboard shortcuts
- Enabling or disabling GitHub Copilot
- Learn More
1. Installing the JetBrains extension
-
We have tested with the following JetBrains IDEs: IntelliJ and PyCharm versions 2021.2 and above.
-
From the JetBrains marketplace, search for 'github copilot'. (You must include the 'github' to avoid other plug-ins with similar names.)
-
Click the 'Install' button.
-
Accept the Third-Party Plugins Privacy Notice.
-
Exit and restart the IDE.
-
In the Tools menu you will now see a GitHub Copilot option.
-
Login to GitHub Copilot using the device auth flow and authorized GitHub Copilot IntelliJ plugin with your GitHub Account in an external browser.
-
Read and agree to the GitHub Copilot additional telemetry terms.
-
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.
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.
-
Create a new Java (.java) file.
-
Create a class by typing
class TestCopilot will suggest a class body.
Press
tabto accept the suggestion. -
Below the bracket of the
mainfunction, type the following function header:int calculateDaysBetweenDates( -
GitHub Copilot will automatically suggest an entire function body in grayed text, as shown below. The exact suggestion may vary.
-
Press
Tabto 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.
-
Remove the function you entered and type the following again:
int calculateDaysBetweenDates( -
GitHub Copilot will again show you a suggested completion.
-
Instead of pressing
Tab:- On macOS, press
Option+]for next orOption+[) for previous. - On Windows or Linux, press
Alt+]for next orAlt+[for previous.
GitHub Copilot will cycle through other alternative suggestions.
- On macOS, press
-
When you see a suggestion you like, press
Tabto accept it. -
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.
-
Remove the function you entered and type the following again:
int calculateDaysBetweenDates( -
GitHub Copilot will again show you a suggested completion.
-
Open GitHub Copilot.
- On macOS, press
Option+Enter. - On Windows or Linux, press
Alt+Enter.
Select "Open Copilot". GitHub Copilot will open a new tab and suggest multiple options, as shown below.
- On macOS, press
-
Pick a suggestion that you want to use, then click "Accept solution."
-
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.
-
Remove the function you entered and type the following:
// find all images without alternate text // and give them a red border void process() { -
GitHub Copilot will automatically suggest an implementation:
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 + ]orOption + ]. -
Show previous inline suggestion:
Alt + [orOption + [. -
Trigger inline suggestion:
Alt + \orOption + \. -
Open Copilot (up to 10 suggestions in separate pane):
Alt + EnterorOption + Enterthen 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.
You can also logout (or login) from Copilot from the Tools/GitHub Copilot menu.
9. Learn More
To learn more about configuring GitHub Copilot, go to the documentation table of contents.
Fuente: GitHub







