microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.87k stars 29.16k forks source link

Copilot instructions - support specifying global files outside the workspace #231269

Open audunsolemdal opened 2 weeks ago

audunsolemdal commented 2 weeks ago

So I have been playing around with these settings

  "github.copilot.chat.experimental.codeGeneration.instructions" : [
    {
      "file": "rules.md"
    },
  ],

When specifiying files in this manner, the file needs to be in the same workspace as your current editor.

What I would like is

  "github.copilot.chat.experimental.codeGeneration.instructions" : [
    {
      "file": "/path/to/rootfolder/copilot-instructions/profiles/default/copilot-codegeneration.md",
      "global": "true",
      "override-local-ruleset": "true", # causes merge with local rulesets if found. If conflict, local rules will override
    },
    {
      "file": "local-codegeneration-rules.md"
    },
  ],
  "github.copilot.chat.experimental.codeFeedback.instructions": [
    {
      "file": "/path/to/rootfolder/copilot-instructions/profiles/default/copilot-codefeedback.md",
      "global":  "true",
      "override-local-ruleset": "true", # ruleset is ignored if any non global rulesets are found
    },
    {
      "file": "local-codefeedback-rules.md"
    },
  ],
aeschli commented 3 hours ago

Absolulte paths are problematic as they can't be shared using Settings Sync nor a repository.

The current solution is to put these rules directly in the settings.

aeschli commented 3 hours ago

When you define rules in the workspace and un the user settings, I would expect the rules in the workspace to be for the project and the one on the user settings personal. IMO it's a bit strange that the project can define that my personal rules do not apply.