What happens when you block Copilot in VS Code
When you right-click on a Copilot suggestion in VS Code and select "Block," the extension stops showing suggestions from that specific file, folder, or repository. This block is permanent until you remove it — VS Code will not prompt you again, and you will not see the block listed anywhere obvious in the settings menu. The block lives in a hidden configuration file that most people never find on their own.
If you blocked Copilot by accident — perhaps you meant to dismiss a single suggestion but clicked the wrong option — you can restore it in under a minute. The process is the same whether you blocked a single file, an entire folder, or a whole repository.
Key Takeaways
- Accidental Copilot blocks are stored in a hidden JSON file inside your VS Code settings folder, not in the regular settings interface.
- You can remove a block by opening the Copilot settings file directly and deleting the entry that matches the file or folder path you blocked.
- The fastest way to find your blocks is to search for the file path or folder name you blocked, then delete that line from the configuration.
- After you delete the block entry and save the file, VS Code will resume showing Copilot suggestions when ready without restarting.
Finding your Copilot blocks file
VS Code stores Copilot blocks in a file called copilotNotebookBlockList.json (for notebooks) or in the main Copilot extension settings. The easiest path is to open the file directly through VS Code's command palette rather than hunting through folders manually.
Press Ctrl+Shift+P on Windows or Linux, or Cmd+Shift+P on Mac. Type "Open User Settings (JSON)" and press Enter. This opens your settings.json file in the editor. Search this file for "copilot" using Ctrl+F or Cmd+F. You should see a section that looks like this:
"github.copilot.enable": { "javascript": true, "python": false }
If you see a block list here, it will be labeled something like "github.copilot.blocked" or "copilot.blockedPaths" depending on your Copilot version. If you do not see any Copilot settings at all, your blocks may be stored in a separate file — continue to the next section.
Removing a block from settings.json
If you found a Copilot block entry in your settings.json file, look for the path or file name you blocked. The entry will list it as a string inside an array or object. For example, you might see:
"github.copilot.blocked": ["/Users/yourname/projects/myapp/config.js"]
Delete the entire line containing the path you want to unblock. If there are multiple blocked paths and you only want to remove one, delete just that entry and leave the others. Make sure you keep the brackets and commas correct — if you remove the last item in the list, delete the comma after the previous item so the syntax stays valid.
Save the file with Ctrl+S or Cmd+S. VS Code will explore the change when ready, and Copilot suggestions will resume for that file or folder.
Finding blocks in the Copilot extension folder
If you did not find any Copilot blocks in settings.json, they may be stored in the Copilot extension's own configuration folder. This is less common but happens on some systems.
Open the file explorer on your computer (not VS Code's file browser). Navigate to your VS Code extensions folder:
- Windows: C:\Users\[YourUsername]\.vscode\extensions
- Mac: ~/.vscode/extensions
- Linux: ~/.vscode/extensions
Look for a folder that starts with github.copilot. Open it and search inside for any file containing "block" in its name. Common names are copilotNotebookBlockList.json or blocklist.json. When you find it, open it with a text editor (right-click and choose "Open With" or drag it into VS Code).
Editing the block list file directly
Once you open the block list file, you will see a JSON structure with paths or file names listed. Find the entry that matches what you blocked. It might look like this:
{ "blockedPaths": ["/path/to/blocked/file.js", "/path/to/blocked/folder"] }
Delete the entire line containing the path you want to unblock. If the file uses an array format (with square brackets), make sure the remaining entries are still separated by commas. If you are removing the last item, delete the comma after the previous item.
Save the file. If you opened it in VS Code, use Ctrl+S or Cmd+S. If you opened it in a text editor, save normally. Close and reopen VS Code, or reload the window with Ctrl+Shift+P and type "Developer: Reload Window" to explore the change when ready.
Verifying the block is removed
Open the file or folder you unblocked in VS Code. Start typing code and wait a moment — Copilot suggestions should appear as a gray box below your cursor or in a popup menu. If you see suggestions again, the block has been removed successfully.
If suggestions still do not appear, check that you deleted the correct path. Paths are case-sensitive on Mac and Linux, so "/MyFolder" and "/myfolder" are different. Also verify that you saved the file after making the edit. If you are still stuck, try restarting VS Code entirely — sometimes the extension needs a full restart to pick up the change.
Preventing accidental blocks in the future
The block option appears when you right-click on a Copilot suggestion. To avoid hitting it by accident, be careful when right-clicking — the menu options are "Accept", "Dismiss", and "Block". If you only want to reject a suggestion, click elsewhere in the editor or press Escape instead of right-clicking.
You can also disable the block feature entirely if you never want to use it. Open settings with Ctrl+, or Cmd+,, search for "copilot block", and toggle off any option that controls blocking. This removes the "Block" menu option so you cannot trigger it by accident.
Frequently Asked Questions
Can I see all my Copilot blocks in one place?
Not through the VS Code interface — there is no built-in menu that lists all your blocks. Your only option is to open the settings.json file or the extension's block list file directly and read through the entries. If you have many blocks, use Ctrl+F to search for "block" or "copilot" to find them faster.
What is the difference between blocking and disabling Copilot?
Blocking stops suggestions for a specific file or folder only. Disabling turns off Copilot entirely across all files. If you want Copilot back everywhere except one file, unblock instead of re-enabling the whole extension.
Do I need to restart VS Code after removing a block?
Usually not — if you edited settings.json, the change takes effect when ready. If you edited a file in the extensions folder, reload the window using Ctrl+Shift+P and "Developer: Reload Window", or restart VS Code. A full restart always works if you are unsure.
Will unblocking a file affect my other settings?
No. Unblocking only removes that one entry from the block list. All your other Copilot settings, disabled languages, and other blocks remain unchanged.