Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 35 additions & 13 deletions source/ch-copilot.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<p>
Note that almost everything in this chapter will likely be out of date almost immediately.
The current suggestions here are up to date as of <strong>2025-01-08</strong>.
The current suggestions here are up to date as of <alert>2025-01-08</alert>.
</p>
</introduction>

Expand Down Expand Up @@ -116,36 +116,58 @@
<ul>
<li>
<p>
Suppose you are trying to write some code in a language you are not that familiar with. Copilot will suggest the next bit of code for you as you type. To get better suggestions, put in a comment describing what you want to do. (Hint: if you don't know the syntax for comments, hit <c>CTRL+/</c> to start a comment in most languages.)
Suppose you are trying to write some code in a language you are not that familiar with.
Copilot will suggest the next bit of code for you as you type.
To get better suggestions, put in a comment describing what you want to do.
(Hint: if you don't know the syntax for comments, hit <c>CTRL+/</c> to start a comment in most languages.)
</p>
</li>

<li>
<p>
Does the code do what you want it to? Is it confusing? Ask Copilot to <em>explain</em> the code to you. You can select the code, hit <c>CTRL+I</c>, and then type <c>/explain</c> (note the forward slash).
Does the code do what you want it to? Is it confusing? Ask Copilot to <em>explain</em> the code to you.
You can select the code, hit <c>CTRL+I</c>, and then type <c>/explain</c> (note the forward slash).
</p>
</li>

<li>
<p>
Along these lines, try asking Copilot to document your code for you. Select the code, hit <c>CTRL+I</c>, and then type <c>/doc</c>.
Along these lines, try asking Copilot to document your code for you.
Select the code, hit <c>CTRL+I</c>, and then type <c>/doc</c>.
</p>
</li>

<li>
<p>
Here is something I just did while writing this. I realized that I wanted all the keyboard shortcuts to be displayed as code, which in <pretext /> is done by enclosing them in <tag>c</tag> tags. So I selected the entire document, hit <c>CTRL+I</c> and typed <q>wrap all keyboard shortcuts here with <tag>c</tag> tags.</q> Copilot then let me see where it made changes (line by line) and let me accept them or not.
Here is something I just did while writing this.
I realized that I wanted all the keyboard shortcuts to be displayed as code, which in <pretext /> is done by enclosing them in <tag>c</tag> tags.
So I selected the entire document, hit <c>CTRL+I</c> and typed <q>wrap all keyboard shortcuts here with <tag>c</tag> tags.</q> Copilot then let me see where it made changes (line by line) and let me accept them or not.
</p>

<p>
A very new Copilot feature is <term>Copilot Edits</term>, which allow you to do such things for multiple files at the same time. I suspect this could also be useful for finding typos.
A very new Copilot feature is <term>Copilot Edits</term>, which allow you to do such things for multiple files at the same time.
I suspect this could also be useful for finding typos.
</p>
</li>

<li>
<p>
If you are working on a mathematical proof or a complex equation, you can ask Copilot to help you format it correctly in LaTeX. Simply type your equation or proof in plain text, select it, hit <c>CTRL+I</c>, and ask Copilot to convert it to LaTeX. This can save you a lot of time and ensure that your mathematical notation is accurate.
</p>
<p>
NOTE: I don't know if that's true, the above paragraph was generated by Copilot from the prompt <q>Write a suggestion of something Copilot can do for a mathematician.</q>
</p>
<p>
If you are working on a mathematical proof or a complex equation, you can ask Copilot to help you format it correctly in LaTeX.
Simply type your equation or proof in plain text, select it, hit <c>CTRL+I</c>, and ask Copilot to convert it to LaTeX.
This can save you a lot of time and ensure that your mathematical notation is accurate.
</p>

<p>
NOTE: I don't know if that's true, the above paragraph was generated by Copilot from the prompt <q>Write a suggestion of something Copilot can do for a mathematician.</q>
</p>
</li>
</ul>
</p>
</section>

<p>
One final thing you might want to try: <alert>Turn off completions</alert>.
It can be distracting to see what Copilot thinks you should type next; I have found that it often interrupts the idea I have in my head.
You can turn off completions by clicking the Copilot icon at the bottom of the VS Code window and selecting <q>Disable completions.</q> You can also disable completions for particular types of files.
</p>
</section>
</chapter>
Loading