WEBVTT

00:00:00.180 --> 00:00:03.040
So what exactly does GitHub Copilot give
us?

00:00:03.100 --> 00:00:07.030
Chances are high
that you already know some

00:00:07.060 --> 00:00:10.840
the little tips and tricks
that might be helpful to know

00:00:10.900 --> 00:00:13.340
features you might have not heard about
yet.

00:00:13.360 --> 00:00:16.970
So here,
I'm in a very basic Python project,

00:00:17.240 --> 00:00:21.190
UV,
which is simply a tool for creating

00:00:21.200 --> 00:00:23.180
and you absolutely don't have to install
it.

00:00:23.220 --> 00:00:26.710
You don't have to follow along because
we'll not build a complex project here.

00:00:26.740 --> 00:00:30.410
Instead, we'll write some code so
that I can walk you through the various

00:00:30.440 --> 00:00:32.860
features offered by GitHub Copilot.

00:00:32.900 --> 00:00:36.850
So a Python project it is. Now,
the first thing GitHub

00:00:36.880 --> 00:00:40.380
Copilot offers you is smart, AI-powered

00:00:40.390 --> 00:00:43.860
autocompletion. If I, for example,
introduce a variable named

00:00:44.080 --> 00:00:46.540
Name, I'll get this suggestion here.

00:00:46.580 --> 00:00:49.930
I have not accepted it yet,
but I can hit Tab to accept it.

00:00:49.940 --> 00:00:53.500
I can, of course, also change it. That
was the AI code completion by GitHub

00:00:53.560 --> 00:00:57.220
Copilot in action. That
is actually the first feature with

00:00:57.300 --> 00:01:00.940
started many years ago,
but now it's just one of the features and

00:01:01.080 --> 00:01:03.320
arguably not the most important ones.

00:01:03.420 --> 00:01:06.980
Still, of course, a useful feature,
which can significantly speed up

00:01:07.100 --> 00:01:11.080
typing and writing code.
What's also nice is that you don't just

00:01:11.180 --> 00:01:14.440
get this inline smart completion, but, for

00:01:14.500 --> 00:01:18.180
example, if I rename this function here,
I'll

00:01:18.240 --> 00:01:22.080
typically get suggestions like this one,
which are so-called next

00:01:22.160 --> 00:01:26.000
edit suggestions,
where it suggests a change in a

00:01:26.040 --> 00:01:29.450
different line of code than I was,
which I can also accept with

00:01:29.480 --> 00:01:33.210
Tab,
based on the edits I made in other parts

00:01:33.240 --> 00:01:36.490
So it tries to anticipate what I'll likely
do next.

00:01:36.500 --> 00:01:39.720
By the way, that's a feature
which you can enable

00:01:39.740 --> 00:01:43.690
GitHub Copilot thing here in the toolbar,
in the status bar, and

00:01:43.720 --> 00:01:47.260
then here,
you can turn off next edit suggestions or

00:01:47.480 --> 00:01:50.160
all AI suggestions if you don't want them.

00:01:50.180 --> 00:01:53.580
You can also decide that on a per file
or a file type basis.

00:01:53.620 --> 00:01:57.500
Now,
when Copilot gives you these suggestions,

00:01:57.560 --> 00:02:01.240
you can of course accept them by hitting
Tab, but one thing many people

00:02:01.380 --> 00:02:05.220
don't know is you can also hover over
that suggestion, and in

00:02:05.280 --> 00:02:07.660
some cases,
you'll then see different variants.

00:02:07.800 --> 00:02:11.680
For example here,
if I add a variable called Person,

00:02:11.700 --> 00:02:15.260
I can hover over the suggestion instead of
just blindly

00:02:15.320 --> 00:02:19.140
accepting it,
and it actually shows me three different

00:02:19.220 --> 00:02:22.170
in this situation. When you're trying it,
it might be different.

00:02:22.180 --> 00:02:25.070
But here, I get three options, which
are quite different.

00:02:25.080 --> 00:02:28.360
The first one is just a different name,
but then it actually wants to create a

00:02:28.380 --> 00:02:32.120
dictionary,
which stores information about a person,

00:02:32.140 --> 00:02:35.960
And you can cycle through these options
and then accept the option you want by

00:02:35.980 --> 00:02:37.940
hitting Tab or by clicking Accept.

00:02:37.960 --> 00:02:41.560
And you can also just accept words by
clicking this button or

00:02:41.680 --> 00:02:45.520
using this shortcut so
that you can accept it step by step

00:02:45.560 --> 00:02:49.360
that. And that, of course,
can come in handy in situations where you

00:02:49.440 --> 00:02:53.100
some AI assistance with the
autocompletions, but don't want the

00:02:53.140 --> 00:02:56.980
exact completion it's suggesting in this
very moment.

00:02:57.000 --> 00:03:00.829
What's also useful about these AI
suggestions is that you can use them in

00:03:00.880 --> 00:03:04.820
conjunction with comments. For example,
if I add a comment,

00:03:04.829 --> 00:03:08.630
"Function that combines two strings," it
starts suggesting

00:03:08.800 --> 00:03:12.460
this function for me.
So you can use comments to essentially

00:03:12.470 --> 00:03:15.910
write prompts, and that, of course,
can also save you some time.

00:03:15.940 --> 00:03:18.930
And obviously,
you can then also delete the comments

00:03:18.940 --> 00:03:20.220
function.
