Author |
Topic |
|
Aleksei
New Member
2 Posts |
Posted - Nov 16 2017 : 03:24:43 AM
|
Hi,
Could you please add an option to enable fuzzy search when navigating files in a solution (they way it works in modern text editors like Sublime Text or Visual Studio Code)? For instance, I would like to enter "imdem" in the search text field to be able to find the file named "imgui_demo.cpp". Even just allowing to skip some symbols when filtering would be great.
Actually, this might be useful in other windows as well, for example when pressing Alt+M to list methods in current file.
Thanks! |
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Nov 16 2017 : 10:45:54 AM
|
We have a few ways to filter the dialog. Most notably, you can put space between parts of a symbol name. "im dem" or "gui de", for example, would be able to find imgui_demo.cpp. Spaces means searching substrings and all of the part must be present. The advantage of this is that the parts doesn't need to be in the same order as in the symbol name. You can find a more comprehensive review here:
https://docs.wholetomato.com/default.asp?W193 On this page, scroll down to "Filtering in the Dialog".
The filtering also works with alt+m and alt+shift+s. When dealing with symbols, a useful trick is to use dots: .update. will only find the method "Update", but not "UpdateFrequency" or "QuickUpdate".
Hope this helps. |
Edited by - accord on Nov 16 2017 10:49:03 AM |
|
|
Aleksei
New Member
2 Posts |
Posted - Nov 16 2017 : 12:56:15 PM
|
Oh. Now I feel stupid being an over decade long user of Visual Assist. Well, I guess now I'm even more happy user, cheers! :) |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Nov 16 2017 : 3:36:28 PM
|
The Open File and Find Symbol dialogs do tell you about this filtering, if you read the pale text in the filter field when you first open the dialogs, but its an easy thing to miss. As for using the same filtering rules elsewhere, that's a little less obvious, but very useful once you know about it |
zen is the art of being at one with the two'ness |
|
|
Jimbly
New Member
USA
3 Posts |
Posted - Dec 11 2017 : 5:22:53 PM
|
I've also migrated to and from Sublime in the past few years, and really miss its fuzzy searching.
By far the most important bit of it to me is that it allows typos, and I make typos all the time. By allowing any two characters (in my search string) transposed to still match (e.g. "im dme" would still match "imgui_demo.cpp").
I have known about the method of using a space, and when I first switched to sublime I was surprised to find it matching things that Visual Assist would not have, but then have been surprised ever since that it virtually never brings me to the wrong file/symbol (because it has very good sorting/weighting such that if the search string is found contiguous in a filename, that always beats being split up and found elsewhere, among other things). In Sublime, matching without needing to insert spaces combines synergisticly with the typo feature in that you can now miss typing a character in the middle of a filename and it will still match. Visual Assist is so good at fixing my typos when I type my code, I wish it would be as forgiving when I open files and go to symbols =).
I've never found myself using the other Visual Assist filter features, so having a mode (maybe on until you type a space or "-" or start/end with a "."?) that does fuzzy matching would be really appreciated.
The other thing about Sublime's filename matching I miss after returning to Visual Assist is matching against paths. Again, it's lower priority matching than matching the filename, but if I search for "client comm", Visual Assist does not find/match "[Project Root]/Client/NetComm.cpp", and I often have identically or similarly named files in my "client" and "server" directories, so this is sometimes filters out the file I'm actually looking for. The situation isn't helped by the fact that about half the time I add "client" to the name of the file now (to make Visual Assist more likely to find it), but old files might not have that in its name ^_^.
Thanks! Jimb Esser Visual Assist user since 2001
|
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Dec 12 2017 : 12:00:57 PM
|
First the directory searches, if you open the Open File dialog, and use the search /client then VA will search the path, not the filename, for a directory starting with the name "client", which will let you quickly and easily find these files.
In a way this shows my concerns about this idea. What you are suggesting is interesting, but it is also a different set of search rules and behaviours, and not automatically an obvious one. Adding yet another filter "command" isn't automatically helpful either, since a lot of our users don't seem aware of, or don't use space filtering, let alone the other options. These options, including / are described in the filter field, when it is blank, so simply documenting them doesn't help much. |
zen is the art of being at one with the two'ness |
|
|
Jimbly
New Member
USA
3 Posts |
Posted - Dec 12 2017 : 12:20:41 PM
|
I think having a bunch of different kind of search commands defeats the purpose of a smart search - I shouldn't have to remember/specify "for this file, I need to type a slash first". Even now knowing that a slash does filename searches, when I go to open a file my process is now: * Type in "cleintcomm" * Nothing shows up, try adding a space, maybe there was some other word between "client" and "comm" * Nothing shows up, double check the spelling, fix typo of "cleint" * Nothing shows up, try adding a slash at the beginning (or, previously, I'd delete some tokens, and start manually scrolling through the list, which is never efficient) * Finally open my file.
In Sublime, I just type the same thing, and, bang, there it is.
I realize some people may have very, very large project structures, and having these various search options are useful in some circumstances, but it seems that most of the time it would be better to just be more lenient. You can certainly have all of the existing specific rules, and if anything is matched by those, it's first in the list, and still additionally have more fuzzy (lower priority) matching so I don't end up with an empty list so often =). |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Dec 12 2017 : 3:51:09 PM
|
Using this as a fall back, when what you have typed in does not match anything makes sense, I can see how this might work.
Is the approach, the rules that Sublime uses actually described anywhere? I have looked at their documentation, but so far, if you had not told me this was an option, I don't know how I would discover it is doing something like this. I am used to having to search fairly exactly. |
zen is the art of being at one with the two'ness |
|
|
Jimbly
New Member
USA
3 Posts |
Posted - Dec 13 2017 : 09:37:31 AM
|
Thanks for considering it =).
It hasn't been heavily documented, but the best I could find is this: https://blog.forrestthewoods.com/reverse-engineering-sublime-text-s-fuzzy-match-4cffeed33fdb which includes a link to a thread where a Sublime author weighed in with additional suggestions (supporting character transpositions). The article doesn't mention the lower weight for matching paths vs filenames vs extensions though, and I think there's some weighting going on there. I believe Sublime Text 2 actually showed the match weights (an irrelevant number to the user, but interesting), but Sublime Text 3 does not seem to.
Searching for "Sublime fuzzy search" finds a couple other open source implementations that might be more complete, but not particularly well documented like this one: https://github.com/farzher/fuzzysort
|
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Dec 15 2017 : 08:36:28 AM
|
The link helps, but also shows that this is not a "simple" search. I have put in a feature request for a more fuzzy search as a fall back if no matches are found, certainly some of these searches, like checking the path automatically, do make sense:
case=113205 |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|
|
|