Session 1
Prompt-craft: comment-driven code & Tab
Goal. Learn how to steer inline autocomplete so it writes the code you actually want.
▶ Try this prompt
# Read a FASTA file of protein sequences, count amino-acid frequencies, and return a pandas DataFrame sorted by frequency
Type the comment, then start a def line below it — Copilot fills in the whole function body as ghost text.
- 1Write a specific comment first: name the input, the operation, and the output shape. The more concrete the comment, the closer the suggestion lands.
- 2Begin the function signature (e.g.
def count_amino_acids(path):) and let Copilot complete the body — it suggests the next line, the next function, or a whole block. - 3Accept good lines with Tab, reject the rest by typing over them, and refine your comment if the suggestion drifts. Copilot works the same way in JetBrains, Visual Studio, and Xcode.
You'll see. A complete function written from your comment and signature, which you accept piece by piece and adjust as needed.
Cost. Inline completions are unlimited on Pro and capped at 2,000/month on Free — and completions never spend AI Credits, so iterating costs nothing on the credit meter.
Takeaway. You drive inline autocomplete with precise comments and function signatures — describe the what, and Tab through the how.