Skip to content

Commit 74a1ccc

Browse files
jc-clarklecoursen
andauthored
Add content on setting up Copilot for learning to code (#55316)
Co-authored-by: Laura Coursen <[email protected]>
1 parent ee2fd28 commit 74a1ccc

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

content/get-started/learning-to-code/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ children:
77
- /getting-started-with-git
88
- /finding-and-understanding-example-code
99
- /reusing-other-peoples-code-in-your-projects
10+
- /setting-up-copilot-for-learning-to-code
1011
- /learning-to-debug-with-github-copilot
1112
- /storing-your-secrets-safely
1213
shortTitle: Learn to code
1314
---
15+
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: Setting up Copilot for learning to code
3+
intro: 'Configure {% data variables.product.prodname_copilot_short %} to help you learn coding concepts and actively build your programming skills.'
4+
versions:
5+
fpt: '*'
6+
topics:
7+
- Copilot
8+
shortTitle: Set up Copilot for learning
9+
---
10+
11+
## Can {% data variables.product.prodname_copilot_short %} help me learn to code?
12+
13+
Yes! {% data variables.product.prodname_copilot_short %} can adapt to meet your changing needs throughout your coding journey. When you're an experienced developer, you'll use {% data variables.product.prodname_copilot_short %} as a coding assistant. While you're learning to code, it's more beneficial as a **supportive companion**.
14+
15+
In this guide, you’ll learn how to set up {% data variables.product.prodname_copilot_short %} to act as a **tutor** that will help you build a deep understanding of programming concepts, rather than relying on it to write your code for you. To optimize your learning, follow these steps for each repository you work on!
16+
17+
## Prerequisites
18+
19+
This guide assumes that you'll use {% data variables.product.prodname_copilot_short %} in {% data variables.product.prodname_vscode_shortname %}. To get set up, see [Set up Copilot in {% data variables.product.prodname_vscode_shortname %}](https://code.visualstudio.com/docs/copilot/setup-simplified) in the {% data variables.product.prodname_vscode %} documentation.
20+
21+
## Step 1: Disable code completions
22+
23+
First, let's disable code completions. This will give you the opportunity to deepen your understanding of programming concepts by writing more code yourself.
24+
25+
1. In {% data variables.product.prodname_vscode_shortname %}, open your project.
26+
1. Create a folder in the root directory called `.vscode`.
27+
1. Inside `.vscode`, create a file called `settings.json`.
28+
1. Add the following text to the file:
29+
30+
```json copy
31+
{
32+
"github.copilot.enable": {
33+
"*": false
34+
}
35+
}
36+
```
37+
38+
1. Save the file. {% data variables.product.prodname_copilot_short %} code completions are now disabled for this project in {% data variables.product.prodname_vscode_shortname %}.
39+
40+
## Step 2: Add learning instructions
41+
42+
Now, let's provide {% data variables.product.prodname_copilot_chat_short %} with instructions to act like a tutor that supports your learning.
43+
44+
1. In the root folder of your project, create a file called `copilot-instructions.md`.
45+
1. Add the following text, or customize it for your personal learning goals:
46+
47+
```markdown copy
48+
I am learning to code. You are to act as a tutor; assume I am a beginning coder. Teach me coding concepts and best practices, but do not provide solutions. Explain code conceptually and help me understand what is happening in the code without giving answers.
49+
50+
Do not provide code snippets, even if I ask you for implementation advice in my prompts. Teach me all the basic coding concepts in your answers. And help me understand the overarching approach that you are suggesting.
51+
52+
Whenever possible, share links to relevant external documentation and sources of truth.
53+
54+
At the end of every response, add "Always check the correctness of AI-generated responses."
55+
```
56+
57+
1. Save the file. {% data variables.product.prodname_copilot_short %} will use these instructions when you ask questions in {% data variables.product.prodname_copilot_chat_short %}.
58+
59+
## Step 3: Use {% data variables.product.prodname_copilot_chat_short %} to learn
60+
61+
You're ready to start building real coding skills with {% data variables.product.prodname_copilot_short %}'s help!
62+
63+
Throughout your work on the project, engage in a long-running conversation with **{% data variables.product.prodname_copilot_chat_short %}**. Treat it as your **personal tutor**, asking questions as they arise and using it to navigate challenges or clarify concepts.
64+
65+
> [!TIP] You can open {% data variables.product.prodname_copilot_chat_short %} with a keyboard shortcut: <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>I</kbd> (Windows/Linux) or <kbd>Command</kbd>+<kbd>Shift</kbd>+<kbd>I</kbd> (Mac).
66+
67+
{% data variables.product.prodname_copilot_chat_short %} is especially helpful for debugging your code. For step-by-step guidance, see [AUTOTITLE](/get-started/learning-to-code/learning-to-debug-with-github-copilot).

0 commit comments

Comments
 (0)