GitHub Copilot provides coding suggestions as you type in your editor. You can also ask Copilot coding-related questions, such as how best to code something, how to fix a bug, or how someone else's code works. For full details of what Copilot can do, see What is GitHub Copilot?.
Instructions for using Copilot differ depending on where you are using it. This version of the quickstart is for Visual Studio Code. Click the tabs above for instructions on using Copilot in other environments.
PrerequisitesCopilot subscription - To use GitHub Copilot in VS Code, you must have an active GitHub Copilot subscription. See What is GitHub Copilot?.
Latest version of Visual Studio Code. See the Visual Studio Code download page.
Sign in to GitHub in Visual Studio Code. If you experience authentication issues, see Troubleshooting common issues with GitHub Copilot.
After you've installed the GitHub Copilot extension, you can ask Copilot coding-related questions.
Open an existing code file.
Open the Chat view from the Activity Bar.
At the bottom of the chat view, in the chat input field, type: explain this file
.
Press Enter.
Copilot replies in the chat view.
In the editor, select one or more lines of code that are not commented.
In the chat input field, type: add comments to these lines
.
If you like the comments that Copilot suggests, hover over the suggested code in the chat view and click the "Insert at Cursor" icon to replace the selected lines with the suggested code.
The following example uses JavaScript, however other languages will work similarly. GitHub Copilot provides suggestions for numerous languages and a wide variety of frameworks, but works especially well for Python, JavaScript, TypeScript, Ruby, Go, C# and C++. GitHub Copilot can also assist in query generation for databases, generating suggestions for APIs and frameworks, and can help with infrastructure as code development.
Open Visual Studio Code.
In Visual Studio Code, create a new JavaScript (*.js) file.
In the JavaScript file, type the following function header.
JavaScriptfunction calculateDaysBetweenDates(begin, end) {
function calculateDaysBetweenDates(begin, end) {
GitHub Copilot will automatically suggest an entire function body in grayed text. The exact suggestion may vary.
To accept the suggestion, press Tab.
GitHub Copilot provides coding suggestions as you type in your editor. You can also ask Copilot coding-related questions, such as how best to code something, how to fix a bug, or how someone else's code works. For full details of what Copilot can do, see What is GitHub Copilot?.
Instructions for using Copilot differ depending on where you are using it. This version of the quickstart is for Visual Studio. Click the tabs above for instructions on using Copilot in other environments.
PrerequisitesSubscription to Copilot. To use GitHub Copilot in Visual Studio, you must have an active GitHub Copilot subscription. See What is GitHub Copilot?.
Compatible version of Visual Studio. To use GitHub Copilot in Visual Studio, you must have version 2022 17.8 or later of Visual Studio for Windows installed. For more information, see Install Visual Studio in the Microsoft documentation.
GitHub Copilot extension for Visual Studio. For instructions on how to install the Copilot extension, see Install GitHub Copilot in Visual Studio in the Microsoft documentation.
Add your GitHub account to Visual Studio. See Add your GitHub accounts to your Visual Studio keychain in the Microsoft documentation.
After you've installed the GitHub Copilot extension, you can ask Copilot coding-related questions.
Open an existing code file.
In the Visual Studio menu bar, click View, then click GitHub Copilot Chat.
In the Copilot Chat window, type what does this file do
then press Enter.
Copilot's answer is displayed below your question.
Select a line of code in the editor.
In the Copilot Chat window, type explain this line
then press Enter.
The following example uses JavaScript, however other languages will work similarly. GitHub Copilot provides suggestions for numerous languages and a wide variety of frameworks, but works especially well for Python, JavaScript, TypeScript, Ruby, Go, C# and C++. GitHub Copilot can also assist in query generation for databases, generating suggestions for APIs and frameworks, and can help with infrastructure as code development.
Open Visual Studio.
In Visual Studio, create a new JavaScript (*.js) file.
In the JavaScript file, type the following function header.
JavaScriptfunction calculateDaysBetweenDates(begin, end) {
function calculateDaysBetweenDates(begin, end) {
GitHub Copilot will automatically suggest an entire function body in grayed text. The exact suggestion may vary.
To accept the suggestion, press Tab.
GitHub Copilot provides coding suggestions as you type in your editor. You can also ask Copilot coding-related questions, such as how best to code something, how to fix a bug, or how someone else's code works. For full details of what Copilot can do, see What is GitHub Copilot?.
Instructions for using Copilot differ depending on where you are using it. This version of the quickstart is for JetBrains IDEs. Click the tabs above for instructions on using Copilot in other environments.
PrerequisitesSubscription to Copilot. To use GitHub Copilot in Visual Studio, you must have an active GitHub Copilot subscription. See What is GitHub Copilot?.
A compatible JetBrains IDE. Copilot is supported in a large number of JetBrains IDEs. For a full list, see Asking GitHub Copilot questions in your IDE.
Latest version of the GitHub Copilot extension. See the GitHub Copilot plugin in the JetBrains Marketplace. For installation instructions, see Installing the GitHub Copilot extension in your environment.
Sign in to GitHub in your JetBrains IDE. For authentication instructions, see Installing the GitHub Copilot extension in your environment.
After you've installed the GitHub Copilot plugin, you can ask Copilot coding-related questions.
Open an existing code file.
Open the Copilot Chat window by clicking the Copilot Chat icon at the right side of the JetBrains IDE window.
In the Copilot Chat window, type what does this file do
then press Enter.
Copilot's answer is displayed below your question.
Select a line of code in the editor.
In the Copilot Chat window, type explain this line
then press Enter.
The following example uses JavaScript, however other languages will work similarly. GitHub Copilot provides suggestions for numerous languages and a wide variety of frameworks, but works especially well for Python, JavaScript, TypeScript, Ruby, Go, C# and C++. GitHub Copilot can also assist in query generation for databases, generating suggestions for APIs and frameworks, and can help with infrastructure as code development.
In your JetBrains editor, create a new JavaScript (*.js) file.
In the JavaScript file, type the following function header.
JavaScriptfunction calculateDaysBetweenDates(begin, end) {
function calculateDaysBetweenDates(begin, end) {
GitHub Copilot will automatically suggest an entire function body in grayed text. The exact suggestion may vary.
To accept the suggestion, press Tab.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4