Instructor: Now this auto completion feature
also got smarter over time
and it can do even more than just complete the line
or the code block you are currently working on.
And I want to show you what I mean.
And for that, I want to go to my settings here,
my user settings, in Visual Studio Code,
and I'll search for GitHub Copilot here
to view the GitHub Copilot specific settings.
And those settings will change over time.
I'll say that right away.
The settings you are seeing here
will likely differ from the settings you are seeing
because new features are added all the time.
Not all of them matter of course,
but some are quite interesting.
For example, one feature that is quite interesting
is the next edit completion setting.
Now in general, when you search for GitHub Copilot,
you can configure all kinds of things.
You can in general turn it on or off,
or control for which code files it should become active.
You can add an instruction file,
which is something I'll get back to later.
And if you scroll down further,
at some point you might find
this Next Edit Suggestions setting.
You also might not find it,
because right now when I'm recording this,
this is a preview setting.
It might already be stabled and turned on by default
and deeply integrated into GitHub Copilot
by the point of time you're watching this, of course.
Now I have already enabled it.
You might still need to do that.
And what's that setting all about?
Well, with it enabled, if I go back to my code,
let's say I'm changing this variable,
this name here from F, to Fahrenheit.
Now I'm getting a completion here,
I can accept it, but this was only this one line,
but that's what happens thereafter,
of course not guaranteed, but quite likely.
I am getting a suggestion not for the line
my cursor is currently in,
but for the next edit I likely want to make.
So GitHub Copilot understands my code base,
which arguably isn't too complex here,
but it will also work in more complex code bases of course,
and it suggests the next edit I likely want to make,
in this case, I likely also wanna rename it down here.
Now I can hover over this icon which popped up here
on the left end, then accept this.
Alternatively, I can hit Tab,
I can reject it, or click Escape,
or configure that in greater detail.
So for example, whether it should also
shift existing code to make room for the suggestions
so that I can see both the suggestion
as well as my existing code, and so on.
So, if I again, try to trigger that,
now I can hit Tab, and it will make that edit,
so it predicted my next edit.
And that is a feature that can, again,
tremendously boost your productivity
because you can move through a bigger code file
quite efficiently and make edits quickly
by taking advantage of this feature,
because you don't have to manually navigate around
and wait for GitHub Copilot to suggest changes
in the line you're currently working in.
Instead, it can already predict
and suggest the next change you likely want to make.
So of course, I can now also go back
to F instead of Fahrenheit.
Here it did not pick it up,
but it also might have picked it up for you.
So that's another nice feature worth knowing about.
It's also a feature we'll see again later,
when we dive into cursor,
because cursor kind of invented that feature
and it is pretty neat indeed.