Write Good Comments First
A comment like // Sort users by last login, most recent first before an empty function body gives the model a strong intent signal. The FIM mechanism sees your comment as prefix context, dramatically improving the quality of the generated function body. Comments are prompts.
Keep Related Files Open
Open tabs are a primary context source. If you’re implementing a function that uses types from types.ts, open that file in a tab. The completion tool will include those type definitions in the prompt, producing suggestions that use the correct property names and types.
Write the Signature, Let AI Fill the Body
Type the function signature with parameter names and return type, then let the cursor sit inside the empty body. The model now has both prefix (signature) and suffix (closing brace) — the ideal FIM scenario. This consistently produces better completions than typing the first line and hoping.
Reject Deliberately
Don’t accept suggestions you don’t understand. Every acceptance is a training signal. If you accept buggy code, the model learns that pattern is desirable. Rejecting bad suggestions (by continuing to type) teaches the model what you actually want.
Key insight: Understanding the completion pipeline turns you from a passive recipient into an active collaborator. You’re not waiting for magic — you’re shaping the context, timing, and feedback that determine suggestion quality. The tool works with you, not for you.