From fcd1dd67bd7acc1896b02024fbd3f939cb697b49 Mon Sep 17 00:00:00 2001 From: Sunbrye Ly <56200261+sunbrye@users.noreply.github.com> Date: Wed, 12 Feb 2025 10:13:30 -0800 Subject: [PATCH] GitHub Copilot in Eclipse (Code Completion) [Public Preview] (#54321) --- .../github-copilot-features.md | 2 +- ...ring-github-copilot-in-your-environment.md | 31 ++++++++++ ...b-copilot-extension-in-your-environment.md | 34 +++++++++++ ...ithub-copilot-with-an-account-on-ghecom.md | 14 +++++ ...estions-in-your-ide-with-github-copilot.md | 56 +++++++++++++++++++ .../copilot/differences-cfi-cfb-table.md | 2 +- .../copilot/eclipse-public-preview-note.md | 1 + src/tools/lib/all-tools.js | 1 + 8 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 data/reusables/copilot/eclipse-public-preview-note.md diff --git a/content/copilot/about-github-copilot/github-copilot-features.md b/content/copilot/about-github-copilot/github-copilot-features.md index a7bc40023a..4e354d8d9f 100644 --- a/content/copilot/about-github-copilot/github-copilot-features.md +++ b/content/copilot/about-github-copilot/github-copilot-features.md @@ -16,7 +16,7 @@ redirect_from: ### Code completion -Autocomplete-style suggestions from {% data variables.product.prodname_copilot_short %} in supported IDEs _({% data variables.product.prodname_vscode %}, {% data variables.product.prodname_vs %}, JetBrains IDEs, Azure Data Studio, Xcode, and Vim/Neovim)_. For more information, see [AUTOTITLE](/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot). +Autocomplete-style suggestions from {% data variables.product.prodname_copilot_short %} in supported IDEs _({% data variables.product.prodname_vscode %}, {% data variables.product.prodname_vs %}, JetBrains IDEs, Azure Data Studio, Xcode, Vim/Neovim, and Eclipse)_. For more information, see [AUTOTITLE](/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot). If you use {% data variables.product.prodname_vscode_shortname %}, you can also use {% data variables.copilot.next_edit_suggestions %}, which will predict the location of the next edit you are likely to make and suggest a completion for it. diff --git a/content/copilot/managing-copilot/configure-personal-settings/configuring-github-copilot-in-your-environment.md b/content/copilot/managing-copilot/configure-personal-settings/configuring-github-copilot-in-your-environment.md index 988c59212b..5355ea2fcb 100644 --- a/content/copilot/managing-copilot/configure-personal-settings/configuring-github-copilot-in-your-environment.md +++ b/content/copilot/managing-copilot/configure-personal-settings/configuring-github-copilot-in-your-environment.md @@ -458,6 +458,37 @@ After updating the extension, Xcode must be restarted for the changes to take ef {% endxcode %} +{% eclipse %} + +{% data reusables.copilot.eclipse-public-preview-note %} + +## About {% data variables.product.prodname_copilot %} in Eclipse + +If you use Eclipse, {% data variables.product.prodname_copilot %} can provide code suggestions as you work in the IDE. + +After you install {% data variables.product.prodname_copilot %} in Eclipse, you can enable or disable it, and you can configure advanced settings within the IDE. + +## Prerequisites + +To configure {% data variables.product.prodname_copilot %} in Eclipse, you must install the {% data variables.product.prodname_copilot %} extension. See [AUTOTITLE](/copilot/configuring-github-copilot/installing-the-github-copilot-extension-in-your-environment?tool=eclipse). + +## Using or rebinding keyboard shortcuts for {% data variables.product.prodname_copilot %} + +You can use the default keyboard shortcuts for inline suggestions in Eclipse when using {% data variables.product.prodname_copilot %}. Alternatively, you can rebind the shortcuts to your preferred keyboard shortcuts for each specific command. + +## Rebinding keyboard shortcuts + +If you don't want to use the default keyboard shortcuts for {% data variables.product.prodname_copilot %}, you can rebind the shortcuts in the Key Bindings editor and use your preferred keyboard shortcuts. + +1. In the IDE, click **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}** to open the menu. +1. Click **Edit Keyboard Shortcuts...** to rebind the shortcuts. + +## Settings and configurations + +For advanced settings, you can set auto-completion behavior, configure proxy, and assign a {% data variables.product.prodname_enterprise %} authentication endpoint. + +{% endeclipse %} + ## Authenticating to an account on {% data variables.enterprise.data_residency_site %} {% data reusables.copilot.sign-in-ghecom %} See [AUTOTITLE](/copilot/managing-copilot/configure-personal-settings/using-github-copilot-with-an-account-on-ghecom). diff --git a/content/copilot/managing-copilot/configure-personal-settings/installing-the-github-copilot-extension-in-your-environment.md b/content/copilot/managing-copilot/configure-personal-settings/installing-the-github-copilot-extension-in-your-environment.md index 8eca83b0cb..1587e45900 100644 --- a/content/copilot/managing-copilot/configure-personal-settings/installing-the-github-copilot-extension-in-your-environment.md +++ b/content/copilot/managing-copilot/configure-personal-settings/installing-the-github-copilot-extension-in-your-environment.md @@ -228,6 +228,40 @@ Before you can use the {% data variables.product.prodname_copilot %} extension f {% endxcode %} +{% eclipse %} + +{% data reusables.copilot.eclipse-public-preview-note %} + +## About {% data variables.product.prodname_copilot %} in Eclipse + +Installing {% data variables.product.prodname_copilot %} in Eclipse allows you to receive coding suggestions from {% data variables.product.prodname_copilot_short %} as you type. + +To see instructions for other popular coding environments, use the tool switcher at the top of the page. + +## Prerequisites + +* **Access to {% data variables.product.prodname_copilot_short %}**. To use {% data variables.product.prodname_copilot %} in Eclipse, you must have an active {% data variables.product.prodname_copilot %} subscription. {% data reusables.copilot.subscription-prerequisite %} + +* **Compatible version of Eclipse**. To use {% data variables.product.prodname_copilot %} in Eclipse, you must have Eclipse version 2024-09 or above. For more information on the latest versions, see the [Eclipse download page](https://www.eclipse.org/downloads/packages/). + +## Installing {% data variables.product.prodname_copilot %} in Eclipse + +1. Download and install the latest version of {% data variables.product.prodname_copilot %} in the [Eclipse Marketplace](https://aka.ms/copiloteclipse). + +1. After the extension is installed, restart Eclipse to apply the changes. + +1. In the bottom right corner of the Eclipse workbench, click **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}**, then click **Sign In to {% data variables.product.prodname_dotcom %}**. + +1. In the "Sign In to {% data variables.product.prodname_dotcom %}" dialog box, to copy the device code and open the device activation window, click **Copy Code and Open**. + +1. A device activation window will open in your browser. Paste the device code, then click **Continue**. + +1. {% 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_copilot %} Plugin**. + +1. After the permissions have been approved, Eclipse will show a confirmation. To begin using {% data variables.product.prodname_copilot %}, click **OK**. + +{% endeclipse %} + ## Next steps * **Get started with {% data variables.product.prodname_copilot_short %}** - Learn how to use {% data variables.product.prodname_copilot_short %} in your preferred coding environment. See [AUTOTITLE](/copilot/using-github-copilot/using-github-copilot-code-suggestions-in-your-editor). diff --git a/content/copilot/managing-copilot/configure-personal-settings/using-github-copilot-with-an-account-on-ghecom.md b/content/copilot/managing-copilot/configure-personal-settings/using-github-copilot-with-an-account-on-ghecom.md index 5a9d93de18..7bca7eb88b 100644 --- a/content/copilot/managing-copilot/configure-personal-settings/using-github-copilot-with-an-account-on-ghecom.md +++ b/content/copilot/managing-copilot/configure-personal-settings/using-github-copilot-with-an-account-on-ghecom.md @@ -97,3 +97,17 @@ To authenticate from Visual Studio, follow the steps in [Add your GitHub account For the "{% data variables.product.prodname_enterprise %} URL" field, enter the URL where you access {% data variables.product.github %}. For example: `https://{% data variables.enterprise.data_residency_example_domain %}`. {% endvisualstudio %} + +{% eclipse %} + +## Authenticating from Eclipse + +{% data reusables.copilot.eclipse-public-preview-note %} + +1. In the IDE, click **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}** to open the menu. +1. Click **Edit Preferences...**. +1. In the **{% data variables.product.prodname_enterprise %} Authentication Endpoint** field, enter the URL where you access {% data variables.product.github %}. For example: `https://{% data variables.enterprise.data_residency_example_domain %}`. +1. Click **Apply**. +1. Open the **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}** menu again then click **Sign In to {% data variables.product.prodname_dotcom %}**. + +{% endeclipse %} diff --git a/content/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot.md b/content/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot.md index 81da5ef5d9..6b00c12a09 100644 --- a/content/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot.md +++ b/content/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot.md @@ -484,6 +484,62 @@ You can also open an issue in the [{% data variables.product.prodname_copilot_sh {% endxcode %} +{% eclipse %} + +{% data reusables.copilot.eclipse-public-preview-note %} + +## About {% data variables.product.prodname_copilot %} and Eclipse + +This guide demonstrates how to get coding suggestions from {% data variables.product.prodname_copilot %} in Eclipse. To see instructions for other popular coding environments, use the tool switcher at the top of the page. + +## Prerequisites + +To use {% data variables.product.prodname_copilot %} in Eclipse, you must install the {% data variables.product.prodname_copilot %} extension. See [AUTOTITLE](/copilot/configuring-github-copilot/installing-the-github-copilot-extension-in-your-environment?tool=eclipse). + +## Getting code suggestions + +{% data variables.product.prodname_copilot %} offers coding suggestions as you type. For example, type this function header in a Java file: + +```java copy +public int getDiff(int a, int b) +``` + +{% data variables.product.prodname_copilot %} will automatically suggest the rest of the function. {% data reusables.copilot.accept-suggestion %} +To discard the suggestion, press Esc. + +You can also describe something you want to do using natural language within a comment, and {% data variables.product.prodname_copilot_short %} will suggest the code to accomplish your goal. For example, type this comment in a Java file: + +```java copy +/* + * Return the difference between two different integers. + */ +``` + +{% data variables.product.prodname_copilot %} will automatically suggest code. + +> [!TIP] +> If you receive limited or no suggestions from {% data variables.product.prodname_copilot_short %}, you may have duplication detection enabled. For more information about duplication detection, see [AUTOTITLE](/copilot/configuring-github-copilot/configuring-your-personal-github-copilot-settings-on-githubcom#enabling-or-disabling-suggestions-matching-public-code). + +## Manually triggering code completion + +You can also use keyboard shortcuts to trigger code completion. + +| OS | Trigger code completion | +|:-----------------|:--------------------------------------------------| +| macOS | Option+Command+/ | +| Windows or Linux | Ctrl+Alt+/ | + +## Accepting partial suggestions + +If you don't want to accept an entire suggestion from {% data variables.product.prodname_copilot_short %}, you can accept the next word of a suggestion. + +| OS | Accept next word | +|:-----------------|:-------------------------------------| +| macOS | Command+ | +| Windows or Linux | Ctrl+ | + +{% endeclipse %} + ## Next steps * **Learn how to write effective prompts** - See [AUTOTITLE](/copilot/using-github-copilot/prompt-engineering-for-github-copilot). diff --git a/data/reusables/copilot/differences-cfi-cfb-table.md b/data/reusables/copilot/differences-cfi-cfb-table.md index 37bcc9949e..73332050da 100644 --- a/data/reusables/copilot/differences-cfi-cfb-table.md +++ b/data/reusables/copilot/differences-cfi-cfb-table.md @@ -21,7 +21,7 @@ {% endrowheaders %} -[^1]: Code completion in IDEs is available in {% data variables.product.prodname_vscode %}, {% data variables.product.prodname_vs %}, JetBrains IDEs, Azure Data Studio, Xcode, and Vim/Neovim. +[^1]: Code completion in IDEs is available in {% data variables.product.prodname_vscode %}, {% data variables.product.prodname_vs %}, JetBrains IDEs, Azure Data Studio, Xcode, Vim/Neovim, and Eclipse. [^2]: {% data variables.product.prodname_copilot_chat_short %} in IDEs is available in {% data variables.product.prodname_vscode %}, {% data variables.product.prodname_vs %}, JetBrains IDEs, and Xcode. [^3]: {% data variables.product.prodname_copilot_chat_short %} skills in IDEs is available in {% data variables.product.prodname_vscode %} and {% data variables.product.prodname_vs %}. [^4]: For details about the increased rate limits, see [AUTOTITLE](/github-models/prototyping-with-ai-models). diff --git a/data/reusables/copilot/eclipse-public-preview-note.md b/data/reusables/copilot/eclipse-public-preview-note.md new file mode 100644 index 0000000000..5bc1dbf370 --- /dev/null +++ b/data/reusables/copilot/eclipse-public-preview-note.md @@ -0,0 +1 @@ +> [!NOTE] {% data variables.product.prodname_copilot %} in Eclipse is in {% data variables.release-phases.public_preview %} and subject to change. diff --git a/src/tools/lib/all-tools.js b/src/tools/lib/all-tools.js index e2730c95b0..9390190511 100644 --- a/src/tools/lib/all-tools.js +++ b/src/tools/lib/all-tools.js @@ -8,6 +8,7 @@ export const allTools = { codespaces: 'Codespaces', curl: 'curl', desktop: 'Desktop', + eclipse: 'Eclipse', importer_cli: 'GitHub Enterprise Importer CLI', javascript: 'JavaScript', jetbrains: 'JetBrains IDEs',