WEBVTT

00:00.150 --> 00:02.100
-: In this video, we're gonna have a look at

00:02.100 --> 00:04.020
some of Copilot's features.

00:04.020 --> 00:06.270
We're gonna explore this by using and altering

00:06.270 --> 00:08.640
some Python code inside of a Jupyter Notebook.

00:08.640 --> 00:10.230
Let's get started.

00:10.230 --> 00:14.130
To start with, we have a complicated bubble sort function.

00:14.130 --> 00:15.780
Maybe you don't know what this means,

00:15.780 --> 00:17.580
or you need some sort of explanation

00:17.580 --> 00:21.030
for some complicated code with inside any of your projects.

00:21.030 --> 00:24.000
We can do this by simply hovering over the code,

00:24.000 --> 00:26.520
right clicking on it, going to Copilot,

00:26.520 --> 00:28.470
and saying, "explain this".

00:28.470 --> 00:30.690
You'll see on the left hand side of the screen

00:30.690 --> 00:33.300
that Copilot chat automatically opens

00:33.300 --> 00:35.460
with the slash explain.

00:35.460 --> 00:36.840
Copilot chat then provides us

00:36.840 --> 00:40.740
with a detailed explanation of that specific code snippet.

00:40.740 --> 00:43.320
This is a really great way for understanding

00:43.320 --> 00:46.500
very complicated code in a short span of time.

00:46.500 --> 00:47.400
Let's move on.

00:47.400 --> 00:49.200
Maybe sometimes you've got some broken code

00:49.200 --> 00:51.570
or you're looking specifically for a bug

00:51.570 --> 00:52.950
inside of your code.

00:52.950 --> 00:56.040
We have this example of a find maximum function.

00:56.040 --> 00:57.240
If I highlight this,

00:57.240 --> 00:59.190
there's actually currently an error in here.

00:59.190 --> 01:02.820
What I can do is I can right click, go fix this.

01:02.820 --> 01:05.880
Then what happens is you'll see Copilot has been presented

01:05.880 --> 01:07.860
with this flash fix preset.

01:07.860 --> 01:10.170
Copilot will then try and fix the code,

01:10.170 --> 01:11.700
and then on the right hand side

01:11.700 --> 01:16.140
you can see it's given us a proposed edit to change.

01:16.140 --> 01:19.230
What we can then do is we can either accept this,

01:19.230 --> 01:22.260
regenerate, or discard.

01:22.260 --> 01:23.310
I'm gonna accept this change

01:23.310 --> 01:25.890
because I believe that Copilot has generated the right code.

01:25.890 --> 01:28.500
Another couple of interesting use cases are

01:28.500 --> 01:32.850
if you go into the bottom left into the Copilot chat window,

01:32.850 --> 01:35.850
if we click on a specific Jupyter Notebook cell,

01:35.850 --> 01:38.430
we can type then for example, tests.

01:38.430 --> 01:40.500
So it'll be slash tests

01:40.500 --> 01:42.420
and it will generate all of the unit tests

01:42.420 --> 01:44.550
for whatever Jupyter Notebook cell we've clicked on.

01:44.550 --> 01:48.180
So in this case, it's doing it for a calculator.

01:48.180 --> 01:50.850
However, if I scroll up to bubble sort

01:50.850 --> 01:52.830
and then I then just wait for this generation,

01:52.830 --> 01:55.650
we'll see what it would do is it would generate tests

01:55.650 --> 01:58.920
specifically for the bubble sort function.

01:58.920 --> 02:01.560
So this is a great way for you to easily, you know,

02:01.560 --> 02:04.530
look at specific bits of code inside of your Python files

02:04.530 --> 02:07.920
or your Jupyter Notebook files and generate effective tests.

02:07.920 --> 02:09.900
If you want to see all the different types of commands

02:09.900 --> 02:11.940
that you can use inside of Copilot chat,

02:11.940 --> 02:13.920
simply type slash help.

02:13.920 --> 02:15.450
You'll then be presented with all

02:15.450 --> 02:18.000
of these different types of slash commands, et cetera,

02:18.000 --> 02:20.550
that you can see, that can help with explaining code,

02:20.550 --> 02:21.720
finding problems.

02:21.720 --> 02:25.230
If we look specifically at the slash commands,

02:25.230 --> 02:27.660
we have slash help, we've got slash workspace,

02:27.660 --> 02:30.780
which allows us to generate, ask a question about the files

02:30.780 --> 02:32.310
in your current workspace.

02:32.310 --> 02:35.910
We also have slash tests, which generates unit tests.

02:35.910 --> 02:39.330
Slash simplify for simplifying the selected code.

02:39.330 --> 02:41.730
Slash fix for proposing a fix for the problems

02:41.730 --> 02:43.050
in the selected code.

02:43.050 --> 02:46.230
Slash explain, to explain how the selected code works.

02:46.230 --> 02:47.880
We've also got some other ones.

02:47.880 --> 02:50.970
So any slash VS code questions about VS code.

02:50.970 --> 02:54.030
Slash extensions APIs is specifically for VS code

02:54.030 --> 02:55.320
plugin developers.

02:55.320 --> 02:58.140
And you've also got other ones such as the create workspace,

02:58.140 --> 03:00.420
which is great for if you're building a new visual studio

03:00.420 --> 03:01.710
code workspace.

03:01.710 --> 03:03.480
Or you've got other ones that are specific

03:03.480 --> 03:05.190
to the different types of files you're working in.

03:05.190 --> 03:07.380
So because we're working in a Jupyter Notebook,

03:07.380 --> 03:09.390
we also get a slash create notebook.

03:09.390 --> 03:11.970
That will create a new Jupyter Notebook file.

03:11.970 --> 03:15.210
Also, there's slash search, which generate query parameters

03:15.210 --> 03:16.620
for the workspace search.

03:16.620 --> 03:18.780
Hopefully this video gives you a good overview

03:18.780 --> 03:20.610
of all the different types of slash commands

03:20.610 --> 03:23.190
that you can use inside of GitHub Copilot chat.

03:23.190 --> 03:24.570
In the next video, we're gonna look at

03:24.570 --> 03:28.260
how we can use custom prompts to even further enhance

03:28.260 --> 03:30.873
how we use GitHub Copilot while selecting code.
