Vscode: Allow to "Scope to this" in explorer

Created on 19 Jan 2018  路  17Comments  路  Source: microsoft/vscode

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.

feature-request file-explorer

Most helpful comment

Any status on this feature?

All 17 comments

I believe with filters you can do that...

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

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

Some other issues that I think are asking for the same thing:
https://github.com/Microsoft/vscode/issues/17696
https://github.com/Microsoft/vscode/issues/31368

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

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.

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.

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.

Just wanted to give a use case I have for this: I currently have a mono-repo with two Node.js apps and two React apps. Nowadays, a lot of people (myself and my React generator included) mark JSX files with *.js extensions. For the sake of formatting and so on, I'd like to have the following settings scoped to the folders for my React apps:

"files.associations": {
  "*.js": "javascriptreact"
}

This is huge for Unreal Engine projects, in which there are a bunch of other folders and you're only interested in the source code folder.

Any status on this feature?

[Currently using VS Code Version: 1.31-0-insider on Ubuntu 18]

Rather than at a directory level, I am interested in a grouping function within a single folder by different types of files. For example, with a configuration something like this (instead of or in addition to files.exclude):

"files.groups": {
  "source": {
    "**/*.c": true,
    "**/*.h": true
  },
  "scripts": {
    "**/!(*.*)": true,
    "**/*.code-workspace": false,
  },
  "settings": {
    "**/*.json": true,
    "**/*.code-workspace": true,
    "**/.vscode/*": true
  }
}

(NOTE The "**/!(*.*)": true entry in scripts was _supposed_ to match any file without a dot in the name.)

Then the explorer sidebar could show three sub-groups, "source", "scripts", and "settings" that may be expanded to see the matching files. This could even allow some files to appear in multiple groups and others to never appear. If there is already an extension that provides this, please point it out because I was unable to locate it.

this is one of the missing featured i loved back in the days when i used to program with Aptana Studio.

i work mostly with wp, so i tend to work with multiple plugins and theme. It would help immensely being able to "scope in" and out a directory.

usual structure is:

main dir

  • themes

    • themeA

      -plugins

    • pluginA

    • pluginB

    • ...

like it was mentioned before, having a workspace for each dir wouldn't help, as it would lose the git directory, the linting files etc

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

The issue I had with solving it this way is that all relative includes can no longer be found in vscode IDE.

import { MyService } from 'core/services/myservice.service

Since the current base directory has now changed, you get red squiggly lines and errors on all imports formatted as above.

Really looking for a status on this feature, or if there are any new extensions being built that take advantage of vscode's new tree API that could possibly implement this?

I would also be happy with something as "perspectives" in Eclipse IDE and a fast switch shortcut what do you think ?

All the ticket #95182 needs is 20 upvotes (18 more) and it will go into backlog! Please go and vote...

Yes please

Was this page helpful?
0 / 5 - 0 ratings