Now, I showed you before that you can
also configure this inline chat.
And for that, of course, you can go to
your settings, your workspace or user
settings, depending on whether you
want to tweak the settings for this
specific workspace or for all your
projects for this VS Code user.
And then in there, you can also search
for a copilot chat.
You can also simply search for just
copilot without chat to find all the
options you have in general for
configuring copilot, both its chat
functionality and its auto-completion
functionality.
You can, for example, control for which
specific languages you want to enable
GitHub Copilot.
By default here for me, it is enabled for
all languages except for the ones which
are explicitly disabled here.
So that for example, in Markdown files, I
don't get GitHub Copilot suggestions.
But if I wanted them there, I could set
this to true or simply remove this entry.
And on the other hand, if you have
certain languages where you don't want
GitHub Copilot to become active, you
can add them here and set them to
false.
So that's one thing that could be
interesting.
Now, you'll also find more GitHub Copilot
and GitHub Copilot chat related settings
here.
And I will also say that they will change
over time.
New settings will be added, other
settings might be removed.
So it's best to simply have a look at these
settings from time to time to see how
you might want to tweak GitHub Copilot
to make sure that it really works the way
you want it to work.
Now two settings I find particularly
noteworthy are this setting here to
support instruction files, which allows
you to add a copilot-instructions.md file,
so a Markdown file with that specific
name in a .github folder in your project.
And you could put your own
instructions, which should be short and
precise into that file.
And if you then enable this setting,
GitHub Copilot would take these
instructions into account whenever it
generates code through its chat
functionality.
So you could, for example, describe a
certain code style you want to enforce in
such a instructions file.
That is not something I'm using in all my
projects, but it is something that can
definitely be helpful in some projects, as
it can help ensure that the code
suggestions and the code snippets
generated by Copilot are correct
immediately or at least a bit sooner than
they otherwise might be.
So putting those instructions into this
file might save you some extra iteration
cycles where you tell Copilot to change
the code.
That's the idea here.
By putting these instructions into this
file, you have a higher chance of getting
suggestions that are the way you want
them right from the start.
So that is one setting you should
consider enabling.
Then you have to add this file in this
specific .github folder, put your
instructions into that file, keep them
short and precise, and see how that
affects the code generations created by
GitHub Copilot.
It is worth noting, as mentioned here,
that poor instructions can actually lead
to worse results than having no
instructions at all, which is why, again,
I'm not using this feature all the time,
but it is worth a closer look.
Now another very useful or very
interesting feature, in my opinion, is this
temporal context feature here.
This feature, when enabled, ensures that
GitHub Copilot automatically takes the
last edited files and the code it saw right
before you start asking a question into
account.
So if you just worked in file A and you
then try to use GitHub Copilot chat in file
B, any code you might have in file A
should hopefully be taken into account
for generating the answer for your
question you might have asked in file B,
so in another file.
So for example, if file A exports a certain
function and a good answer for your
question in file B uses this function, if
that's the case, GitHub Copilot hopefully
takes its knowledge of what it saw in file
A and suggests importing that function
and using that function.
So it simply helps with working with
code that's split across multiple files, for
example.
This temporal context feature can be
very useful for that.
Well, and then as mentioned, there are
more settings and as also mentioned,
settings that are likely to change and
evolve over time.
Simply scroll through them.
Be aware of the fact that there are
things you can configure and play
around with them.
Find the settings that provide the best
results to you because of course the
experience will also change over time
because AI models change and so on.
That's why you should definitely take a
look at these settings and find the
settings that best work for you.
The specific hints I gave you here
hopefully are a good starting point.