-: In this video, we're gonna have a look at
some of Copilot's features.
We're gonna explore this by using and altering
some Python code inside of a Jupyter Notebook.
Let's get started.
To start with, we have a complicated bubble sort function.
Maybe you don't know what this means,
or you need some sort of explanation
for some complicated code with inside any of your projects.
We can do this by simply hovering over the code,
right clicking on it, going to Copilot,
and saying, "explain this".
You'll see on the left hand side of the screen
that Copilot chat automatically opens
with the slash explain.
Copilot chat then provides us
with a detailed explanation of that specific code snippet.
This is a really great way for understanding
very complicated code in a short span of time.
Let's move on.
Maybe sometimes you've got some broken code
or you're looking specifically for a bug
inside of your code.
We have this example of a find maximum function.
If I highlight this,
there's actually currently an error in here.
What I can do is I can right click, go fix this.
Then what happens is you'll see Copilot has been presented
with this flash fix preset.
Copilot will then try and fix the code,
and then on the right hand side
you can see it's given us a proposed edit to change.
What we can then do is we can either accept this,
regenerate, or discard.
I'm gonna accept this change
because I believe that Copilot has generated the right code.
Another couple of interesting use cases are
if you go into the bottom left into the Copilot chat window,
if we click on a specific Jupyter Notebook cell,
we can type then for example, tests.
So it'll be slash tests
and it will generate all of the unit tests
for whatever Jupyter Notebook cell we've clicked on.
So in this case, it's doing it for a calculator.
However, if I scroll up to bubble sort
and then I then just wait for this generation,
we'll see what it would do is it would generate tests
specifically for the bubble sort function.
So this is a great way for you to easily, you know,
look at specific bits of code inside of your Python files
or your Jupyter Notebook files and generate effective tests.
If you want to see all the different types of commands
that you can use inside of Copilot chat,
simply type slash help.
You'll then be presented with all
of these different types of slash commands, et cetera,
that you can see, that can help with explaining code,
finding problems.
If we look specifically at the slash commands,
we have slash help, we've got slash workspace,
which allows us to generate, ask a question about the files
in your current workspace.
We also have slash tests, which generates unit tests.
Slash simplify for simplifying the selected code.
Slash fix for proposing a fix for the problems
in the selected code.
Slash explain, to explain how the selected code works.
We've also got some other ones.
So any slash VS code questions about VS code.
Slash extensions APIs is specifically for VS code
plugin developers.
And you've also got other ones such as the create workspace,
which is great for if you're building a new visual studio
code workspace.
Or you've got other ones that are specific
to the different types of files you're working in.
So because we're working in a Jupyter Notebook,
we also get a slash create notebook.
That will create a new Jupyter Notebook file.
Also, there's slash search, which generate query parameters
for the workspace search.
Hopefully this video gives you a good overview
of all the different types of slash commands
that you can use inside of GitHub Copilot chat.
In the next video, we're gonna look at
how we can use custom prompts to even further enhance
how we use GitHub Copilot while selecting code.