How to maximise the Copilot's context awareness? #51323
-
Select Topic AreaQuestion BodyWhat context does github copilot use for generating suggestions? Does it matter what files do i open in a VSCode or Intellij IDEA? Knowing what factors are taken into account and what relative weights do they have would really help with using github copilot, as i'll know how to provide it with my project context better. My findings:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
Hi @nikitakunevich , Copilot draws context from the code editor. It does not need access to your repositories. The code context sent to the model is commonly called a "prompt". We're constantly experimenting with new ways to create prompts that will tease even higher-quality suggestions out of the model. As one proof point, Copilot had a suggestion acceptance rate of ~20% when we first launched the technical preview 18 months ago. Today, we're at 35% based largely on improvements to our prompts. We've simply gotten better at telling the model what kind of code the developer likely wants. By way of example, one technique we use today is to look for relevant code in neighbouring files (i.e. tabs open in the code editor). In the future, you can imagine other prompt-crafting techniques that might produce even better quality suggestions. For example, what if we:
Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
@einarpersson, I understand that while your statement is logically sound, publicly traded companies with shareholders would never reveal their algorithms or "trade secrets" to the public, even if we as developers and users would like to see them. This is due to obvious reasons, which is understandable. |
Beta Was this translation helpful? Give feedback.
-
Hi @Akash1134, It has been 1 year since you answered this question, I would like to know what the context scope copilot (v1.178.0) is using now. In your answer you said "tabs open in the code editor", while the vscode document https://code.visualstudio.com/docs/copilot/overview
What are the related files exactly ?
As it mentions the workspace can I assume it is not just the opened files ? BTW, when codeium compare its features with copilot, https://codeium.com/ it says it supports "Full repo context awareness", but since my workspace is also my repo, so I am really confused with the context scope now. ![]() |
Beta Was this translation helpful? Give feedback.
-
While GitHub Copilot provides general code suggestions based on global coding patterns, I’m working on a tool that goes deeper by understanding your specific project. Instead of giving generic code suggestions, it scans your codebase, breaks down each file into relevant sections (Saves them as vector embed), and builds a structured understanding of your project. Then it fine-tunes the model with the data in your codebase. This way, it can provide suggestions and insights that are contextually aware of your project’s unique functions, components, and patterns—making the tool truly responsive to the specific code you’re working with. its going to be a lot of work. but I am working on Proof of concept right now |
Beta Was this translation helpful? Give feedback.
Hi @nikitakunevich ,
Copilot draws context from the code editor. It does not need access to your repositories. The code context sent to the model is commonly called a "prompt". We're constantly experimenting with new ways to create prompts that will tease even higher-quality suggestions out of the model.
As one proof point, Copilot had a suggestion acceptance rate of ~20% when we first launched the technical preview 18 months ago. Today, we're at 35% based largely on improvements to our prompts. We've simply gotten better at telling the model what kind of code the developer likely wants.
By way of example, one technique we use today is to look for relevant code in neighbouring files (i.e.…