rlivings39 / vscode-fzf-quick-open

vscode extension providing quick file/folder open and searching using fzf
MIT License
77 stars 17 forks source link

Searching with rg finds multiple duplicate results #33

Closed oren0e closed 2 years ago

oren0e commented 3 years ago

I have this weird behaviour that when I search for a term with rg with this extension I get multiple results that are basically the same, but somehow are separated by different column number of the cursor. See the screenshot provided.

In StudentController.java there is only one result for List<Student> at line 37, but it finds it multiple times - what's wrong? I do not pass any options to rg.

I identified the culprit: The way I like to search is not through the input box that opens up, rather, I press enter without entering any terms, and then search in the interactive panel that opens up in the terminal inside vscode. If I search with the input box, this problem is not occurring. I also found out that that the default command of rg has --vimgrep which actually might cause this behaviour as described in the man rg docs. Is there something I can do to search the way I want and not through the input box?

Screen Shot 2021-07-31 at 14 08 28
rlivings39 commented 3 years ago

The issue is that by entering no search term, rg is matching every character and giving you a location for each. If you enter .* in the search box, and then type in the interactive area, does that do what you want? If so, I could change the default of the extension to search for .*.

joshmu commented 2 years ago

This would be great if we could have .* set as default. I'm finding I'm always having to type this in

rlivings39 commented 2 years ago

Sounds good. I'll get this out this weekend...meetings and the like today.

oren0e commented 2 years ago

Sorry for the late reply, but yeah, this default will be much more convenient!

rlivings39 commented 2 years ago

Published in v0.4.5. Thanks for the suggestion!

joshmu commented 2 years ago

@rlivings39 one more wish list related to this! It would be great if we could create a keybinding to skip the command palette entry altogether since .* is now assigned. It would be one less step in the flow to searching and we could arrive straight to the fzf preview in the terminal. :)