Skip to content

Commit a525412

Browse files
committed
Update tutorial with Copilot
1 parent a527539 commit a525412

File tree

3 files changed

+34
-12
lines changed

3 files changed

+34
-12
lines changed

docs/getstarted/getting-started.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -305,19 +305,41 @@ There are many more debugging features in VS Code, such as watch variables, cond
305305
306306
## Enhance your coding with AI and GitHub Copilot
307307
308-
With [GitHub Copilot](/docs/copilot/overview.md), you can further enhance your coding experience in VS Code and even discover VS Code features and settings you didn't know about.
308+
GitHub Copilot is an AI-powered assistant that helps you write code faster, and can help you with a wide range of tasks, such as code completion, code refactoring, and fixing errors.
309309
310-
GitHub Copilot in VS Code can help you with a wide range of tasks, such as:
310+
Let's get started by getting code suggestions from Copilot.
311311

312-
- **Code completion**: Get suggestions for lines of code or entire functions.
313-
- **Explain code**: Get explanations for code snippets to help you understand what they do.
314-
- **Code refactoring & generation**: Refactor your code and generate code-related artifacts like tests or documentation.
315-
- **Fix errors**: Get help with common coding tasks like finding and fixing bugs, or errors with shell commands.
316-
- **Learn about VS Code**: Ask about VS Code features, settings, or commands.
312+
1. Make sure you have set up Copilot in VS Code. Follow the steps in our [Copilot Setup](/docs/copilot/setup.md) guide.
317313

318-
<video src="./images/getting-started/copilot-chat-intro.mp4" title="Video showing Copilot Chat used for asking about VS Code, explaining what a project does, and generating unit tests." autoplay loop controls muted></video>
314+
> [!TIP]
315+
> If you don't have a Copilot subscription yet, you can use Copilot for free by signing up for the [Copilot Free plan](https://github.com/github-copilot/signup) and get a monthly limit of completions and chat interactions.
316+
317+
1. In the `hello.py` file, place the cursor at the end of the file and type this function header.
318+
319+
```python
320+
def say_day_of_week(date)
321+
```
322+
323+
GitHub Copilot will automatically suggest the rest of the function. Accept the code suggestion by pressing `kbstyle(Tab)`.
324+
325+
1. Next, let's invoke our new function.
326+
327+
```python
328+
say_day_of_week(date.today())
329+
```
330+
331+
Notice that there's a squiggle on the `date` keyword, indicating that there's an error.
332+
333+
1. Put the cursor, on the `date` keyword, select the _lightbulb_ icon, and then select **Fix with Copilot**.
334+
335+
![Screenshot that shows the lightbulb Code Action to fix an error with Copilot.](images/getting-started/code-action-fix-with-copilot.png)
336+
337+
GitHub Copilot will suggest a fix for the error. Select **Accept** if you're happy with the suggestion.
338+
339+
> [!TIP]
340+
> You can also use the `kb(editor.action.quickFix)` keyboard shortcut to manually trigger a quick fix.
319341
320-
> <a class="install-extension-btn" href="vscode:extension/GitHub.copilot">Install the GitHub Copilot extension</a>
342+
There's a lot more you can do with Copilot in VS Code. Discover more about GitHub Copilot in VS Code with our [Copilot Quickstart](/docs/copilot/getting-started.md).
321343

322344
## Next steps
323345

Lines changed: 3 additions & 0 deletions
Loading

docs/getstarted/images/getting-started/copilot-chat-intro.mp4

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)