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

Add fuzzy search to search by symbol #33746

Closed
imdadahad opened this issue Sep 3, 2017 · 16 comments
Closed

Add fuzzy search to search by symbol #33746

imdadahad opened this issue Sep 3, 2017 · 16 comments
Labels
*caused-by-extension Issue identified to be caused by an extension feature-request Request for new features or functionality quick-pick Quick-pick widget issues workspace-symbols

Comments

@imdadahad
Copy link

Currently on VSCode you can 'Open symbol by name' (https://code.visualstudio.com/docs/editor/editingevolved#_open-symbol-by-name) across files by clicking Cmd+T.

However it doesn't seem to support fuzzy search.

E.g. If I have a function called dao_get_bookings and search for dao (notice space at the end), it will not return any results. The space is counted strictly as a character meaning the search breaks down. This is a real shame as Sublime makes this effortless and frankly amazing for this use case.

@vscodebot vscodebot bot added the search Search widget and operation issues label Sep 3, 2017
@roblourens roblourens assigned jrieken and unassigned roblourens Sep 3, 2017
@roblourens roblourens removed the search Search widget and operation issues label Sep 3, 2017
@jrieken jrieken assigned bpasero and unassigned jrieken Sep 4, 2017
@bpasero bpasero added feature-request Request for new features or functionality quick-pick Quick-pick widget issues workspace-symbols workbench labels Sep 4, 2017
@bpasero bpasero removed their assignment Sep 4, 2017
@imdadahad
Copy link
Author

This is especially an issue for Python projects. It just doesn't work unfortunately.

@jrieken jrieken self-assigned this Oct 9, 2017
@bpasero bpasero removed the workbench label Nov 14, 2017
@imdadahad
Copy link
Author

Any idea when this will be actioned?

@jrieken jrieken assigned bpasero and unassigned jrieken Sep 10, 2018
@bpasero bpasero removed their assignment Sep 10, 2018
@star-szr
Copy link

Just want to echo that this feature is a big deal for users considering a switch from Sublime Text, and I haven't been able to find an extension that supports fuzzy symbol search. I use symbols very often and for me, it's the area I've found the most lacking overall in VS Code. Having a symbol (in this case a method) show up in Go to Symbol but not when I use Go to Definition (in the same file) is disappointing. I get the impression that Go to Symbol and Open symbol by name have completely different plumbing.

@eypsum
Copy link

eypsum commented Nov 1, 2018

I'm new with VS Code, I have used Sublime Text and Eclipse for a few years.
I use always the searching by symbol while work.
I noticed that takes some inaccurate results than Sublime Text in cases like below.

  1. symbols with Under and Upper case naming
    example 1)
    onSomeHandle()
    onAnotherSomeHandle()
    let search with words such as 'osh' using by ctrl+shift+o
    the result element list are:
    VS Code =>
    onAnotherSomeHandle()
    onSomeHandle()

Sublime Text=>
onSomeHandle()
onAnotherSomeHandle()

what I want is onSomeHandle().

example 2)
setDBook()
setDefineSome(bool)
onStoreDefineAddressBook()
let search with such as 'sdb'
the results :
VS Code =>
onStoreDefineAddressBook()
setDefineSome(bool)
setDBook()
Sublime Text =>
setDBook()
onStoreDefineAddressBook()
setDefineSome(bool)

what I want is setDBook()

  1. On the candidates list, It doesn't focus to the symbol in where the cursor is on editor when search box is invoked by ctrl+shift+o, it always get focus at the top element.
    Sublime Text focus to the symbol in which gets the cursor in editor.
    In my experience, It gets better convenient in Sublime Text.

@jahan01
Copy link

jahan01 commented Dec 10, 2018

also if I search as get_bookings to find dao_get_bookings it wouldnt work. The search string should begin exactly as the one you are trying to find. Sublime text fuzzy search can do find with all the following search terms.

  1. dao_
  2. get_bookings
  3. dgb
  4. gb
  5. doa_get_bookinsg (notice the mis-spellings)

Would love to have this in vscode as well, not just in symbol search, but everywhere including cmd+shift+p, cmd+p, cmd+shift+o etc.,

@eirikpre
Copy link

eirikpre commented Jan 9, 2019

I second this as well. Currently it is up to the extension developer to create the same fuzzy search as VSCode's Ctrl+P.

If the fuzzy search algorithm could be included in the extension API, a lot more extensions would use it. (Like mine!)
It does not need to have all the features of QuickOpen like history etc.

Right now I'm using RegExp search, but that is not as user friendly.

@monobot
Copy link

monobot commented Jan 26, 2019

Bump on this, any updates? Is it been considered at all?

@julian-poidevin
Copy link

I'm looking for that feature too, it exists in ATOM.

@lassefs
Copy link

lassefs commented Feb 7, 2019

+1
This feature would be very much appreciated by all former Sublime Text users.

@suan
Copy link

suan commented Apr 4, 2019

It's really unfortunate that doa_get_bookinsg in cmd+p doesn't find the dao_get_bookings file, and that one has to get the spelling exactly right without typos every time - run into this multiple times everyday 😞 😞

@Ciantic
Copy link

Ciantic commented Aug 7, 2019

I actually thought there is some technical problem, such as that each language server must implement their own fuzzy search for this to work. But since this is marked "quick-pick" probably the index is kept by the VSCode itself and it's just not plugged in like in quick outline?

@robclancy
Copy link

My main issue is simply using a space. It should be smart enough to know that a space can mean /. When I use other editors I often do a few letters for each folder with a space between them and get the file I want. In vscode I have to specifically use the / and no form of typo will work so the search needs to be exact for a lot of stuff and it's forever frustrating on a large codebase.

@jrieken
Copy link
Member

jrieken commented Oct 23, 2019

The sorting and ranking (in the UI) is actually using our fuzzy search logic but that only helps when the extension that provides the data uses a similar relaxed algorithm. In the jsdoc we have the following statement

  • The query-parameter should be interpreted in a relaxed way as the editor will apply its own highlighting and scoring on the results. A good rule of thumb is to match case-insensitive and to simply check that the characters of query appear in their order in a candidate symbol. Don't use prefix, substring, or similar strict matching.

There is not much more VS Code can do as it is only rendering results that extension providing. Therefore closing as 'caused by extension' and with a pretty please to file this in the context of each extension. Happy Coding

@jrieken jrieken added the *caused-by-extension Issue identified to be caused by an extension label Oct 23, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 23, 2019

This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the marketplace for VS Code. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Oct 23, 2019
@hmans
Copy link

hmans commented Oct 23, 2019

Thanks for the heads-up!

@jahan01
Copy link

jahan01 commented Oct 28, 2019

to those followed this for python language, there seems to be an issue filed here - microsoft/python-language-server#697.

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*caused-by-extension Issue identified to be caused by an extension feature-request Request for new features or functionality quick-pick Quick-pick widget issues workspace-symbols
Projects
None yet
Development

No branches or pull requests