Bug 1385 - Find in Selection is not easy to find
Summary: Find in Selection is not easy to find
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: Trunk
Hardware: Macintosh Mac OS
: Normal minor
Target Milestone: ---
Assignee: Alan McGovern
Depends on:
Reported: 2011-10-09 14:46 UTC by bryan costanich
Modified: 2012-02-24 01:37 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description bryan costanich 2011-10-09 14:46:19 UTC
open MD. open a file.
no "in selection" feature. :(
Comment 2 Mikayla Hutchinson [MSFT] 2011-10-09 17:18:08 UTC
Find in Files has a "Selection" scope.

Do you have a suggestion for how we could integrate this into inline search UX?
Comment 3 Mikayla Hutchinson [MSFT] 2011-10-09 18:41:46 UTC
For comparison: VS10 has two find *dialogs*: control-f = "quick find", control-shift-f = "find in files". They look almost identical, with several options and a "scope" combo. Find lets you scope it to current selection, current document, current block, current project, current solution. Find in Files lets you scope it to directories, projects, solutions.

MD's control-f is "incremental search", which is very minimal and integrated into the editor, like chrome. Apparently VS11 preview has this, though I have't tried it. MD's "find in files" is like VS, except that it's a single dialog that has the scoping options from *both* of the dialogs that VS has, including scoping to the current selection.

IMO MD's solution is nicer but could use some tweaks. Maybe "Incremental Search" could be named as such, and the "Find in Files" dialog would becomes just "Find", but we'd keep the current keyboard shortcuts. And IIRC we have some code to set the scope to "selection" if there's a selection when the Find in Files dialog is opened, but it's commented out and I've never known why.
Comment 4 Lluis Sanchez 2011-10-13 11:00:04 UTC
I never liked that Selection scope in Find in Files, I don't think it belongs there. A better option would be to add an option to the incremental search bar for limiting the search (and replace) to the current selection.
Comment 5 Alan McGovern 2011-10-14 06:39:35 UTC
My 2c, when MD used to default to selecting 'Selection' scope when the Find in Files dialog is opened and the user had a selection, I used to *always* deselect it and manually revert back to my previous Scope choice. Find in selection is so rarely used that i don't see the benefit in having it auto-selecting, especially in the Find in Files dialog which does imply a broader scope.

I like the idea of having an option in the embedded search widget as logically find in selection is constrained to the current document. Though again, i wouldn't like it to default to search in selection because the existing logic is that if you double-click on a word to select it and pop open the embedded search dialog, the selected word is used as the search term. This matches what I would assume is a common enough thing to do.
Comment 6 Mike Krüger 2011-11-15 16:01:41 UTC
We can't just put it into the find in buffer - if someone get's a nice idea how to do it maybe, but finding in selection always requires to open a "list" of occurences because every move of the caret in the selection would clear it.

I don't know what you have in mind, but we can add the search in selection to the incremental search and then just acting like the find in files dialog.

There is no reason not adding it, I am right ?
Comment 7 Mike Krüger 2012-02-23 02:04:49 UTC
There is not really a way to integrate it good in the current search in buffer feature. 

However we should rename "Find in files" to "Find in sope"
Comment 8 bryan costanich 2012-02-23 02:54:12 UTC
When in doubt, just follow VS. They've done the UX work for us.
Comment 9 Mikayla Hutchinson [MSFT] 2012-02-23 11:57:09 UTC
No, the VS UX does not apply to MD, because they don't have a Chrome-like incremental search, they only have two "what's the difference between these" dialogs, one of which is pretty much the same as our "find in files".

In fact, VS11 effectively copies incremental search from *us*, which invalidates your argument.
Comment 10 Mike Krüger 2012-02-24 01:37:33 UTC
Our search is very good IMO - there is no need for the ugly popup dialogs. I must say I've never needed search in selection in the last 20 years :)