Skip to content

How can I control the context? #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
einarpersson opened this issue May 22, 2025 · 2 comments
Open

How can I control the context? #115

einarpersson opened this issue May 22, 2025 · 2 comments

Comments

@einarpersson
Copy link

Hi!

I suppose the title says it all.

I use many ai-tools, for example aider, aichat and CodeCompanion. Setting the appropiate context is crucial for good output. However, I have yet to understand how / if it is possible to provide a certain context reliably to Copilot Inline Suggestions. If not, is there any other (perhaps indirect) way to do it that actually works somewhat reliably?

I have searched for answers on the web but most often find results that seems more relevant to Copilot Chat which is not what I am after.

This feels sooo central to getting better inline completions. Grateful for any comment.

(Typical example: I want to get better hints for Svelte 5. Currently the suggestions are typically Svelte 4 as the training data is limited. I want to insert a condensed cheatsheet)

Note: If the answer is NO, then please let me know and I can stop looking.

@einarpersson
Copy link
Author

einarpersson commented May 23, 2025

I found this in :h copilot

                                                *g:copilot_workspace_folders*
g:copilot_workspace_folders
                        A list of "workspace folders" or project roots that
                        Copilot may use to improve to improve the quality of
                        suggestions.
>
                        let g:copilot_workspace_folders =
                               \ ["~/Projects/myproject"]
<
                        You can also set b:workspace_folder for an individual
                        buffer and newly seen values will be added
                        automatically.

  1. What does Copilot do if this value isn't set? I mean, if I am to set a value I'd like to know what I override. Does copilot try to "guess" a project root or does it simply have a narrower focus when the setting is not set?
  2. How do you @tpope use this, or recommend to use it? One way is to just always set it to the project root, but if you have a big project it could perhaps lead to a big number of irrelevant files confusing the model? Would be super to just get a short hint on how to "maximize" the impact of this setting.

@Sakshivirang3826
Copy link

Sakshivirang3826 commented May 24, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants