1
0
mirror of synced 2025-12-22 03:16:52 -05:00

tweaks getting started articles

This commit is contained in:
Jules Parker
2022-06-08 19:47:03 +02:00
parent 57cf72a7c7
commit 17c9f72368
3 changed files with 36 additions and 37 deletions

View File

@@ -11,7 +11,6 @@ topics:
## Prerequisites
{% data reusables.copilot.copilot-prerequisites %}
- To use {% data variables.product.prodname_copilot %} in JetBrains, you must have JetBrains IDEs installed. For more information, see the [JetBrains IDEs](https://www.jetbrains.com/idea/download/) documentation.
## Installing the JetBrains extension
@@ -24,17 +23,17 @@ topics:
{% data reusables.copilot.create-java-file %}
1. In the Java file, create a class by typing `class Test`.
{% data variables.product.prodname_copilot %} will automatically suggest a class body in grayed text, as shown below. The exact suggestion may vary.
![Java class body suggestion](/assets/images/help/copilot/java-class-body-suggestion-jetbrains.png)
![Screenshot of the Java class body suggestion](/assets/images/help/copilot/java-class-body-suggestion-jetbrains.png)
{% data reusables.copilot.accept-suggestion %}
1. Below the bracket of the `main` function, type the following function header:
```
int calculateDaysBetweenDates
```
{% data variables.product.prodname_copilot %} will automatically suggest a function body in grayed text, as shown below. The exact suggestion may vary.
![Java function body suggestion](/assets/images/help/copilot/java-function-body-suggestion-jetbrains.png)
![Screenshot of the Java function body suggestion](/assets/images/help/copilot/java-function-body-suggestion-jetbrains.png)
{% data reusables.copilot.accept-suggestion %}
{% data variables.product.prodname_copilot %} will attempt to match your code's context and style. You can edit the suggested code as is necessary.
{% data variables.product.prodname_copilot %} will attempt to match the context and style of your code. You can edit the suggested code as is necessary.
## Seeing alternative suggestions
@@ -47,10 +46,10 @@ topics:
```
{% data variables.product.prodname_copilot %} will show you a suggestion.
1. To see alternative suggestions:
- On macOS, press `Option`+`]` for the next suggestion, or `Option`+`[` for the previous suggestion.
- On Windows or Linux, press `Alt`+`]` for the next suggestion, or `Alt`+`[` for the previous suggestion.
1. If {% data variables.product.prodname_copilot %} offers a suggestion you want to accept, press `Tab`.
1. Alternatively, to reject all suggestions, press `Esc`.
- On macOS, press <kbd>Option</kbd>+<kbd>]</kbd> for the next suggestion, or <kbd>Option</kbd>+<kbd>[</kbd> for the previous suggestion.
- On Windows or Linux, press <kbd>Alt</kbd>+<kbd>]</kbd> for the next suggestion, or <kbd>Alt</kbd>+<kbd>[</kbd> for the previous suggestion.
1. If {% data variables.product.prodname_copilot %} offers a suggestion you want to accept, press <kbd>Tab</kbd>.
1. Alternatively, to reject all suggestions, press <kbd>Esc</kbd>.
## Getting more suggestions
@@ -63,12 +62,12 @@ topics:
```
{% data variables.product.prodname_copilot %} will show you a suggestion.
1. To open a new tab with multiple additional options:
- On macOS, press `Option`+`Enter`, and select **Open Copilot**.
- On Windows or Linux, press `Ctrl`+`Enter`, and select **Open Copilot**.
![Open Copilot](/assets/images/help/copilot/open-copilot-tab-jetbrains.png)
- On macOS, press <kbd>Option</kbd>+<kbd>Enter</kbd>, and select **Open Copilot**.
- On Windows or Linux, press <kbd>Ctrl</kbd>+<kbd>Enter</kbd>, and select **Open Copilot**.
![Screenshot of dialogue to open Copilot](/assets/images/help/copilot/open-copilot-tab-jetbrains.png)
{% data variables.product.prodname_copilot %} will open a new tab and suggest multiple options.
1. If you want to accept one of the suggestions, above that suggestion, click **Accept Solution**.
![Accept Solution](/assets/images/help/copilot/copilot-tab-jetbrains.png)
![Screenshot of Accept Solution button](/assets/images/help/copilot/copilot-tab-jetbrains.png)
1. Alternatively, to reject all suggestions, close the suggestions tab.
## Generating code suggestions from comments
@@ -83,16 +82,16 @@ topics:
void process () {
```
{% data variables.product.prodname_copilot %} will suggest an implementation of the function.
![Java function body suggestion](/assets/images/help/copilot/comment-suggestion-jetbrains.png)
![Screenshot of the Java function body suggestion](/assets/images/help/copilot/comment-suggestion-jetbrains.png)
## Enabling and disabling {% data variables.product.prodname_copilot %}
You can enable or disable {% data variables.product.prodname_copilot %} from within JetBrains. The {% data variables.product.prodname_copilot %} status icon in the bottom panel of the JetBrains window indicates whether {% data variables.product.prodname_copilot %} is enabled or disabled. When enabled, the icon is highlighted. When disabled, the icon is grayed out.
1. To enable or disable {% data variables.product.prodname_copilot %}, click the status icon in the bottom panel of the JetBrains window.
![Status icon in JetBrains](/assets/images/help/copilot/status-icon-jetbrains.png)
2. If you are disabling {% data variables.product.prodname_copilot %}, you will be asked whether you want to disable it globally, or for the language of the file you are currently editing. To disable globally, click **Disable Completions**. Alternatively, click the button to disable completions for the language of the file you are currently editing.
![Disable {% data variables.product.prodname_copilot %} globally or for the current language](/assets/images/help/copilot/disable-copilot-global-or-langugage-jetbrains.png)
![Screenshot of the status icon in JetBrains](/assets/images/help/copilot/status-icon-jetbrains.png)
2. If you are disabling {% data variables.product.prodname_copilot %}, you will be asked whether you want to disable it globally, or for the language of the file you are currently editing. To disable globally, click **Disable Completions**. Alternatively, click the language-specific button to disable completions for the specified language.
![Screenshot of option to disable {% data variables.product.prodname_copilot %} globally or for the current language](/assets/images/help/copilot/disable-copilot-global-or-langugage-jetbrains.png)
## Further reading

View File

@@ -11,7 +11,7 @@ topics:
## Prerequisites
{% data reusables.copilot.copilot-prerequisites %}
- To use {% data variables.product.prodname_copilot %} in Visual Studio Code, you must have Visual Studio Code installed. For more information, see the [Visual Studio Code](https://code.visualstudio.com/) documentation.
@@ -34,7 +34,7 @@ To use {% data variables.product.prodname_copilot %}, you must first install the
{% data reusables.copilot.create-js-file %}
{% data reusables.copilot.type-function-header %}
{% data variables.product.prodname_copilot %} will automatically suggest an entire function body in grayed text, as shown below. The exact suggestion may vary.
![First suggestion Visual Studio Code](/assets/images/help/copilot/first-suggestion-visual-studio-code.png)
![Screenshot of a first suggestion Visual Studio Code](/assets/images/help/copilot/first-suggestion-visual-studio-code.png)
{% data reusables.copilot.accept-suggestion %}
## Seeing alternative suggestions
@@ -45,10 +45,10 @@ To use {% data variables.product.prodname_copilot %}, you must first install the
{% data reusables.copilot.type-function-header %}
{% data variables.product.prodname_copilot %} will show you a suggestion.
3. To see alternate suggestions:
- On macOS, press `Option (⌥) or Alt`+`]` (or `Option (⌥) or Alt`+`[`).
- On Windows, press `Alt`+`]` (or `Alt`+`[`).
4. If {% data variables.product.prodname_copilot %} offers a suggestion you want to accept, press `Tab`.
5. Alternatively, to reject all suggestions, press `Esc`.
- On macOS, press <kbd>Option (⌥) or Alt</kbd>+<kbd>]</kbd> (or <kbd>Option (⌥) or Alt</kbd>+<kbd>[</kbd>).
- On Windows or Linux, press <kbd>Alt</kbd>+<kbd>]</kbd> (or <kbd>Alt</kbd>+<kbd>[</kbd>).
4. If {% data variables.product.prodname_copilot %} offers a suggestion you want to accept, press <kbd>Tab</kbd>.
5. Alternatively, to reject all suggestions, press <kbd>Esc</kbd>.
6. Optionally, you can hover over the suggestion to see the {% data variables.product.prodname_copilot %} command palette for choosing suggestions.
## Getting more suggestions
@@ -58,9 +58,9 @@ To use {% data variables.product.prodname_copilot %}, you must first install the
{% data reusables.copilot.create-js-file %}
{% data reusables.copilot.type-function-header %}
{% data variables.product.prodname_copilot %} will show you a suggestion.
2. To open a new tab with multiple additional options, press `Ctrl`+`Enter`.
2. To open a new tab with multiple additional options, press <kbd>Ctrl</kbd>+<kbd>Enter</kbd>.
3. To accept a suggestion from the new tab, above the suggestion you want to accept, click **Accept solution**.
![Suggestions pane in Visual Studio Code](/assets/images/help/copilot/suggestions-pane-visual-studio-code.png)
![Screenshot of the suggestions pane in Visual Studio Code](/assets/images/help/copilot/suggestions-pane-visual-studio-code.png)
4. Alternatively, to reject all the suggestions, close the "Copilot" tab.
## Generating code suggestions from comments
@@ -81,27 +81,27 @@ To use {% data variables.product.prodname_copilot %}, you must first install the
You can also use {% data variables.product.prodname_copilot %} to generate suggestions for APIs and frameworks.This 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`:
1. In the JavaScript file, type the following comment and then press <kbd>Enter</kbd>:
```
// Express server on port 3000
```
{% data variables.product.prodname_copilot %} will suggest an implementation of the Express app.
1. To accept each line, press `Tab`, then `Enter`.
1. Type the following comment and then press `Enter`:
1. To accept each line, press <kbd>Tab</kbd>, then <kbd>Enter</kbd>.
1. Type the following comment and then press <kbd>Enter</kbd>:
```
// Return the current time
```
{% data variables.product.prodname_copilot %} will suggest an implementation for the default handler.
1. To accept each line, press `Tab`.
1. To accept each line, press <kbd>Tab</kbd>.
## Enabling and disabling {% data variables.product.prodname_copilot %}
You can enable or disable {% data variables.product.prodname_copilot %} from within Visual Studio Code. The {% data variables.product.prodname_copilot %} status icon in the bottom panel of the Visual Studio Code window indicates whether {% data variables.product.prodname_copilot %} is enabled or disabled. When enabled, the background color of the icon will match the color of the status bar. When disabled, the background color of the icon will contrast the color of the status bar.
1. To enable or disable {% data variables.product.prodname_copilot %}, click the status icon in the bottom panel of the Visual Studio Code window.
![Status icon in Visual Studio Code](/assets/images/help/copilot/status-icon-visual-studio-code.png)
2. If you are disabling {% data variables.product.prodname_copilot %}, you will be asked whether you want to disable it globally, or for the language of the file you are currently editing. To disable globally, click **Disable globally**. Alternatively, click the button to disable for the language of the file you are editing.
![Disable {% data variables.product.prodname_copilot %} globally or for the current language](/assets/images/help/copilot/disable-copilot-global-or-langugage.png)
![Screenshot of the status icon in Visual Studio Code](/assets/images/help/copilot/status-icon-visual-studio-code.png)
2. If you are disabling {% data variables.product.prodname_copilot %}, you will be asked whether you want to disable it globally, or for the language of the file you are currently editing. To disable globally, click **Disable globally**. Alternatively, click the language-specific button to disable {% data variables.product.prodname_copilot %} for the specified language.
![Screenshot of option to disable {% data variables.product.prodname_copilot %} globally or for the current language](/assets/images/help/copilot/disable-copilot-global-or-langugage.png)
## Further reading

View File

@@ -1,6 +1,7 @@
---
title: Getting started with GitHub Copilot in Visual Studio
shortTitle: Visual Studio
product: '{% data reusables.gated-features.copilot %}'
intro: 'Learn how to install {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vs %}, and start seeing suggestions as you write comments and code.'
versions:
feature: 'copilot'
@@ -10,7 +11,6 @@ topics:
## Prerequisites
{% data reusables.copilot.copilot-prerequisites %}
- To use {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vs %}, you must have {% data variables.product.prodname_vs %} 2022 17.1 or later installed. For more information, see the [Visual Studio IDE](https://visualstudio.microsoft.com/vs/) documentation.
- {% data variables.product.prodname_copilot %} is not available for use with Visual Studio for Mac.
@@ -49,7 +49,7 @@ After installation, a {% data variables.product.prodname_copilot %} icon should
{% data reusables.copilot.create-c-file %}
{% data reusables.copilot.type-function-header-c %}
{% data variables.product.prodname_copilot %} will automatically suggest an entire function body in grayed text, as shown below. The exact suggestion may vary.
![First suggestion Visual Studio Code](/assets/images/help/copilot/first-suggestion-visual-studio.png)
![Screenshot of a first suggestion Visual Studio Code](/assets/images/help/copilot/first-suggestion-visual-studio.png)
{% data reusables.copilot.accept-suggestion %}
## Seeing alternative suggestions
@@ -57,9 +57,9 @@ After installation, a {% data variables.product.prodname_copilot %} icon should
{% data reusables.copilot.create-c-file %}
{% data reusables.copilot.type-function-header-c %}
{% data variables.product.prodname_copilot %} will show you a suggestion.
3. To see alternate suggestions, press `Alt`+`]` (or `Alt`+`[`).
4. If {% data variables.product.prodname_copilot %} offers a suggestion you want to accept, press `Tab`.
5. Alternatively, to reject all suggestions, press `Esc`.
3. To see alternate suggestions, press <kbd>Alt</kbd>+<kbd>]</kbd> (or <kbd>Alt</kbd>+<kbd>[</kbd>).
4. If {% data variables.product.prodname_copilot %} offers a suggestion you want to accept, press <kbd>Tab</kbd>.
5. Alternatively, to reject all suggestions, press <kbd>Esc</kbd>.
6. Optionally, you can hover over the suggestion to see the {% data variables.product.prodname_copilot %} command palette for choosing suggestions.
## Generating code suggestions from comments
@@ -82,7 +82,7 @@ After installation, a {% data variables.product.prodname_copilot %} icon should
The {% data variables.product.prodname_copilot %} status icon in the bottom panel of the {% data variables.product.prodname_vs %} window indicates whether {% data variables.product.prodname_copilot %} is enabled or disabled. When enabled, the background color of the icon will match the color of the status bar. When disabled, it will have a diagonal line through it.
1. To enable or disable {% data variables.product.prodname_copilot %}, click the status icon in the bottom panel of the {% data variables.product.prodname_vs %} window.
1. To enable or disable {% data variables.product.prodname_copilot %}, click the {% data variables.product.prodname_copilot %} icon in the bottom panel of the {% data variables.product.prodname_vs %} window.
![Screenshot of editor margin in Visual Studio with the GitHub Copilot icon emphasized](/assets/images/help/copilot/editor-margin-visual-studio.png)
2. If you are disabling {% data variables.product.prodname_copilot %}, you will be asked whether you want to disable it globally, for the file you are currently editing, or for the current file type.