Open chrmarti opened 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.
But it still filters if I put a path relative the project root. e.g., ./.gitignore
.
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
.
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)
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.
@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
@roblourens I was not aware of that, any reason you removed it? Was it producing bad results?
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.
@roblourens oh, I am only considering relative path results if a path separator is included in the query, such as /
or \
. The code is:
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.
@roblourens well, they will be sorted to the top because they match better. But yeah, that is basically it.
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! 🙏
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.
@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.
Would be really useful to check the built .c files for errors.
@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
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.
in my projects there are many autogenerated files so this would be great
I think it should be a separate command so that we can bind a keyboard shortcut to it, for example, "ctrl+cmd+p".
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.
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.
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
"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:
!
eg. !_mixins
would search also node_modules directory for _mixins
!!
eg. !!_mixins
would search whole workspace for _mixins
including all search.exclude
d and all .gitignore
d locationsIf that is too confusing since !=='not'
then maybe labels would be better:
node:_mixins
would search only node_modulesvendor:_mixins
would search only vendor, etc.all:_mixins
would search whole workspaceHello, 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
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.
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: