Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workspace Filtered Folders #212637

Open
Tracked by #212907
Servinjesus1 opened this issue May 13, 2024 · 1 comment
Open
Tracked by #212907

Workspace Filtered Folders #212637

Servinjesus1 opened this issue May 13, 2024 · 1 comment
Labels
feature-request Request for new features or functionality workbench-multiroot Multi-root (multiple folders) issues

Comments

@Servinjesus1
Copy link

Workspace Feature: Filtered Workspace Folders

In short, this Feature involves being able to add folders to workspaces that include only a specific subtree of the referenced folder for use in VSCode. Think of this filter like a step more abstract than extensions which hide files from the Explorer: anything filtered out at the Workspace level is not touched by VSCode or its extensions whatsoever.

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 entire Archive 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, following findutils nomenclature:

{
    "path": "...",
    "name": "...",
    "ipath": ["**/Filter1/*", "**/Filter2/**"],
    "iname": ["*.md"]
}

This allows for arbitrary filter application at the folder level (path or ipath) or file level (name or iname). Properties may be string or list like, with list-likes translated to find (-ipath -or)-esque filters

Potential Caveats and Gotchas

  • Saving new files to unmatched locations, or not considering extension files that may not match filters.
    • Maybe have a warning when any file is saved that doesn't match a filter. Allow saving but then nothing else.
  • Saving over existing files that don't match
    • Error: Filename taken by existing file outside workspace folder filter
@lramos15 lramos15 assigned bpasero and unassigned lramos15 May 16, 2024
@bpasero bpasero added feature-request Request for new features or functionality workbench-multiroot Multi-root (multiple folders) issues labels May 16, 2024
@bpasero bpasero removed their assignment May 16, 2024
@VSCodeTriageBot VSCodeTriageBot added this to the Backlog Candidates milestone May 16, 2024
@VSCodeTriageBot
Copy link
Collaborator

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality workbench-multiroot Multi-root (multiple folders) issues
Projects
None yet
Development

No branches or pull requests

4 participants