Last reviewed
Correct answer: D. The surrounding code in the current file and, depending on configuration, other project files
Explanation
Copilot is not working from your last keystroke alone. GitHub's guidance states that "in addition to your prompt, Copilot uses additional context, like the code in your current file and the chat history, to generate a response". The file you are sitting in is the main signal, and the code around your cursor counts as part of the prompt whether you meant it to or not.
It reaches past one file, and you control how far. The advice for inline suggestions is unusually concrete: open any relevant files and close irrelevant ones, because "Copilot will use the open files to understand your request". That is a lever you can pull today — a stale tab you forgot about is still feeding the model.
Configuration can narrow it as well. Content exclusion lets an administrator put files out of reach, and the documentation is explicit that "the content in affected files will not inform inline suggestions in other files".
So when the suggestions are poor, look at what you have open before blaming the model.
Sources
“In addition to your prompt, Copilot uses additional context, like the code in your current file and the chat history, to generate a response.”
“Copilot will use the open files to understand your request.”
“The content in affected files will not inform inline suggestions in other files.”
Practise 3 questions on this topic
Take Copilot Basics — Timed Test (3 questions) — scored instantly, explanation for every question, no login.