So, we got GitHub Copilot the extension installed, we got a paid subscription and we did log
into the GitHub account here through our IDE just as instructed in the previous video or
in the official documentation which tells you how to use GitHub Copilot the extension
in those different IDEs.
So you did all that and therefore GitHub Copilot is ready to be used in your IDE, in my case
Visual Studio Code.
And now I want to start with a very simple example, with a Python example where I want
to create a utility Python script, a utility Python function where I can convert Fahrenheit
to Celsius, let's say, a very simple example to get started.
Now as I open this Python file here, I already get a message here where GitHub Copilot in
the end tells me how I could use it.
For example here on Mac I could press this combination, on Windows a different combination
will be shown of course, to open the inline chat to ask a question.
Now I'll get back to chat a little bit later because here I already know what I want.
I want to create a function which I'll name convertF2 and you see as I type I'm getting
suggestions here.
Now what's really important to keep in mind regarding suggestions like the one you see
here is that you'll not always get exactly the same suggestions as I do here.
You might see different suggestions because that's just how AI works.
And also because behind the scenes of course the AI models used by GitHub Copilot will
change so things will not always be as you see them here in the video.
So of course that may differ.
You can always just add a couple of extra characters to give the AI more hints to be
a bit more specific and eventually you might then see the same suggestion as I do here.
Or a different one which you prefer, that's also fine.
But that's just important to understand and keep in mind regarding how these AI systems
work.
It's not deterministic so things can differ.
Again this is probably something you already saw before.
Now what you maybe did not know is that you can get multiple suggestions.
Here it's just one but if you start typing and you get a suggestion and you don't continue
for a short period of time, this menu here should pop up, this little box here and there
if you had multiple suggestions you could cycle through them.
So let's see, now for example if I remove the F, if I just have convert underscore,
you see now I have two suggestions here and I can cycle through them and as you see in
this case it's the parameter name that changes.
So here if you take a closer look that's what's changing here.
And that is already something which can be useful if you're writing more complex code
because it is of course nice that you get different suggestions at least for some code
between which you can cycle before you accept it.
You can also open the completions panel here which opens a little extra box here which
gives you more details about the two suggestions.
And here you can see I'm getting even more suggestions now, not just two but here instead
I have eight and you can scroll through them here conveniently and then just accept any
suggestion you want.
For example accept suggestion one and it will then paste it in here and that might already
be something you haven't seen before.
Now in my case here I of course don't want to create a function that converts a value
to int so I'll get rid of that and instead re-add my f and then here get this two celsius
suggestion.
Now I can accept it by clicking accept or by hitting the tab key, alternatively you
can also just accept a word and if I do that you see it just adds the next part here, it
just completes that function name but it does not complete the entire code block.
And I could also use this shortcut here instead.
That of course can be a very useful feature if some parts of the suggested code are what
you want but the rest is not what you want.
So you don't want to accept the entire suggestion then you can use this feature.
Now here in my case I'm happy with the entire suggested code so I'll just hit tab and it
completes this.
And this is the main way of using GitHub Copilot.
Of course that is probably how you used it before but maybe you already saw some things
here with those different suggestions which you didn't know before.