GH-300 · Question #47
How can you improve the context used by GitHub Copilot? (Each correct answer presents part of the solution. Choose two.)
The correct answer is A. By opening the relevant tabs in your IDE B. By adding relevant code snippets to your prompt. GitHub Copilot builds context from what is currently visible and open in the IDE. (A) Opening relevant tabs/files in your IDE makes those files part of Copilot's active context window, allowing it to generate more accurate, project-aware suggestions. (B) Adding relevant code…
Question
How can you improve the context used by GitHub Copilot? (Each correct answer presents part of the solution. Choose two.)
Options
- ABy opening the relevant tabs in your IDE
- BBy adding relevant code snippets to your prompt
- CBy adding the important files to your .gitconfig
- DBy adding the full file paths to your prompt of important files
How the community answered
(16 responses)- A75% (12)
- C13% (2)
- D13% (2)
Explanation
GitHub Copilot builds context from what is currently visible and open in the IDE. (A) Opening relevant tabs/files in your IDE makes those files part of Copilot's active context window, allowing it to generate more accurate, project-aware suggestions. (B) Adding relevant code snippets directly to your prompt (especially in Copilot Chat) gives the model explicit, targeted context to work from. (C) .gitconfig is a Git configuration file unrelated to Copilot's context mechanism. (D) Typing full file paths in a prompt does not cause Copilot to read or index those files - only open tabs and explicitly pasted snippets are used.
Topics
Community Discussion
No community discussion yet for this question.