Skip to content

Commit 424848f

Browse files
authored
Merge pull request #7814 from microsoft/copilot-custom-instructions
Copilot-custom-instructions
2 parents c32a292 + 5aea0fb commit 424848f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

docs/copilot/copilot-customization.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ Custom instructions consist of natural language instructions and should be short
2626

2727
Copilot can help you generate code, for example as part of a refactoring, generating unit tests, or implementing a feature. You might have specific libraries you want to use in your project, or a particular coding style you want to follow for the code that Copilot generates.
2828

29+
> [!NOTE]
30+
> Copilot does not apply code-generation instructions for [code completions](/docs/copilot/ai-powered-suggestions.md).
31+
2932
### Use settings
3033

3134
You can configure custom code-generation instructions by using the `setting(github.copilot.chat.codeGeneration.instructions)` setting. You can define custom instructions at the User or Workspace level, and you can also specify language-specific instructions. Get more information about [language-specific settings](/docs/getstarted/settings.md#language-specific-editor-settings).
@@ -58,8 +61,10 @@ Always add comments.
5861

5962
You can also store custom instructions in your workspace or repository in a `.github/copilot-instructions.md` file and have VS Code automatically picks up this file.
6063

64+
If you define custom instructions in both the `.github/copilot-instructions.md` file and in settings, Copilot tries to combine instructions from both sources.
65+
6166
> [!NOTE]
62-
> GitHub Copilot in Visual Studio also detect the `.github/copilot-instructions.md` file. If you have a workspace that you use in both VS Code and Visual Studio, you can use the same file to define custom instructions for both editors.
67+
> GitHub Copilot in Visual Studio also detects the `.github/copilot-instructions.md` file. If you have a workspace that you use in both VS Code and Visual Studio, you can use the same file to define custom instructions for both editors.
6368
6469
1. Set the `setting(github.copilot.chat.codeGeneration.useInstructionFiles)` setting to `true` to instruct Copilot in VS Code to use the custom instructions file.
6570

@@ -76,7 +81,7 @@ You can also store custom instructions in your workspace or repository in a `.gi
7681

7782
You can use Copilot to generate tests for your code, for example by using the `@workspace /tests` prompt in the Chat view. You can define custom instructions to help Copilot generate tests that are specific to your project and development workflow.
7883

79-
To configure custom test-generation instructions, use the `setting(github.copilot.chat.testGeneration.instructions)` setting. You can define custom instructions at the User or Workspace level, and you can also specify language-specific instructions. Get more information about [language-specific settings](/docs/getstarted/settings.md#language-specific-editor-settings). For example, you might specify a different testing framework to use for each language.
84+
To configure custom test-generation instructions, use the `setting(github.copilot.chat.testGeneration.instructions)` setting. You can define custom instructions at the User or Workspace level.
8085

8186
The following code snippet shows how to define a set of instructions in the `settings.json` file. To define instruction directly in settings, configure the `text` property. To reference an external file, configure the `file` property.
8287

@@ -108,8 +113,6 @@ Always use React functional components.
108113

109114
* Don't refer to external resources in the instructions, such as specific coding standards.
110115

111-
* Define language-specific instructions to get more accurate generated code for each language.
112-
113116
* Make it easy to share custom instructions with your team or across projects by storing your instructions in an external file. You can also version control the file to track changes over time.
114117

115118
## Settings

0 commit comments

Comments
 (0)