Skip to content
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

Folder-scoped copilot-instructions.md #4239

Closed
alvaromartmart opened this issue Jan 17, 2025 · 7 comments
Closed

Folder-scoped copilot-instructions.md #4239

alvaromartmart opened this issue Jan 17, 2025 · 7 comments
Assignees
Labels
custom-instructions feature-request Request for new features or functionality

Comments

@alvaromartmart
Copy link

Using a copilot_instructions.md is a great way of improving the performance of Github copilot and ensure suggestions consistent with a team or project own standards.

However, there are situations where multiple, different copilot_instructions might be relevant for different folders in a repo: e.g. in monorepos that might contain a java backend or several frontend applications using different frameworks.
In those cases, specifying folder-specific instructions in the single copilot_instructions can be tricky and perform worse.

It would be great if Github copilot supported folder-scoped copilot_instructions, in the same way that e.g. .gitignore or .dockerignore files can be scoped inside a folder hierarchy, so that they would be picked up by copilot when generating code based on the relevant files in the context.

Example:

.github/copilot_instructions.md
frontend/.github/copilot_instructions.md
backend/.github/copilot_instructions.md
  • When generating completions with frontend/file1 in context, copilot would take both .github/copilot_instructions.md and frontend/.github/copilot_instructions.md
  • When generating completions with frontend/file1 and backend/file2 in context, copilot would take all
@aeschli
Copy link

aeschli commented Jan 22, 2025

Thanks for the suggestion.
Completions are not yet using the instruction files, only the chats. And for the chats its not so easy to know where the changes will happen.
So the currently chosen approach is put the folder specific instructions in the global instruction file:
Something like:
When working in 'frontend' use the Xy framework

@aeschli aeschli transferred this issue from microsoft/vscode Jan 22, 2025
@aeschli aeschli added custom-instructions feature-request Request for new features or functionality labels Jan 22, 2025
@vs-code-engineering vs-code-engineering bot added this to the Backlog Candidates milestone Jan 22, 2025
Copy link

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 10 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Copy link

This feature request has not yet received the 10 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding

@helmut-hoffer-von-ankershoffen

This is quite important for mono and polyrepos, so +1.

@Adamantish
Copy link

Adamantish commented Mar 18, 2025

"for the chats its not so easy to know where the changes will happen"

True. But typically the user will choose files only inside one team/component folder with no ambiguity about which instructions to choose. Would it be possible to build for that case with graceful degradation in the case it's not possible?

@aeschli
Copy link

aeschli commented Mar 20, 2025

We now also have the prompt files. They can be stored in the workspace and added as context in the chat view.

That's one click more, but gives you control over what's in your prompt.

Copy link

🙁 In the last 60 days, this feature request has received less than 10 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vs-code-engineering vs-code-engineering bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
custom-instructions feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants