Ah, you're using the .md instruction files for GitHub Copilot. The issue you're experiencing with global instructions taking precedence over workspace instructions is a known behavior pattern. Here's what's likely happening:
GitHub Copilot processes instruction files in a specific order, and by default, it combines both global and workspace instructions rather than having workspace instructions completely override global ones. The global instructions typically serve as a base layer, with workspace instructions adding to or modifying them.
Here are a few things to check:
-
File naming: Ensure your workspace instruction file is named exactly copilot-instructions.md (not workspace-copilot-instructions.md or any variation) and is located in /.vscode/copilot-instructions.md within your workspace root.
-
Content structure: If you want workspace instructions to override specific global instructions, you may need to explicitly contradict or redefine those instructions in your workspace file. Simply having a workspace file doesn't automatically disable global instructions.
-
File detection: Make sure VS Code recognizes your workspace properly. You can verify this by checking if other .vscode settings are working correctly in your workspace.
-
Copilot reload: After modifying instruction files, you might need to reload the window (Ctrl/Cmd + Shift + P → "Developer: Reload Window") for changes to take effect.
If you want to completely ignore global instructions for a specific workspace, you might need to explicitly state that in your workspace instructions file, though this behavior can vary depending on the Copilot version you're using.
Are your workspace instructions being partially applied, or are they being completely ignored in favor of the global ones?