WEBVTT

1
00:00:01.499 --> 00:00:08.320
So, we got GitHub Copilot the extension installed, we got a paid subscription and we did log

2
00:00:08.320 --> 00:00:16.100
into the GitHub account here through our IDE just as instructed in the previous video or

3
00:00:16.100 --> 00:00:21.600
in the official documentation which tells you how to use GitHub Copilot the extension

4
00:00:21.600 --> 00:00:23.720
in those different IDEs.

5
00:00:25.120 --> 00:00:31.700
So you did all that and therefore GitHub Copilot is ready to be used in your IDE, in my case

6
00:00:31.700 --> 00:00:32.720
Visual Studio Code.

7
00:00:34.080 --> 00:00:42.280
And now I want to start with a very simple example, with a Python example where I want

8
00:00:42.280 --> 00:00:52.720
to create a utility Python script, a utility Python function where I can convert Fahrenheit

9
00:00:53.240 --> 00:00:57.320
to Celsius, let's say, a very simple example to get started.

10
00:00:59.020 --> 00:01:07.380
Now as I open this Python file here, I already get a message here where GitHub Copilot in

11
00:01:07.380 --> 00:01:09.560
the end tells me how I could use it.

12
00:01:10.000 --> 00:01:15.360
For example here on Mac I could press this combination, on Windows a different combination

13
00:01:15.360 --> 00:01:19.700
will be shown of course, to open the inline chat to ask a question.

14
00:01:21.420 --> 00:01:25.440
Now I'll get back to chat a little bit later because here I already know what I want.

15
00:01:25.780 --> 00:01:34.440
I want to create a function which I'll name convertF2 and you see as I type I'm getting

16
00:01:34.440 --> 00:01:35.340
suggestions here.

17
00:01:38.160 --> 00:01:43.600
Now what's really important to keep in mind regarding suggestions like the one you see

18
00:01:43.600 --> 00:01:50.680
here is that you'll not always get exactly the same suggestions as I do here.

19
00:01:50.920 --> 00:01:55.340
You might see different suggestions because that's just how AI works.

20
00:01:56.620 --> 00:02:02.460
And also because behind the scenes of course the AI models used by GitHub Copilot will

21
00:02:02.460 --> 00:02:07.020
change so things will not always be as you see them here in the video.

22
00:02:07.960 --> 00:02:10.080
So of course that may differ.

23
00:02:10.340 --> 00:02:16.620
You can always just add a couple of extra characters to give the AI more hints to be

24
00:02:16.580 --> 00:02:24.020
a bit more specific and eventually you might then see the same suggestion as I do here.

25
00:02:25.000 --> 00:02:28.420
Or a different one which you prefer, that's also fine.

26
00:02:28.840 --> 00:02:34.820
But that's just important to understand and keep in mind regarding how these AI systems

27
00:02:34.820 --> 00:02:35.380
work.

28
00:02:35.880 --> 00:02:39.540
It's not deterministic so things can differ.

29
00:02:40.780 --> 00:02:45.060
Again this is probably something you already saw before.

30
00:02:45.580 --> 00:02:51.440
Now what you maybe did not know is that you can get multiple suggestions.

31
00:02:51.760 --> 00:02:57.500
Here it's just one but if you start typing and you get a suggestion and you don't continue

32
00:02:57.500 --> 00:03:04.840
for a short period of time, this menu here should pop up, this little box here and there

33
00:03:04.840 --> 00:03:08.140
if you had multiple suggestions you could cycle through them.

34
00:03:09.900 --> 00:03:15.420
So let's see, now for example if I remove the F, if I just have convert underscore,

35
00:03:15.840 --> 00:03:21.020
you see now I have two suggestions here and I can cycle through them and as you see in

36
00:03:21.020 --> 00:03:24.140
this case it's the parameter name that changes.

37
00:03:25.220 --> 00:03:27.880
So here if you take a closer look that's what's changing here.

38
00:03:29.640 --> 00:03:34.280
And that is already something which can be useful if you're writing more complex code

39
00:03:34.280 --> 00:03:39.200
because it is of course nice that you get different suggestions at least for some code

40
00:03:39.380 --> 00:03:42.320
between which you can cycle before you accept it.

41
00:03:44.120 --> 00:03:51.840
You can also open the completions panel here which opens a little extra box here which

42
00:03:51.840 --> 00:03:55.080
gives you more details about the two suggestions.

43
00:03:56.760 --> 00:04:01.880
And here you can see I'm getting even more suggestions now, not just two but here instead

44
00:04:01.900 --> 00:04:09.400
I have eight and you can scroll through them here conveniently and then just accept any

45
00:04:09.400 --> 00:04:10.840
suggestion you want.

46
00:04:10.980 --> 00:04:16.779
For example accept suggestion one and it will then paste it in here and that might already

47
00:04:16.779 --> 00:04:18.880
be something you haven't seen before.

48
00:04:20.760 --> 00:04:25.100
Now in my case here I of course don't want to create a function that converts a value

49
00:04:25.100 --> 00:04:32.560
to int so I'll get rid of that and instead re-add my f and then here get this two celsius

50
00:04:32.560 --> 00:04:33.280
suggestion.

51
00:04:35.100 --> 00:04:40.940
Now I can accept it by clicking accept or by hitting the tab key, alternatively you

52
00:04:40.940 --> 00:04:46.900
can also just accept a word and if I do that you see it just adds the next part here, it

53
00:04:46.900 --> 00:04:51.280
just completes that function name but it does not complete the entire code block.

54
00:04:53.060 --> 00:04:55.300
And I could also use this shortcut here instead.

55
00:04:55.860 --> 00:05:02.720
That of course can be a very useful feature if some parts of the suggested code are what

56
00:05:02.720 --> 00:05:05.860
you want but the rest is not what you want.

57
00:05:05.900 --> 00:05:10.140
So you don't want to accept the entire suggestion then you can use this feature.

58
00:05:11.740 --> 00:05:18.140
Now here in my case I'm happy with the entire suggested code so I'll just hit tab and it

59
00:05:18.100 --> 00:05:18.820
completes this.

60
00:05:19.020 --> 00:05:23.720
And this is the main way of using GitHub Copilot.

61
00:05:23.820 --> 00:05:29.580
Of course that is probably how you used it before but maybe you already saw some things

62
00:05:29.580 --> 00:05:33.340
here with those different suggestions which you didn't know before.

