Last reviewed
Correct answer: B. Your recent edits, the surrounding code and the live linter error all feed the suggestion, and a bare scratch file supplies none of the three.
Explanation
The principle — Tab is not a prefix matcher. Cursor documents it as suggesting code as you type, based on your recent edits, surrounding code, and linter errors. Two of those three inputs are things you control directly, which is what makes Tab steerable rather than merely lucky.
Why the key is correct — In this situation all three inputs are unusually strong. The two call sites you fixed by hand are recent edits with an obvious shape to generalise. The surrounding code contains the helper's new signature, so the argument list is right there. The linter error names the exact defect at the cursor: too few arguments. The scratch file supplied none of that, which is why Tab is at its weakest in an empty buffer and at its strongest in the middle of a change you have already begun. The practical move follows directly: when a suggestion is poor, make one correct edit by hand and let Tab generalise from it, rather than rejecting completion after completion and hoping for a better one.
Why the others are wrong — Reading only the characters before the cursor would make the two earlier hand edits irrelevant, yet those edits are precisely what gave the suggestion its shape. Project indexing is a real feature, but it is what powers search over the codebase, not what a Tab suggestion is built from, and an unindexed file would not explain a good suggestion appearing instantly in a file you just opened. Time spent with a file open changes nothing on its own; what changes during a long session is the edit history and the code you have written, which is the same explanation as the key by another name.
Remember this — If Tab is guessing badly, give it something to read: make the first edit yourself, or fix the linter error, then press Tab.
Sources — Cursor's Tab completion documentation.
Sources
“It suggests code as you type, based on your recent edits, surrounding code, and linter errors.”
Practise 10 questions on this topic
Take Cursor AI Features — Timed Test 1 (10 questions) — scored instantly, explanation for every question, no login.