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

File quick open should support relative paths #53279

Closed
JacksonKearl opened this issue Jun 28, 2018 · 7 comments
Closed

File quick open should support relative paths #53279

JacksonKearl opened this issue Jun 28, 2018 · 7 comments
Assignees
Labels
feature-request Request for new features or functionality quick-pick Quick-pick widget issues search Search widget and operation issues

Comments

@JacksonKearl
Copy link
Contributor

It would be nice if a user could use Ctrl-p to open something like ../index.html. As it stands a user can only search for file names, not locations, so if a project has many of the same named files (index.html, project.json, etc.) it can be hard to open the right one.

@vscodebot vscodebot bot added the search Search widget and operation issues label Jun 28, 2018
@roblourens
Copy link
Member

Would this be relative to the current file? I like that ctrl+p works globally so it's predictable and I don't have to think about where I am currently. e.g. foo/bar will do a global search, not just look for foo under the current directory. We do look for relative path matches relative to the folder root so this would overload that. But maybe relative path matches relative to the current file could be prioritized.

@roblourens roblourens added the feature-request Request for new features or functionality label Jun 29, 2018
@JacksonKearl
Copy link
Contributor Author

Do we look for paths relative to workspace root? It seems like we don't. For instance I can't open ./package.json in our repo.

@JacksonKearl
Copy link
Contributor Author

I think we should keep current behaviour except for strings that start with ./ or ../. Right now, these queries don't help much (./ in our repo gives results from all of our dot directories, and ../ gives no results). We could make ./ and ../ be relative to current file, and maybe make / relative to either filesystem root or workspace root.

@roblourens
Copy link
Member

I guess the code I was thinking of just does path.join with the folder and the query (so ./ isn't respected) and if it's a match, then it skips the excludes. I think it's not working though.

/ already works for searching with absolute paths:

image

I don't know if I'm sold on ./ and ../, it doesn't fit my mental quickopen model, but I can see how it would be useful. @bpasero? I would imagine this would be another feature on the quickopen frontend that a search provider doesn't know about.

@bpasero
Copy link
Member

bpasero commented Jun 30, 2018

I don't know if I'm sold on ./ and ../, it doesn't fit my mental quickopen model

Same here

I would imagine this would be another feature on the quickopen frontend that a search provider doesn't know about

Yes, for sure nothing that should live in the search service.

@JacksonKearl
Copy link
Contributor Author

I think this is mostly addressed by #9418

@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 31, 2018
@joaomoreno
Copy link
Member

From @gpaul:

I had the same issue as in #53279 and wrote a little extension to fix it: quickOpenRelative.

See https://marketplace.visualstudio.com/items?itemName=gpaul.quickOpenRelative

The extension provides a single command quickOpenRelative.quickOpenRelative that opens the quick launch panel with the current directory path filled in, which is equivalent to trying to open a file in the current directory. I've bound my default ctrl+p to this command.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality quick-pick Quick-pick widget issues search Search widget and operation issues
Projects
None yet
Development

No branches or pull requests

4 participants