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

Search seeding is inconsistent #88160

Closed
akbyrd opened this issue Jan 6, 2020 · 11 comments
Closed

Search seeding is inconsistent #88160

akbyrd opened this issue Jan 6, 2020 · 11 comments
Assignees
Labels
search Search widget and operation issues

Comments

@akbyrd
Copy link
Contributor

akbyrd commented Jan 6, 2020

Issue Type: Bug

Invoking workbench.action.findInFiles when you have no text selected will seed the search text with the word closest to your cursor. Sometimes.

If the search box is empty it will be seeded with the word under your cursor. If the search box is not empty it is not seeded.

This makes it impossible to know what invoking workbench.action.findInFiles will actually do unless you remember what text is present in the search panel, which probably isn't even open.

Expected result is that the behavior is consistent. Probably that the search box is always seeded when editor.find.seedSearchStringFromSelection is enabled.

VS Code version: Code 1.41.1 (26076a4, 2019-12-18T14:58:56.166Z)
OS version: Windows_NT x64 10.0.17763

@vscodebot vscodebot bot added the search Search widget and operation issues label Jan 6, 2020
@roblourens
Copy link
Member

Really the problem is overloading that keyboard shortcut to mean "search with this text" and also just "focus the search view". I didn't want it to be too aggressive when using ctrl+shift+f just to focus the search view, especially now that changing it would trigger a search. I will leave this open for suggestions but I'm nervous about changing this now.

Original discussion was here #17974 (comment)

@roblourens roblourens added the under-discussion Issue is under discussion for relevance, priority, approach label Jan 6, 2020
@eamodio
Copy link
Contributor

eamodio commented Jan 6, 2020

Maybe it can be a setting if we don't want the change the current behavior? But at least for me, I always want Ctrl+Shift+F to search seeded with the text

@akbyrd
Copy link
Contributor Author

akbyrd commented Jan 6, 2020

@roblourens Since there's a separate option for whether to seed or not the overloading isn't terrible. I could imagine there being separate commands for "focus with seed" and "focus without seed", but it's not something I need personally.

I'm not particularly concerned with whether the focus command seeds when there's no selection or not. I'm only advocating for it being consistently one or the other.

@akbyrd
Copy link
Contributor Author

akbyrd commented Jan 6, 2020

Another option is to promote editor.find.seedSearchStringFromSelection to a enum: never, selection, nearestWord.

@roblourens
Copy link
Member

Out of curiosity do you two not use that keyboard shortcut to focus/reveal the search view?

@eamodio
Copy link
Contributor

eamodio commented Jan 6, 2020

Hrm, I don't think I really ever use it for show/focus. Maybe a compromise, is to show/focus the view if its hidden, and always overwrite if its visible. Then you can at least just hit it twice to overwrite if that is what you want.

@akbyrd
Copy link
Contributor Author

akbyrd commented Jan 6, 2020

I use workbench.action.findInFiles to both show the panel/search view and to focus it.

@bronson
Copy link

bronson commented Jan 24, 2020

I'm glad this issue is open. I spent quite a while trying to figure out how to use Cmd-F and Cmd-Shift-F: https://stackoverflow.com/questions/59888563/how-to-find-selection-in-files The current behavior is a little confusing.

Personally, as long as they behave consistently, I don't think it matters too much if they both pre-seed or not. That said, I hope you choose to either always pre-seed or never pre-seed. Pre-seeding only when it's blank is difficult to figure out, especially when you're not expecting it.

@roblourens
Copy link
Member

I have been thinking about this and related issues again lately #91901

And I am interested in your feedback on this suggestion #91901 (comment)

@roblourens roblourens added this to the April 2020 milestone Mar 28, 2020
@roblourens roblourens added feature-request Request for new features or functionality and removed under-discussion Issue is under discussion for relevance, priority, approach labels Mar 28, 2020
@roblourens
Copy link
Member

Merging into #91901

@roblourens roblourens removed this from the April 2020 milestone Mar 28, 2020
@roblourens roblourens removed the feature-request Request for new features or functionality label Mar 28, 2020
@vscodebot vscodebot bot added this to the Backlog Candidates milestone Mar 28, 2020
@vscodebot
Copy link

vscodebot bot commented Mar 28, 2020

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@github-actions github-actions bot locked and limited conversation to collaborators May 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
search Search widget and operation issues
Projects
None yet
Development

No branches or pull requests

4 participants