Skip to content

Allow to "Scope to this" in explorer #41860

Open

Description

I'd like to have the "scope" feature in the tree view to "isolate" a directory in order to have a "cleaner" view. For example, if my project root directory has 2 main sub-directories: "public" and "admin":

  main-dir

      \___ admin

      \___ public

and I want to work only to the "public" directory I'd right-click the "public" directory in the tree view and choose "Scope to this" and then the tree view would show only the "public" directory.

Activity

  1. jrieken commented on Jan 19, 2018

    @jrieken
    Contributor

    I believe with filters you can do that...

  2. bpasero commented on Jan 19, 2018

    @bpasero
    Contributor

    No, with filters you could only exclude (= hide). I think this is a fair feature request.

  3. changed the title [-]Feature request: scope in tree view (like VS)[/-] [+]Allow to "Scope to this" in explorer[/+] on Jan 19, 2018
  4. added
    feature-request
    file-explorer
    on Jan 19, 2018
  5. chrisdias commented on Feb 4, 2018

    @chrisdias
    Contributor

    In the meantime, this extension will let you right click on a folder and quickly open a new instance scoped to that folder:

    https://marketplace.visualstudio.com/items?itemName=chrisdias.vscode-opennewinstance

  6. zumpiez commented on Mar 10, 2018

    @zumpiez

    Some other issues that I think are asking for the same thing:
    #17696
    #31368

    Hopefully if this is closed, there will be some additional discussion rather than a bot swooping in 😄

  7. eiva commented on Mar 12, 2018

    @eiva

    After adding workspaces and the ability to specify common project configuration into workspace config "scope to this" become my "most wanted" feature: having dozens of projects in the workspace make navigation not really easy, and opening specific project in a new instance of VSCode is not fun as most of configs will not be loaded.

  8. CombeeMike commented on Jun 6, 2018

    @CombeeMike

    We'd also appreciate such a feature very much for the following environment:

    We have one large workspace which holds many small projects. Most projects only contain 1 - 3 JS files/modules.

    Obviously working on 1 project, the file explorer is very "cluttered" with irrelevant stuff.

    Creating a dedicated workspace per project is no option since it would mean too much administration overhead since they all share a common set of settings like VSCode workspace settings, "top level" typings, jsconfig.json, .editorconfig, .gitignore etc.

  9. tiborgg commented on Sep 28, 2018

    @tiborgg

    This feature would be greatly appreciated, given that as far as I can tell, monorepo project structures have gained some traction (recently switched to it myself), and most of the time you're working within a particular package, but occasionally you need to go to another package (shared, common, etc) or configure something for the entire project.

  10. 11 remaining items

  11. omeraksu commented on Dec 1, 2020

    @omeraksu

    ++

  12. rhalaly commented on Jun 17, 2021

    @rhalaly

    I was tired of waiting, I hope that this extension will help you meanwhile until the VSCode team will implement it

  13. JacksonKearl commented on Aug 13, 2021

    @JacksonKearl
    Contributor

    Similar to #67988

  14. prateek commented on Mar 18, 2023

    @prateek

    I was about to create a feature request for something quite similar, but I'm going to add my notes here because it seems to be where all other similar/closed issues point to.

    I propose we should solve a slight generalization of the original ask: The ability to define groups of (include+exclude) search filters in the Search (⌘⇧F) view. VSCode currently supports the specification of a (include+exclude) but I find I'm often changing these to toggle searches between scopes such as:

    1. Only the *.go source code (without tests) in my workspace (ignore vendor/etc)
    2. Same as 1. but include tests.
    3. Same as 2, but focus only on tests this time.
    4. Search all *.go files including vendor/etc
    5. Search all config files (.yaml/.star/etc) files
    6. Search all files not in vendor/etc
    7. Search all text files (.md/.markdown/*.txt) not in vendor/etc

    I'd like the option to define/maintain such groupings, and reference them in the Search view. For an example implementation of what I'm asking for -- look at https://www.jetbrains.com/help/idea/settings-scopes.html.

    The closest workaround I've found thus far is https://github.com/sfccdevops/explorer-exclude-vscode-extension. Please let me know if I can provide any further information.

    edit: I stumbled up on #73524 from roblourens's comment. Is that the missing piece holding this back?

  15. kobenauf commented on Oct 9, 2024

    @kobenauf

    I was coming here to request essentially the same idea. I was going to request that if the Explorer has a workspace open, that I can select one or multiple folders in that workspace, right click, and choose Focus This. That would leave the others visible but grayed out, and open files from other folders would be closed, and searches would be restricted to the focused folders. I'm not sure if graying out the excluded folders is the best approach... maybe moving them to a new section at the top called Hidden Folders.

  16. rhalaly commented on Oct 9, 2024

    @rhalaly

    I was tired to waiting for official VSCode support so I made an extension to support "Scope to this" in the explorer:

    https://marketplace.visualstudio.com/items?itemName=rhalaly.scope-to-this

  17. lonix1 commented on Oct 14, 2024

    @lonix1

    That is a nice extension, but users be warned: it manipulates file.exclude in settings.json. Extensions which change that setting will break your customisations. If you haven't customised it, then that extension is quite useful.

    A built-in way is preferable.

  18. rhalaly commented on Oct 14, 2024

    @rhalaly

    lonix1 I mentioned it directly in the README. So no surprizes here. Please note that the extension will not override your customizations if you manually change file.exclude in settings.json. If that happened please open an issue ticket on my github

  19. lonix1 commented on Oct 14, 2024

    @lonix1

    True, but I mentioned it because when someone creates an extension for a missing vscode feature, they tend to close the feature request. In this particular case, the extension is good, but it doesn't suit everybody. So as I said, we still need a built-in way.

  20. rhalaly commented on Oct 14, 2024

    @rhalaly

    lonix1 agree with that. That extension is a work-around until the feature will be built-in in VSCode. It has known issues due to lake of support for that feature in VSCode core. file.exclude is not the right way to do that.

  21. ravindUwU commented on Oct 25, 2024

    @ravindUwU

    A few thoughts for when this is implemented 🤔,

    • When scoped, the "Go to File..." (Ctrl+P) menu should probably only list files within the scope (equivalent files.exclude-ing everything out of scope).

    • When scoped, new terminals (Ctrl+`) should probably be opened to the scoped folder.

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

Metadata

Metadata

Labels

feature-requestfile-explorer

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions