You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
intro: '{% data variables.product.prodname_copilot %} checks suggestions for matches with publicly available code. Any matches are discarded or suggested with a code reference.'
6
+
defaultTool: vscode
7
+
topics:
8
+
- Copilot
9
+
versions:
10
+
feature: copilot
11
+
type: overview
12
+
---
13
+
14
+
{% jetbrains %}
15
+
16
+
## About {% data variables.product.prodname_copilot_short %} code referencing in JetBrains IDEs
17
+
18
+
{% data reusables.copilot.about-code-referencing %}
19
+
20
+
### Code referencing for {% data variables.product.prodname_copilot_short %} code completion
21
+
22
+
{% data reusables.copilot.code-referencing-note %}
23
+
24
+
### Code referencing for {% data variables.copilot.copilot_chat_short %}
25
+
26
+
{% data reusables.copilot.code-referencing-in-chat %}
27
+
28
+
{% endjetbrains %}
29
+
30
+
{% vscode %}
31
+
32
+
## About {% data variables.product.prodname_copilot_short %} code referencing in {% data variables.product.prodname_vscode %}
33
+
34
+
{% data reusables.copilot.about-code-referencing %}
35
+
36
+
### Code referencing for {% data variables.product.prodname_copilot_short %} code completion
37
+
38
+
{% data reusables.copilot.code-referencing-note %}
39
+
40
+
### Code referencing for {% data variables.copilot.copilot_chat_short %}
41
+
42
+
{% data reusables.copilot.code-referencing-in-chat %}
43
+
44
+
{% endvscode %}
45
+
46
+
{% webui %}
47
+
48
+
## About {% data variables.product.prodname_copilot_short %} code referencing on {% data variables.product.prodname_dotcom_the_website %}
49
+
50
+
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.
51
+
52
+
> [!NOTE]
53
+
> 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.
54
+
55
+
{% endwebui %}
56
+
57
+
{% visualstudio %}
58
+
59
+
## About {% data variables.product.prodname_copilot_short %} code referencing in {% data variables.product.prodname_vs %}
60
+
61
+
{% data reusables.copilot.about-code-referencing %}
62
+
63
+
### Code referencing for {% data variables.product.prodname_copilot_short %} code completion
64
+
65
+
{% data reusables.copilot.code-referencing-note %}
66
+
67
+
### Code referencing for {% data variables.copilot.copilot_chat_short %}
68
+
69
+
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.
70
+
71
+
{% endvisualstudio %}
72
+
73
+
## How code referencing finds matching code
74
+
75
+
{% 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 %}.
76
+
77
+
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.
78
+
79
+
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.
80
+
81
+
## Limitations
82
+
83
+
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.
intro: Learn about {% data variables.product.prodname_copilot_short %} code suggestions in different IDEs.'
6
+
versions:
7
+
feature: copilot
8
+
type: overview
9
+
defaultTool: vscode
10
+
topics:
11
+
- Copilot
12
+
---
13
+
14
+
{% vscode %}
15
+
16
+
## About code suggestions in {% data variables.product.prodname_vscode %}
17
+
18
+
{% data variables.product.prodname_copilot_short %} in {% data variables.product.prodname_vscode %} provides two kinds of code suggestions:
19
+
20
+
***Code completion**
21
+
* {% 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.
22
+
***{% data variables.copilot.next_edit_suggestions_caps %} ({% data variables.release-phases.public_preview %})**
23
+
* 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).
24
+
25
+
{% data reusables.copilot.supported-languages %}
26
+
27
+
{% endvscode %}
28
+
29
+
{% jetbrains %}
30
+
31
+
## About code suggestions in JetBrains IDEs
32
+
33
+
{% data variables.product.prodname_copilot_short %} offers code completion suggestions as you type.
34
+
35
+
{% data reusables.copilot.supported-languages %}
36
+
37
+
{% endjetbrains %}
38
+
39
+
{% visualstudio %}
40
+
41
+
## About code suggestions in {% data variables.product.prodname_vs %}
42
+
43
+
{% data variables.product.prodname_copilot_short %} in {% data variables.product.prodname_vs %} provides two kinds of code suggestions:
44
+
45
+
***Code completion**
46
+
* {% data variables.product.prodname_copilot_short %} offers coding suggestions as you type.
47
+
***{% data variables.copilot.next_edit_suggestions_caps %} ({% data variables.release-phases.public_preview %})**
48
+
* 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).
49
+
50
+
{% data reusables.copilot.supported-languages %}
51
+
52
+
{% endvisualstudio %}
53
+
54
+
{% vimneovim %}
55
+
56
+
## About code suggestions in Vim/Neovim
57
+
58
+
{% data variables.product.prodname_copilot %} provides code completion suggestions inline as you type in Vim/Neovim.
59
+
60
+
{% endvimneovim %}
61
+
62
+
{% azure_data_studio %}
63
+
64
+
## About code suggestions in Azure Data Studio
65
+
66
+
{% data variables.product.prodname_copilot %} provides you with inline suggestions as you create SQL databases in Azure Data Studio.
67
+
68
+
{% endazure_data_studio %}
69
+
70
+
{% xcode %}
71
+
72
+
## About code suggestions in Xcode
73
+
74
+
{% data variables.product.prodname_copilot %} offers code completion suggestions as you type.
75
+
76
+
{% endxcode %}
77
+
78
+
{% eclipse %}
79
+
80
+
## About code suggestions in Eclipse
81
+
82
+
{% data variables.product.prodname_copilot %} offers code completion suggestions as you type.
intro: 'Learn about {% data variables.copilot.copilot_autocomplete_pr %}.'
6
+
versions:
7
+
feature: copilot-enterprise
8
+
permissions: 'Members of an enterprise with a subscription to [{% data variables.copilot.copilot_enterprise %}](/copilot/github-copilot-enterprise/overview/about-github-copilot-enterprise)'
9
+
topics:
10
+
- Copilot
11
+
---
12
+
13
+
{% data reusables.copilot.text-completion-preview %}
14
+
15
+
## About {% data variables.copilot.copilot_autocomplete_pr %}
16
+
17
+
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.
18
+
19
+
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.
Copy file name to clipboardExpand all lines: content/copilot/how-tos/completions/finding-public-code-that-matches-github-copilot-suggestions.md
+11-80Lines changed: 11 additions & 80 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Finding public code that matches GitHub Copilot suggestions
3
3
shortTitle: Find matching code
4
-
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.'
4
+
intro: 'Learn how to view code references when {% data variables.product.prodname_copilot %} makes suggestions that matches publicly available code.'
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.
@@ -37,88 +37,15 @@ This version of this article is for {% data variables.product.prodname_copilot_s
37
37
38
38
{% endvisualstudio %}
39
39
40
-
## Limitations
41
-
42
-
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.
43
-
44
-
## Prerequisites
45
-
46
-
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 %}.
47
-
48
-
## About code referencing in {% data variables.product.prodname_copilot %}
49
-
50
-
{% jetbrains %}
51
-
52
-
{% data reusables.copilot.about-code-referencing %}
53
-
54
-
{% endjetbrains %}
55
-
56
-
{% vscode %}
57
-
58
-
{% data reusables.copilot.about-code-referencing %}
59
-
60
-
{% endvscode %}
61
-
62
-
{% webui %}
63
-
64
-
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.
40
+
## Introduction
65
41
66
-
{% endwebui %}
67
-
68
-
{% visualstudio %}
42
+
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).
69
43
70
-
{% data reusables.copilot.about-code-referencing %}
44
+
### Prerequisites
71
45
72
-
{% endvisualstudio %}
46
+
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.
73
47
74
-
This feature is called code referencing.
75
-
76
-
{% jetbrains %}
77
-
78
-
### Code referencing for {% data variables.product.prodname_copilot_short %} code completion
79
-
80
-
{% data reusables.copilot.code-referencing-note %}
81
-
82
-
### Code referencing for {% data variables.copilot.copilot_chat_short %}
83
-
84
-
{% data reusables.copilot.code-referencing-in-chat %}
85
-
86
-
{% endjetbrains %}
87
-
88
-
{% webui %}
89
-
90
-
> [!NOTE]
91
-
> 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.
92
-
93
-
{% endwebui %}
94
-
95
-
{% vscode %}
96
-
97
-
### Code referencing for {% data variables.product.prodname_copilot_short %} code completion
98
-
99
-
{% data reusables.copilot.code-referencing-note %}
100
-
101
-
### Code referencing for {% data variables.copilot.copilot_chat_short %}
102
-
103
-
{% data reusables.copilot.code-referencing-in-chat %}
104
-
105
-
{% endvscode %}
106
-
107
-
{% visualstudio %}
108
-
109
-
### Code referencing for {% data variables.product.prodname_copilot_short %} code completion
110
-
111
-
{% data reusables.copilot.code-referencing-note %}
112
-
113
-
### Code referencing for {% data variables.copilot.copilot_chat_short %}
114
-
115
-
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.
116
-
117
-
{% endvisualstudio %}
118
-
119
-
### How code referencing finds matching code
120
-
121
-
{% 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.
48
+
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 %}.
122
49
123
50
{% jetbrains %}
124
51
@@ -301,3 +228,7 @@ To see details of the matching code:
301
228
1. Click the name of a repository to display that repository on {% data variables.product.prodname_dotcom_the_website %}.
0 commit comments