microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.58k stars 29.02k forks source link

Simple way to temporarily turn off exclusions for QuickOpen files #15604

Open chrmarti opened 7 years ago

chrmarti commented 7 years ago

Using a transpiled language I sometimes find the need to look at the transpiled code which typically is excluded from QuickOpen. Having a simple way to turn exclusions off would simplify this. Some options come to mind:

bpasero commented 7 years ago

@chrmarti what I typically do is to copy the full path of the TS file and then replace src with out and ts with js. Quick open will never filter if you put the full path in.

innerlee commented 7 years ago

But it still filters if I put a path relative the project root. e.g., ./.gitignore.

roblourens commented 5 years ago

This is like the button we have in the search view. I have wanted this but I don't want to put a button in our nice minimal quickopen view. How about a separate command, "Go to file (without ignore files and excludes)...". That would be easy for someone to do and low impact. So I'm keeping it open and adding help-wanted.

johnnytemp commented 4 years ago

Or furthermore to a new command, may the default Quick Open action able to show the file item if the path entered is a full existing relative path to the project root?

I feel it quite strange & stupid, to discover that "Quick Open" cannot find the file I want, even I gave the full relative path, which is the almost-complete hint. :-/ (Always needing to copy from or make an absolute path is tedious)

bpasero commented 4 years ago

Quick open always allowed to put the full absolute path into the input box to show this file, even if exclusion lists are defined to exclude it. With the new work on quick open I also expanded this support for relative paths. E.g. if you type some/excluded/path/file.txt and it would result in a match against any of the workspace's folders, the result would appear.

I wonder if this is good enough for most cases.

roblourens commented 4 years ago

@bpasero we used to have that feature for relative paths, I removed it at some point just for simplicity, bringing it back is fine too 😁

I personally think it would be ok to out-of-scope this issue, especially with this workaround with relative paths

bpasero commented 4 years ago

@roblourens I was not aware of that, any reason you removed it? Was it producing bad results?

roblourens commented 4 years ago

I think I was refactoring and got annoyed by having to check the disk on every keystroke before a search can start, because any query can be a valid relative path. Also @chrmarti and I didn't think it was generally known about or used much. Can you link the commit where you implemented it for my curiosity? If perf is ok I have no issue with keeping it.

bpasero commented 4 years ago

@roblourens oh, I am only considering relative path results if a path separator is included in the query, such as / or \. The code is:

https://github.com/microsoft/vscode/blob/8df646d3c5477b02737fc10343fa7cf0cc3f606b/src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts#L571

roblourens commented 4 years ago

Oh so here the search is still triggered at the same time, and exact relative matches (ignoring excludes) are just sorted to the top. I like this better.

bpasero commented 4 years ago

@roblourens well, they will be sorted to the top because they match better. But yeah, that is basically it.

gopalkriagg commented 4 years ago

I will really like this for PHP development. I use PHP Laravel framework, and sometimes I want to look into the source code of Laravel. If I try to Quick Open the file by typing file name it doesn't show up unlike PHPStorm. I looked for some button in the QuickOpen panel to also allow searching from gitignored files but there is no such button.

What I do is remove /vendor folder from .gitignore temporarily to make it work which is not very convenient.

Please implement this feature!

Thank you for the great editor btw! 🙏

jpenna commented 4 years ago

A suggestion to do this is using a prepended symbol before the path (#95918 ), it would turn on/off the search for excluded files, and it wouldn't need any "intelligence" on the IDE side.

gopalkriagg commented 4 years ago

@jpenna Is that symbol decided? Because my VSCode doesn't seem to react to ~ or ^ https://github.com/microsoft/vscode/issues/95918 is closed because it is duplicate of this issue.

itggot-linus-styren commented 4 years ago

Would be really useful to check the built .c files for errors.

jpenna commented 4 years ago

@jpenna Is that symbol decided? Because my VSCode doesn't seem to react to ~ or ^ #95918 is closed because it is duplicate of this issue.

It's just a suggestion, I will make it more clear in the message, sorry

joeystdio commented 4 years ago

In an angular project we have a config.json where we setup environment specific urls. This file is ignored from version control so currently impossible to CTRL+P to it.

Maximetinu commented 4 years ago

in my projects there are many autogenerated files so this would be great

ifeltsweet commented 4 years ago

I think it should be a separate command so that we can bind a keyboard shortcut to it, for example, "ctrl+cmd+p".

bersbersbers commented 4 years ago

I can add that in any LaTeX project, one usually has a single .log file, a single .blg file, a single .aux file, and so on. So I would definitely welcome being able to Ctrl+P, .log and not having to type the output directory and project name at all. Having to copy/type an absolute, or even relative path to the file would be unnecessarily complex in my use case.

If there was some QuickOpenWithExcludes, I would probably bind it to Ctrl+P and never use QuickOpen again.

andrewplummer commented 3 years ago

In addition to generated files, I'm often going into node_modules. For most cases I want this excluded (based on my .gitgnore), but would definitely help to quickly turn it off to access those packages.

matte-esse commented 2 years ago

Please do add a command for Go to File... without exclusions! or maybe a special character to put in the Go to File... search box before the file name, as such: ~excluded_file.ext

SharakPL commented 2 years ago
"search.exclude": {
    "**/node_modules": true,
    "**/node_modules/bootstrap/scss": false,
    "**/bower_components": true,
    "**/*.code-search": true
  },

Following @mjbvz's advice I tried to make Bootstrap scss files searchable, but it doesn't work :( Would be great if it could work maybe like this:

If that is too confusing since !=='not' then maybe labels would be better:

jzyrobert commented 2 years ago

Hello, I had a go at implementing this through a search prefix (! but could be anything not already used) and a command (both in the palette and using Ctrl + Alt + P).

Have a look and see if you have any feedback for it

danielo515 commented 2 months ago

While having a 'keyword' to include certain 'kinds' of ignored files, I think there is value in having a per-workspace configuration of files to include (ignore the fact they are in the gitignore). In my workspace we have several files that are always gitignored, but they are regular work files you want to always be able to quickly jump into. I don't want to open the search-bar with bloated list of potential matches just to quick-jump into one of our 5 or 6 files that are git-ignored but need to be edited.