Skip to content

Repo sync #39327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions content/copilot/concepts/completions/code-referencing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: Copilot code referencing
shortTitle: Code referencing
allowTitleToDifferFromFilename: true
intro: '{% data variables.product.prodname_copilot %} checks suggestions for matches with publicly available code. Any matches are discarded or suggested with a code reference.'
defaultTool: vscode
topics:
- Copilot
versions:
feature: copilot
type: overview
---

{% jetbrains %}

## About {% data variables.product.prodname_copilot_short %} code referencing in JetBrains IDEs

{% data reusables.copilot.about-code-referencing %}

### Code referencing for {% data variables.product.prodname_copilot_short %} code completion

{% data reusables.copilot.code-referencing-note %}

### Code referencing for {% data variables.copilot.copilot_chat_short %}

{% data reusables.copilot.code-referencing-in-chat %}

{% endjetbrains %}

{% vscode %}

## About {% data variables.product.prodname_copilot_short %} code referencing in {% data variables.product.prodname_vscode %}

{% data reusables.copilot.about-code-referencing %}

### Code referencing for {% data variables.product.prodname_copilot_short %} code completion

{% data reusables.copilot.code-referencing-note %}

### Code referencing for {% data variables.copilot.copilot_chat_short %}

{% data reusables.copilot.code-referencing-in-chat %}

{% endvscode %}

{% webui %}

## About {% data variables.product.prodname_copilot_short %} code referencing on {% data variables.product.prodname_dotcom_the_website %}

If you've allowed suggestions that match public code, then whenever a response from {% data variables.copilot.copilot_chat_short %} includes matching code, details of the matches will be included in the response.

> [!NOTE]
> Typically, matches to public code occur infrequently, so you should not expect to see code references in many {% data variables.copilot.copilot_chat_short %} responses.

{% endwebui %}

{% visualstudio %}

## About {% data variables.product.prodname_copilot_short %} code referencing in {% data variables.product.prodname_vs %}

{% data reusables.copilot.about-code-referencing %}

### Code referencing for {% data variables.product.prodname_copilot_short %} code completion

{% data reusables.copilot.code-referencing-note %}

### Code referencing for {% data variables.copilot.copilot_chat_short %}

When {% data variables.copilot.copilot_chat_short %} provides a response that includes code that matches code in a public {% data variables.product.github %} repository, this is indicated below the suggested code, with a link to display details of the matched code in the output log.

{% endvisualstudio %}

## How code referencing finds matching code

{% data variables.product.prodname_copilot_short %} code referencing searches for matches by taking the code suggestion, plus some of the code that will surround the suggestion if it is accepted, and comparing it against an index of all public repositories on {% data variables.product.prodname_dotcom_the_website %}.

Code in private {% data variables.product.prodname_dotcom %} repositories, or code outside of {% data variables.product.prodname_dotcom %}, is not included in the search process.

The search index is refreshed every few months. As a result, newly committed code, and code from public repositories deleted before the index was created, may not be included in the search. For the same reason, the search may return matches to code that has been deleted or moved since the index was created.

## Limitations

References to matching code are currently available in JetBrains IDEs, {% data variables.product.prodname_vs %}, {% data variables.product.prodname_vscode %}, and on the {% data variables.product.github %} website.

## Further reading

* [AUTOTITLE](/copilot/how-tos/completions/finding-public-code-that-matches-github-copilot-suggestions)
88 changes: 88 additions & 0 deletions content/copilot/concepts/completions/code-suggestions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
title: Copilot code suggestions in your IDE
shortTitle: IDE code suggestions
allowTitleToDifferFromFilename: true
intro: Learn about {% data variables.product.prodname_copilot_short %} code suggestions in different IDEs.'
versions:
feature: copilot
type: overview
defaultTool: vscode
topics:
- Copilot
---

{% vscode %}

## About code suggestions in {% data variables.product.prodname_vscode %}

{% data variables.product.prodname_copilot_short %} in {% data variables.product.prodname_vscode %} provides two kinds of code suggestions:

