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

Positive Filter #52

Open
iligid opened this issue Dec 8, 2023 · 3 comments
Open

Positive Filter #52

iligid opened this issue Dec 8, 2023 · 3 comments
Assignees

Comments

@iligid
Copy link

iligid commented Dec 8, 2023

Describe the Problem

Instead of filtering out what I don't want to see, a frequent use-case is to filter what I want to see to focus on the currently relevant.

Describe the Solution

*.csv
main.py
Would show only main.py (if existing anywhere) and .csv-files and hide everything else in the workspace

Negative filtering would normally take priority, i.e. if I add temp*.csv to the hidden files, it should not show up.

It's more or less the same like hiding files, but applying the opposite logic

Alternatives

No response

Additional Context

No response

@manifestinteractive
Copy link
Member

@iligid while I really like this idea, the extension is actually taking advantage of native VS Code filtering, which would basically be anything you can do with the existing explorer tree view. Unfortunately, as far as I can tell ( and I looked ) this idea is not supported by VS Code. Their filtering is subtractive, meaning it removes things only. This would require an additive filtering, meaning it would need to remove EVERYTHING and then add in matches ( which is the opposite of how this currently works ).

If anyone has any creative ideas on how to work around this issue, let us know. I can leave this feature request open to see if the community has any thoughts :)

@iligid
Copy link
Author

iligid commented Dec 18, 2023

A likely working solution would be to just register a handler for the following Workspace events (would not directly react on changes initiated outside of VSCode, however):_

      onDidChangeWorkspaceFolders
      onDidCreateFiles
      onDidRenameFiles

and act on the detected changes according to the below pseudo code for the Event handler:

    if not match(file, blacklist) or match(file, whitelist):
        file.show()
    else:
        file.hide()

And of course all files would need to be looped through when activating/editing/adding/deleting a filter with the same logic

@AsafMazuz1
Copy link

I think that my PR can answer this need:
#53

Using the VS Code QuickPick Window, you can select the relevant items you want to work on, and the command will hide everything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants