So, the suggestions feature built into Cursor, where it tries to predict where to make code
edits next, can be really powerful.
But it's not all Cursor has to offer.
Like GitHub Copilot, it also offers a chat.
And like GitHub Copilot, you get two kinds of chat.
You get an inline chat in the end, which you can open by pressing Command or Control K
or whichever shortcuts are shown to you here.
If you highlight some code, it opens this pop-up.
This is the inline chat for editing instructions right in the editor.
You can actually choose an AI model here, at least at the point of time where I'm recording
this, but I'll go with the default one.
And you can write your instructions here and then also add some extra context.
You can hit the add symbol to, for example, reference a file, some other code, some documentation.
Cursor has built-in documentation and you can also add more.
I'll get back to that.
You can add web search here really easy by bringing in the web as a resource and so on.
Here, however, I don't need any of that.
I'll just say add error handling and hit enter.
And now it does just that.
It updates the code, removes some code, adds some new code to handle errors.
And just as with GitHub Copilot, we can accept these changes by pressing the button or using
the shortcut or we can, of course, also reject them.
Here I'll accept them.
We could do this for other parts of the code as well.
You can, of course, also highlight multiple functions in one go, for example.
All that is possible and therefore this is kind of similar to what you had with GitHub
Copilot, but nonetheless, it's a very powerful feature, especially since you have lots of
extra resources.
You can bring in extra files, specific parts of your code, specific function, for example,
that it should take into account, which can be helpful if it's a bigger code file with
lots of code in there and especially also the web and docs.
And it's the docs part we'll explore next.