* **Code completion**
* {% data variables.product.prodname_copilot_short %} offers coding suggestions as you type. 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.
* **{% data variables.copilot.next_edit_suggestions_caps %} ({% data variables.release-phases.public_preview %})**
* Based on the edits you are making, {% data variables.product.prodname_copilot_short %} will predict the location of the next edit you are likely to make and suggest a completion for it. Suggestions may span a single symbol, an entire line, or multiple lines, depending on the scope of the potential change. To enable {% data variables.copilot.next_edit_suggestions %}, see [AUTOTITLE](/copilot/managing-copilot/configure-personal-settings/configuring-github-copilot-in-your-environment#enabling-next-edit-suggestions).

{% data reusables.copilot.supported-languages %}

{% endvscode %}

{% jetbrains %}

## About code suggestions in JetBrains IDEs

{% data variables.product.prodname_copilot_short %} offers code completion suggestions as you type.

{% data reusables.copilot.supported-languages %}

{% endjetbrains %}

{% visualstudio %}

## About code suggestions in {% data variables.product.prodname_vs %}

{% data variables.product.prodname_copilot_short %} in {% data variables.product.prodname_vs %} provides two kinds of code suggestions:

* **Code completion**
* {% data variables.product.prodname_copilot_short %} offers coding suggestions as you type.
* **{% data variables.copilot.next_edit_suggestions_caps %} ({% data variables.release-phases.public_preview %})**
* Based on the edits you are making, {% data variables.product.prodname_copilot_short %} will predict the location of the next edit you are likely to make and suggest a completion for it. Suggestions may span a single symbol, an entire line, or multiple lines, depending on the scope of the potential change. To enable {% data variables.copilot.next_edit_suggestions %}, see [AUTOTITLE](/copilot/managing-copilot/configure-personal-settings/configuring-github-copilot-in-your-environment#enabling-next-edit-suggestions).

{% data reusables.copilot.supported-languages %}

{% endvisualstudio %}

{% vimneovim %}

## About code suggestions in Vim/Neovim

{% data variables.product.prodname_copilot %} provides code completion suggestions inline as you type in Vim/Neovim.

{% endvimneovim %}

{% azure_data_studio %}

## About code suggestions in Azure Data Studio

{% data variables.product.prodname_copilot %} provides you with inline suggestions as you create SQL databases in Azure Data Studio.

{% endazure_data_studio %}

{% xcode %}

## About code suggestions in Xcode

{% data variables.product.prodname_copilot %} offers code completion suggestions as you type.

{% endxcode %}

{% eclipse %}

## About code suggestions in Eclipse

{% data variables.product.prodname_copilot %} offers code completion suggestions as you type.

{% endeclipse %}

## Next steps

* [AUTOTITLE](/copilot/how-tos/completions/getting-code-suggestions-in-your-ide-with-github-copilot)
13 changes: 13 additions & 0 deletions content/copilot/concepts/completions/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: 'Completions for GitHub Copilot'
shortTitle: Completions
intro: 'Learn about code completions from {% data variables.product.prodname_copilot %}.'
versions:
feature: copilot
topics:
- Copilot
children:
- /code-suggestions
- /text-completion
- /code-referencing
---
23 changes: 23 additions & 0 deletions content/copilot/concepts/completions/text-completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Copilot text completion
shortTitle: Text completion
allowTitleToDifferFromFilename: true
intro: 'Learn about {% data variables.copilot.copilot_autocomplete_pr %}.'
versions:
feature: copilot-enterprise
permissions: 'Members of an enterprise with a subscription to [{% data variables.copilot.copilot_enterprise %}](/copilot/github-copilot-enterprise/overview/about-github-copilot-enterprise)'
topics:
- Copilot
---

{% data reusables.copilot.text-completion-preview %}

## About {% data variables.copilot.copilot_autocomplete_pr %}

With {% data variables.copilot.copilot_autocomplete_pr %}, you can use AI-generated autocompletions to help you write pull request descriptions quickly and accurately. Accurate descriptions help reviewers understand the changes you're proposing, and help you communicate the purpose of your pull request more effectively.

When you are creating a new pull request, {% data variables.copilot.copilot_autocomplete_pr %} will scan through the pull request and provide suggestions as you write, based on the context of the pull request.

## Next steps

* [AUTOTITLE](/copilot/how-tos/completions/using-copilot-text-completion)
1 change: 1 addition & 0 deletions content/copilot/concepts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ topics:
- Copilot
children:
- /copilot-billing
- /completions
- /prompt-engineering-for-copilot-chat
- /about-customizing-github-copilot-chat-responses
- /content-exclusion-for-github-copilot
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Finding public code that matches GitHub Copilot suggestions
shortTitle: Find matching code
intro: 'If you allow {% data variables.product.prodname_copilot %} to make suggestions that match publicly available code, {% data variables.product.prodname_copilot_short %} will display references to any similar code that is found.'
intro: 'Learn how to view code references when {% data variables.product.prodname_copilot %} makes suggestions that matches publicly available code.'
defaultTool: vscode
redirect_from:
- /early-access/copilot/code-referencing-in-github-copilot
Expand All @@ -10,9 +10,9 @@ topics:
- Copilot
versions:
feature: copilot
type: how_to
---


{% jetbrains %}

This version of this article is for {% data variables.product.prodname_copilot_short %} in JetBrains IDEs. For {% data variables.product.prodname_copilot_short %} on other platforms, click the appropriate tab above.
Expand All @@ -37,88 +37,15 @@ This version of this article is for {% data variables.product.prodname_copilot_s

{% endvisualstudio %}

## Limitations

References to matching code are currently available in JetBrains IDEs, {% data variables.product.prodname_vs %}, {% data variables.product.prodname_vscode %}, and on the {% data variables.product.github %} website.

## Prerequisites

References to matching code are only generated if {% data variables.product.prodname_copilot_short %} is configured to allow suggestions that match publicly available code. This is configured in either your personal{% ifversion ghec %},{% else %} or {% endif %} organization{% ifversion ghec %} or enterprise{% endif %} settings. For more information, see [AUTOTITLE](/copilot/configuring-github-copilot/configuring-your-personal-github-copilot-settings-on-githubcom#enabling-or-disabling-suggestions-matching-public-code){% ifversion ghec %},{% else %} or {% endif %} [AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching){% ifversion ghec %} or [AUTOTITLE](/copilot/managing-copilot/managing-copilot-for-your-enterprise/managing-policies-and-features-for-copilot-in-your-enterprise){% endif %}.

## About code referencing in {% data variables.product.prodname_copilot %}

{% jetbrains %}

{% data reusables.copilot.about-code-referencing %}

{% endjetbrains %}

{% vscode %}

{% data reusables.copilot.about-code-referencing %}

{% endvscode %}

{% webui %}

If you've allowed suggestions that match public code, then whenever a response from {% data variables.copilot.copilot_chat_short %} includes matching code, details of the matches will be included in the response.
## Introduction

{% endwebui %}

{% visualstudio %}
If you allow {% data variables.product.prodname_copilot %} to make suggestions that match publicly available code, {% data variables.product.prodname_copilot_short %} will display references to any similar code that is found. See [AUTOTITLE](/copilot/concepts/completions/code-referencing).

{% data reusables.copilot.about-code-referencing %}
### Prerequisites

{% endvisualstudio %}
References to matching code are only generated if {% data variables.product.prodname_copilot_short %} is configured to allow suggestions that match publicly available code. This is configured in either your personal{% ifversion ghec %},{% else %} or {% endif %} organization{% ifversion ghec %} or enterprise{% endif %} settings.

This feature is called code referencing.

{% jetbrains %}

### Code referencing for {% data variables.product.prodname_copilot_short %} code completion

{% data reusables.copilot.code-referencing-note %}

### Code referencing for {% data variables.copilot.copilot_chat_short %}

{% data reusables.copilot.code-referencing-in-chat %}

{% endjetbrains %}

{% webui %}

> [!NOTE]
> Typically, matches to public code occur infrequently, so you should not expect to see code references in many {% data variables.copilot.copilot_chat_short %} responses.

{% endwebui %}

{% vscode %}

### Code referencing for {% data variables.product.prodname_copilot_short %} code completion

{% data reusables.copilot.code-referencing-note %}

### Code referencing for {% data variables.copilot.copilot_chat_short %}

{% data reusables.copilot.code-referencing-in-chat %}

{% endvscode %}

{% visualstudio %}

### Code referencing for {% data variables.product.prodname_copilot_short %} code completion

{% data reusables.copilot.code-referencing-note %}

### Code referencing for {% data variables.copilot.copilot_chat_short %}

When {% data variables.copilot.copilot_chat_short %} provides a response that includes code that matches code in a public {% data variables.product.github %} repository, this is indicated below the suggested code, with a link to display details of the matched code in the output log.

{% endvisualstudio %}

### How code referencing finds matching code

{% data variables.product.prodname_copilot_short %} code referencing searches for matches by taking the code suggestion, plus some of the code that will surround the suggestion if it is accepted, and comparing it against an index of all public repositories on {% data variables.product.prodname_dotcom_the_website %}. Code in private {% data variables.product.prodname_dotcom %} repositories, or code outside of {% data variables.product.prodname_dotcom %}, is not included in the search process. The search index is refreshed every few months. As a result, newly committed code, and code from public repositories deleted before the index was created, may not be included in the search. For the same reason, the search may return matches to code that has been deleted or moved since the index was created.
For more information, see [AUTOTITLE](/copilot/configuring-github-copilot/configuring-your-personal-github-copilot-settings-on-githubcom#enabling-or-disabling-suggestions-matching-public-code){% ifversion ghec %},{% else %} or {% endif %} [AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching){% ifversion ghec %} or [AUTOTITLE](/copilot/managing-copilot/managing-copilot-for-your-enterprise/managing-policies-and-features-for-copilot-in-your-enterprise){% endif %}.

{% jetbrains %}

Expand Down Expand Up @@ -301,3 +228,7 @@ To see details of the matching code:
1. Click the name of a repository to display that repository on {% data variables.product.prodname_dotcom_the_website %}.

{% endwebui %}

## Further reading

* [AUTOTITLE](/copilot/concepts/completions/code-referencing)
Loading
Loading