So let's take a look at this inline chat.
You can also bring it up with this button up here or by using the shortcut
that's shown here. And the idea behind the inline chat
that you can highlight a piece of code and then open that inline chat, for
example, with the shortcut, and then you can request code changes
Like, for example, remove unused variable, which I obviously could do
myself, but this is an example. Now, before we send this by hitting enter
or using this button, it's worth noting that here,
different models, this time for real.
So you can choose which AI model will be used for fulfilling
request, and you can also provide some context here
clicking this button. You can, for example, point at some other
window or at some files that should be made aware to
the AI for this chat, and a bunch of other things as well.
But I'll get back to context management later.
For this simple change, we obviously need none of that,
enter and it does its thing and removes this variable.
Or, to be precise, it doesn't instantly remove it.
Instead, with all these AI agents and chats, you get a preview
of what it wants to do. So here, this is highlighted in red because it
wants to delete that. But you then decide if you wanna keep
change, or if you wanna open it in a diff editor
complex changes. You can also accept or deny with these buttons
here. So this inline chat can be great for
targeted edits where you know exactly on which code you wanna work.
The other kind of chat besides the sidebar chat that is worth taking
a look at is this quick chat, which you can open through that menu
that shortcut. That quick chat is really just what it sounds like.
It's a quick way for you to bring up a chat bar to, for example, ask
questions about your code or request changes.
So here, I could request to remove the combined
function, and again, choose a model that should do
that, add context, and then potentially open that in the
chat view, so in that sidebar if I wanted to.
But I can also just send it here, and this will now work on
that file in this case, since the file was open when I requested this,
and it will tell me how to make this change.
I can then apply this change by hovering over this code snippet
and by then clicking this apply to main button.
I could also insert this change at my cursor position,
which for deleting a function doesn't make too much sense, but which can be useful
if you want the DAI to generate additional code that should be
inserted. Or you can just copy that to manually paste it
in. You can also insert it into a terminal
It simply depends on what you ask the AI to do.
So here, I can apply it, and then again, I get this preview here
and I can decide whether I want to keep that or undo.
Now as you saw, it didn't change the code automatically,
time where I'm recording this, and therefore, this quick chat,
is best if you want to ask a quick question about your code or how
to do something. For example, here I could ask, "What
does this program
do?" And obviously that's a super simple program, so it's not too complex
to analyze, and I had to enable this
specific AI model to be available for me here.
But then it does explain what this program does.
In this case, it thinks first because I selected a
model, but then in the end, it spits out the final response.
And depending on which model you selected, you might have gotten the response
quicker. So it can be a great tool for explaining
parts of programs, or asking any other kind of question for
just don't wanna leave this editor.