Skip to content

Commit e1cb0af

Browse files
am-steadfelicitymaymchammer01
authored
[EDI - Builders] - Copilot "How-Tos" ("Completions") #5524 (#56523)
Co-authored-by: Felicity Chapman <[email protected]> Co-authored-by: mc <[email protected]>
1 parent bc36811 commit e1cb0af

File tree

10 files changed

+264
-124
lines changed

10 files changed

+264
-124
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: Copilot code referencing
3+
shortTitle: Code referencing
4+
allowTitleToDifferFromFilename: true
5+
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.
84+
85+
## Further reading
86+
87+
* [AUTOTITLE](/copilot/how-tos/completions/finding-public-code-that-matches-github-copilot-suggestions)
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
title: Copilot code suggestions in your IDE
3+
shortTitle: IDE code suggestions
4+
allowTitleToDifferFromFilename: true
5+
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.
83+
84+
{% endeclipse %}
85+
86+
## Next steps
87+
88+
* [AUTOTITLE](/copilot/how-tos/completions/getting-code-suggestions-in-your-ide-with-github-copilot)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: 'Completions for GitHub Copilot'
3+
shortTitle: Completions
4+
intro: 'Learn about code completions from {% data variables.product.prodname_copilot %}.'
5+
versions:
6+
feature: copilot
7+
topics:
8+
- Copilot
9+
children:
10+
- /code-suggestions
11+
- /text-completion
12+
- /code-referencing
13+
---
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Copilot text completion
3+
shortTitle: Text completion
4+
allowTitleToDifferFromFilename: true
5+
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.
20+
21+
## Next steps
22+
23+
* [AUTOTITLE](/copilot/how-tos/completions/using-copilot-text-completion)

content/copilot/concepts/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ topics:
88
- Copilot
99
children:
1010
- /copilot-billing
11+
- /completions
1112
- /prompt-engineering-for-copilot-chat
1213
- /about-customizing-github-copilot-chat-responses
1314
- /content-exclusion-for-github-copilot

content/copilot/how-tos/completions/finding-public-code-that-matches-github-copilot-suggestions.md

Lines changed: 11 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Finding public code that matches GitHub Copilot suggestions
33
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.'
55
defaultTool: vscode
66
redirect_from:
77
- /early-access/copilot/code-referencing-in-github-copilot
@@ -10,9 +10,9 @@ topics:
1010
- Copilot
1111
versions:
1212
feature: copilot
13+
type: how_to
1314
---
1415

15-
1616
{% jetbrains %}
1717

1818
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
3737

3838
{% endvisualstudio %}
3939

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
6541

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).
6943

70-
{% data reusables.copilot.about-code-referencing %}
44+
### Prerequisites
7145

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.
7347

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 %}.
12249

12350
{% jetbrains %}
12451

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

303230
{% endwebui %}
231+
232+
## Further reading
233+
234+
* [AUTOTITLE](/copilot/concepts/completions/code-referencing)

0 commit comments

Comments
 (0)