Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot search specific file types anymore #29760

Closed
alexdima opened this issue Jun 28, 2017 · 13 comments
Closed

Cannot search specific file types anymore #29760

alexdima opened this issue Jun 28, 2017 · 13 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority search Search widget and operation issues verified Verification succeeded workbench-multiroot Multi-root (multiple folders) issues
Milestone

Comments

@alexdima
Copy link
Member

alexdima commented Jun 28, 2017

  • Open vscode
  • Right click on src
  • Choose Find in Folder
  • this used to pop up the search viewlet with ./src in the files to include. It used to be able for me to append /**/*.ts to that value (i.e. ./src/**/*.ts) to search only in TypeScript files.
  • this is no longer possible: /Users/alex/src/vscode/src/**/*.ts never finds anything
  • please note that I do not have multiple folders opened

1.13:
screen shot 2017-06-28 at 15 53 55

Code - Insiders 1.14.0-insider (63def6e, 2017-06-28T05:07:46.148Z):
screen shot 2017-06-28 at 15 51 45

@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues labels Jun 29, 2017
@roblourens roblourens added this to the June 2017 milestone Jun 29, 2017
@roblourens
Copy link
Member

I'm actually not sure I can support this in a reliable way. I would have to search the full disk, applying a full path glob to every file. Or, I would have to separate the path portion from the glob portion, but you can't do that since there is overlap between glob syntax and valid file names.

I could notice that a pattern has a prefix of a root folder's path, but if it works for workspace folders, it should work for any folder.

Workarounds:

  • /foo/bar, **/*.ts (with glob enabled) works for the same result
  • Or just src/**/*.ts will also give the same result

@roblourens roblourens modified the milestones: Backlog, June 2017 Jun 29, 2017
@roblourens
Copy link
Member

roblourens commented Jun 29, 2017

Next month I'll revisit this and think about UI/shorthand for searching in a root folder. Maybe vscode/src/**/*.ts should give this result, or maybe there should be special UI to indicate that this is in the vscode root.

We discussed Slack-style search UI

image

@roblourens roblourens modified the milestones: July 2017, Backlog Jun 29, 2017
@alexdima
Copy link
Member Author

alexdima commented Jun 30, 2017

@roblourens

This is a regression from 1.13, not a feature request. I am not asking for this to work in the multi-root case. Notice how my steps above include running an action from the explorer that existed in 1.13, "Find in Folder".

If only a single folder is opened, the "Find in Folder" should populate the "files to include" in the same way as 1.13, to allow for a core search feature to continue working (i.e. finding results in a certain file type).

i.e. if the workaround is for me to manually replace /Users/alex/src/vscode/src with src every single time I run the "Find in Folder" action, then why doesn't the action do that to begin with, if the new full path thing is broken?

IMHO this should be also trivial to fix, with an if statement, that in the case of a single opened folder, populates the "files to include" with the relative path, and not with the full folder path, where searching in a file type does not work.

Example of searches/tasks that I do often:

  • find a class name used in .css in the src/vs/editor folder
  • find usages of window in .ts in the src/ folder (exclude extensions)
  • etc. etc.

@alexdima alexdima added the important Issue identified as high-priority label Jun 30, 2017
@alexdima alexdima modified the milestones: June 2017, July 2017 Jun 30, 2017
@alexdima
Copy link
Member Author

fyi @sandy081 @bpasero if you know where to write the if statement.

@sandy081 sandy081 assigned sandy081 and unassigned roblourens Jun 30, 2017
@sandy081
Copy link
Member

Hijacked the ownership so that we can have fix soon and have build ready

@sandy081
Copy link
Member

Fix is to fallback to old behaviour of populating include for single root workspace.

@bpasero bpasero changed the title Cannot search specific file types anymore Multi root: Cannot search specific file types anymore Jun 30, 2017
@bpasero bpasero reopened this Jun 30, 2017
@bpasero bpasero modified the milestones: July 2017, June 2017 Jun 30, 2017
@bpasero bpasero assigned roblourens and unassigned sandy081 Jun 30, 2017
@bpasero
Copy link
Member

bpasero commented Jun 30, 2017

@sandy081 thanks, but I suggest to create a separate issue to verify for June and we leave this one open for July. We still need to revisit your fix and provide a fix that also holds for multi root use.

@bpasero bpasero added the workbench-multiroot Multi-root (multiple folders) issues label Jun 30, 2017
@sandy081
Copy link
Member

@bpasero I would suggest to create a separate issue for multi-root, since this issue is reported especially for single root.

@bpasero
Copy link
Member

bpasero commented Jun 30, 2017

Fair enough.

@sandy081
Copy link
Member

Created #29924 for multi-root set up

@sandy081 sandy081 changed the title Multi root: Cannot search specific file types anymore Cannot search specific file types anymore Jun 30, 2017
@bpasero
Copy link
Member

bpasero commented Jun 30, 2017

Me too: #29925

@isidorn
Copy link
Contributor

isidorn commented Jun 30, 2017

Seems to work fine with latest unreleased insiders

screen shot 2017-06-30 at 14 05 37

@isidorn isidorn added the verified Verification succeeded label Jun 30, 2017
@alexdima
Copy link
Member Author

alexdima commented Jun 30, 2017

Thank you @sandy081 ❤️

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority search Search widget and operation issues verified Verification succeeded workbench-multiroot Multi-root (multiple folders) issues
Projects
None yet
Development

No branches or pull requests

5 participants