Workspace Filtered Folders #212637
Labels
feature-request
Request for new features or functionality
workbench-multiroot
Multi-root (multiple folders) issues
Milestone
Workspace Feature: Filtered Workspace Folders
Feature Brief
Add the ability to filter contents of a directory when adding it as a Folder to the Workspace. This enables selection of a "sub-tree" of folders/files beneath a directory (location) with which to work in that workspace Folder. For example, if you have a large archive but only want files in folders that match a specific glob pattern (e.g.
Archive/**/PRFX*/
), then you can add the entireArchive
folder, apply this filter, and work with only the files that match this pattern.Relationship to Other Features
Unlike simply hiding files/folders from the Explorer, Filters would leave unmatched files completely alone and unparsable by further VSCode features or Extensions. This can make configuration simpler so that certain files can be ignored for all extensions at the workspace level, rather than having to reconfigure every extension's ignore patterns for every workspace.
Benefits and Examples
This could drastically save overhead by preventing Source Control, Linters, Debuggers, and Static Code Analyzers configured to run at the Workspace level from processing unnecessary files.
I have a large resource library and archive that I use to store past project information and useful tidbits like snippets. By using a specific naming scheme for these resources, I have certain folders which inform specific types of projects. For example, my archive is organized by year and by specific names based on hierarchy, category, alphabet, time, and location (context) (reverse-LATCH). My resources are similarly sorted into folders. By using filters, I could include the entire Archive or Resources directories, then filter out only the resources which are pertinent to a given project based on that naming scheme. That way I don't have to add specific resources one at a time as separate folders for the workspace.
Adding folders by hand isn't too hard, I admit, but can get a bit messy if I add everything over time to a big project and have tens of workspace folders. Filters would help in that case by essentially "categorizing" workspace folders into groups (past project examples, snippets, etc.) that can be collapsed.
Implementation Ideas
Add a new properties to folders in the
.code-workspace
that applies filters. For example, followingfindutils
nomenclature:This allows for arbitrary filter application at the folder level (
path
oripath
) or file level (name
oriname
). Properties may be string or list like, with list-likes translated tofind (-ipath -or)
-esque filtersPotential Caveats and Gotchas
The text was updated successfully, but these errors were encountered: