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

Quick Open Too Generous #12277

Open
core-ai-bot opened this issue Aug 31, 2021 · 11 comments
Open

Quick Open Too Generous #12277

core-ai-bot opened this issue Aug 31, 2021 · 11 comments

Comments

@core-ai-bot
Copy link
Member

Issue by cfsilence
Wednesday May 01, 2013 at 14:58 GMT
Originally opened as adobe/brackets#3694


When searching for a file named "common.js" the following result should not be included:

http://screencast.com/t/QsuizsgUOz

Quick Open should search strictly for the string in its entirety.

A nice enhancement for Quick Open would also be to support searching via capital letters similar to the way you can in Eclipse.

For example, searching for "TIMC" would find both a filename that contained that string, but would prioritize the file name: ThisIsMyController.txt because I searched for the capitalized letters.

@core-ai-bot
Copy link
Member Author

Comment by rajeshsegu
Wednesday May 01, 2013 at 18:29 GMT


To make it easy, it should just search for the file names only. In IntelliJ, its done a lot better..

screen shot 2013-05-01 at 11 28 48 am

First show all the best match file names and in the later section show all possibilities.

@core-ai-bot
Copy link
Member Author

Comment by ctolkien
Thursday May 02, 2013 at 07:00 GMT


I'm a huge fan of the 'search by capital letters' method.

@core-ai-bot
Copy link
Member Author

Comment by njx
Friday May 03, 2013 at 20:58 GMT


Reviewed. Assigning to@dangoor, and /cc@larz0 for thoughts on this. Seems like there are two issues:

  • filenames with an exact prefix match should sort to the top: I like this idea.
  • search by capital letters: I thought we did this already--it generally seems to work for me.@dangoor, do you know of cases where this wouldn't work?

@core-ai-bot
Copy link
Member Author

Comment by larz0
Saturday May 04, 2013 at 02:46 GMT


I agree with all the suggested improvements.

@core-ai-bot
Copy link
Member Author

Comment by dangoor
Friday May 10, 2013 at 13:48 GMT


In #3588, I'm in the midst of work for code hinting that adds new options to Quick Open. I can look into scoring adjustments that benefit prefixes of the filename. Already, however, a prefix match in the filename is heavily boosted.

@rajeshsegu Quick Open originally searched just in filenames. This made it really hard to use, because it's not uncommon to have to wade through lots of similarly-named files in different directories. By including the directory in the search, you get better results. Note that matches in the filename get a boost, so they're more likely to get to the top.

@cfsilence I can understand the argument about possibly filtering out matches that are pretty poor. My focus with Quick Open has been to make sure that the best matches are near the top and I didn't worry about poor matches appearing farther down the list.

If you have a file called ThisIsMyController.txt and you type timc, the current algorithm should float that to the top (regardless of which directory it's in). Give it a try and let me know if it doesn't for some reason.

Summarizing what I see above:

The original problem reported is just that a file that is a match, though not a good one, appears in the list.

We could fix that, but it seems low priority.

Does anyone on this thread have a case where the file they're looking for isn't at the top of the list? If so, please let me know which file (including the full path in your project) you wanted at the top and which ones were ahead of it. It's impossible for the algorithm to guess 100% which file is intended, but there's always room for improving how close it gets you to a given file.

@core-ai-bot
Copy link
Member Author

Comment by njx
Monday May 13, 2013 at 20:58 GMT


Here's an example I just ran into which is probably similar: in the nj/extension-removal branch (as of 73e24e9), do Quick Open for "emv.js" (intending to get ExtensionManagerView.js). If you just type "emv", you get the right hit at the top, but adding the ".js" suddenly brings another item to the top: "mv.js" buried deep in a folder structure that happens to have an "e" somewhere far up the chain.

I feel like a lot of the odd matches I get are of this form: the end of the query matches stuff in the filename, but stuff earlier in the query matches random characters from the rest of the path. I almost wonder if it would be better to require there to be a "/" in the search in order to match separate path segments.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Tuesday May 14, 2013 at 00:53 GMT


@njx I'd suggest just penalizing the score rather than filtering out completely. Sometimes what I remember as the filename turns out to be the folder name (happens especially often with code moved into extensions), and it's nice to still get results in that case.

@core-ai-bot
Copy link
Member Author

Comment by dangoor
Tuesday May 14, 2013 at 02:23 GMT


@njx I wouldn't want to have to explicitly add a "/", because I'll type things like "jschm" to get JavaScriptCodeHints/main.js.

The current algorithm does get some strange matches, but my concern has always just been to have the best at the top. I would not be opposed to penalizing strange matches and filtering out matches that are below some threshold if we want the list to look cleaner.

@core-ai-bot
Copy link
Member Author

Comment by njx
Tuesday May 14, 2013 at 17:33 GMT


Yup, I agree that penalizing cross-segment matches that don't have "/" in the query would be better than requiring "/".

@core-ai-bot
Copy link
Member Author

Comment by dangoor
Monday Mar 17, 2014 at 19:41 GMT


This should be fixed at the same time as #3971

@core-ai-bot
Copy link
Member Author

Comment by njx
Friday Apr 11, 2014 at 16:21 GMT


Reviewed, removing 1.0 milestone. Doesn't seem critical to improve the heuristics further right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant