Giter VIP home page Giter VIP logo

scope-to-this-vscode's Introduction

Scope to This ๐ŸŽฏ

Adds "Scope to This" option to the Explorer context menu, like in Visual Studio. Lets you focus on the things that matter.

Features โœจ

  • Adds "Scope to This" option to the Explorer context menu to scope the selected directory.
  • Adds "Clear scope" option to the Folders view as a shortcut icon (also available as a command scope-to-this.clear) to clear the filter and return to the project's root folder.
    clear-shortcut

Known Issues ๐Ÿ›

  • To scope we use the file.exclude option in the settings.json configuration file. This file may be included in the Git repository. So be careful when you commit...

  • Folders and files that have the same prefix as the selected folder name may still appear. For example, if you want to scope to the .vscode folder, folders and files like .vs and .vscodeignore will still be visible.

Acknowledgement ๐Ÿ™

This project inspired by these projects:

scope-to-this-vscode's People

Contributors

dependabot[bot] avatar rhalaly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

gitaiqaq

scope-to-this-vscode's Issues

Support multiple scopes

It would be great if we could record several scopes. So that user can swith between scopes in a big project.

Conflict with PHP Intelliphense extension

Not sure if this is fixable on either end specifically, so starting here as its always easier to get a newer project to make a change than a long established one.

So it goes like this.

  1. Load up project with intelliphense.
  2. Scope to a child folder that includes files that call functions/classes from the global scope. ex. a WordPress plugin within the WordPress installation that calls WP core functions.
  3. Reload the window (common for variety of reasons such as extension removed etc).
  4. Notice that intelliphense is now not picking up any of the functions/classes outside of the scoped folder.

Reverse is simple, unscope and "reload window" again, then scope back in.

So just off the top of my head a possible simple solution might be:

  1. Detect window reload, assuming you can. Move the scope to a different storage key.
  2. After reload and init, move the scope settings back into place

This could be cool in general as it could be done for closing the program and opening a project etc.

Scope to this "in new panel"

I would love to have an option to scope to a certain file tree node, but having the scoped view resulting in a separate pane.
This could be very handy for e.g. large java projects, where I scope to the tests folder, while having the file explorer being scoped to my actual implementation classes.

Context menu is attached to wrong view: "Explorer" instead of "Folders" view

By default the Explorer view contains views/subviews or whatever they're called.. views like:

Folders
Open Editors,
Outline,
Timeline

Well, the Scope to This context menu opens only works in the "Folders" view of course. However, if you drag the Folders view out of the Explorer parent view, say into the secondary sidebar and/or split inside other view areas besides "Explorer", then the Scope to This menu simply no longer shows up with you right click a folder. It's missing. It only shows up if Folders is explicitly inside Explorer, though it can be placed lots of other places in the sidebar UI.

To test, try dragging Folders view outside of the Explorer container and into various different places to make sure - even in its own standalone area of the sidebar.

These two commands highlight the difference between focusing the views at issue:
Explorer: Focus on Folders View (workbench.explorer.fileView.focus)
View: Show Explorer (workbench.view.explorer)

Multi-folder scope

First, what an awesome extension. Feels like a hit.

That said would be great if you could select 2 or more folders for the scope.

Currently if I select 2 folders in the same parent directory it will set the scope to the parent and show all children.

I can then of course hide the other folders in that area but that isn't ideal.

Excludes with "when" clauses are obliterated.

Before, my folder config has:

  "files.exclude": {
    "**/.git": true,
    "**/.svn": true,
    "**/.hg": true,
    "**/CVS": true,
    "**/.DS_Store": true,
    "**/.alm": true,
    "**/.nyc_output": true,
    "**/.tmp": true,
    "**/~$*.{doc,xls,ppt}x": true,
    "**/node_modules": true,
    "lib/*.d.ts": {
      "when": "$(basename).ts"
    },
    "lib/*.js": {
      "when": "$(basename).ts"
    },
    "lib/*.map": {
      "when": "$(basename)"
    },
    "packages/*/src/*/**/*.d.ts": {
      "when": "$(basename).ts"
    },
    "packages/*/src/**/*.js": {
      "when": "$(basename).ts"
    },
    "packages/*/src/**/*.map": {
      "when": "$(basename)"
    },
    "packages/*/test/**/*.d.ts": {
      "when": "$(basename).ts"
    },
    "packages/*/test/**/*.js": {
      "when": "$(basename).ts"
    },
    "packages/*/test/**/*.map": {
      "when": "$(basename)"
    }
  }

and after scoping, i only have this

  "files.exclude": {
    "**/.git": true,
    "**/.svn": true,
    "**/.hg": true,
    "**/CVS": true,
    "**/.DS_Store": true,
    "**/.alm": true,
    "**/.nyc_output": true,
    "**/.tmp": true,
    "**/~$*.{doc,xls,ppt}x": true,
    "**/node_modules": true,
    "[!p]*/**": true,
    "p[!a]*/**": true,
    "pa[!c]*/**": true,
    "pac[!k]*/**": true,
    "pack[!a]*/**": true,
    "packa[!g]*/**": true,
    "packag[!e]*/**": true,
    "package[!s]*/**": true,
    "packages/[!u]*/**": true,
    "packages/u[!t]*/**": true,
    "packages/ut[!i]*/**": true,
    "packages/uti[!l]*/**": true
  },

Exclusion pattern generation bug

I have a workspace with 4 folders added to it:

  • mod
  • mod-adjustments
  • mod-adjustments_0.1.2
  • mod-cheats

Both mod-adjustments and mod-cheats have a subfolder src.

Scoping to src in the mod-adjustments folder works fine and creates the following exclusion rules:

"files.exclude": {
  ...
  "[!s]*/**": true,
  "s[!r]*/**": true,
  "sr[!c]*/**": true
}

Scoping to the src in the mod-cheats folder doesn't work and creates weird exclusion rules:

"files.exclude": {
  ...
  "[!-]*/**": true,
  "-[!c]*/**": true,
  "-c[!h]*/**": true,
  "-ch[!e]*/**": true,
  "-che[!a]*/**": true,
  "-chea[!t]*/**": true,
  "-cheat[!s]*/**": true,
  "-cheats/[!s]*/**": true,
  "-cheats/s[!r]*/**": true,
  "-cheats/sr[!c]*/**": true
}

I've tried renaming the src folder in mod-adjustments as well as in mod-cheats separately, but that didn't change anything. I also removed the mod folder temporarily, assuming that might cause the rules to just start with -cheats.
Nothing changed the behaviour.
Just in case anyone questions it: mod and mod-adjustments_0.1.2 do not have a src folder.

Any ideas what's going on here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.