This Visual Studio Code extension enforces a focus mode where users can only open pre-selected files or folders. Attempting to open restricted files or folders requires user confirmation by typing the filename or folder name. If another valid file or folder is typed, it is added to the focus list automatically.
Features
Enable/Disable Focus Mode
Manage focus list with multiple entries
Restrict file opening with modal confirmation
Dynamic override to add new files/folders
Persistence across reloads
Structured logging in Output Channel
Installation
Download the .vsix file from the releases or package it yourself.
In VS Code, go to Extensions view (Ctrl+Shift+X), click the ... menu, and select "Install from VSIX...".
Select the downloaded .vsix file.
Usage
Enable Focus Mode: Run command Focus Mode Guard: Enable (Ctrl+Shift+P > Focus Mode Guard: Enable) and select files/folders.
Disable Focus Mode: Run Focus Mode Guard: Disable.
Check Status: Run Focus Mode Guard: Status to see the current focus list.
Packaging the Extension
To package the extension for distribution or installation: