vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Allow "fuzzy" substring symbol search, similar to Go To File (CTRL+P) and Completion

Open sherryyshi opened this issue 7 years ago • 23 comments

Is it possible to support substring searching in Symbol Search, just like the way the search in Go to File (CTRL+P) works today?

sherryyshi avatar Oct 31 '18 23:10 sherryyshi

We already support substring search. Can you provide repro details where this is not working?

sean-mcmanus avatar Oct 31 '18 23:10 sean-mcmanus

For Go To File, you can type something like foobar and it would be able to find foo_baz_bar.cpp. However for Go To Symbol, that's not possible. Some of our users noted that the experience is inconsistent. They are big fans of the Go To File substring search, and would love to have the same feature for symbol search

sherryyshi avatar Nov 01 '18 00:11 sherryyshi

@sean-mcmanus, @sherryyshi is asking for "fuzzy" search (as we refer to it) like we have for completion, etc.

bobbrow avatar Nov 01 '18 05:11 bobbrow

Coming from Sublime, that would be a killer feature for me too.

StanBright avatar Mar 10 '19 20:03 StanBright

This is a killer feature and I miss this very much coming to VS Code from Source Insight.

sidhuhere avatar Nov 29 '19 10:11 sidhuhere

I don't think VS implements this either. I actually implemented this 8 months ago in response to https://github.com/microsoft/vscode-cpptools/issues/3416 (well, that was for completion instead of symbol search, but the code chang would be similar) , but after consulting the VS team I discovered that the addition of "*" wild cards to add the fuzziness was expected to have a major performance hit (for large databases), so I abandoned the change. However, I believe the PR change could be revived if we added an opt-in setting, which would allow users who really want the feature to get it (assuming they're okay with the performance...or maybe a separate "fuzzy go to symbol" command instead of a setting).

sean-mcmanus avatar Dec 03 '19 02:12 sean-mcmanus

Any update about this feature?

ppggff avatar Mar 17 '20 09:03 ppggff

@ppggff No updates. It's not on our schedule to get implemented (more upvotes needed).

sean-mcmanus avatar Mar 17 '20 18:03 sean-mcmanus

This feature request has received enough votes to be added to our backlog.

github-actions[bot] avatar Oct 17 '20 12:10 github-actions[bot]

Any plan about this feature in 2022?

ppggff avatar Jan 25 '22 06:01 ppggff

@ppggff Not yet. We're working on other features (clang-tidy integration, create definition from declaration, etc.). However, I think it'd be pretty quick for us to add an opt-in setting to enable it, and a few lines of code to implement (there's already a PR that implements this, but it was abandoned due to potential performance reduction).

sean-mcmanus avatar Jan 25 '22 13:01 sean-mcmanus

Any plans to fix this?

ppggff avatar May 17 '22 03:05 ppggff

@ppggff Same as 4 months ago, i.e. not currently.

sean-mcmanus avatar May 17 '22 03:05 sean-mcmanus

@sean-mcmanus I have a suggestion to implement this feature, But still not suffer from the performance penalty you mentioned with * & fuzzy search.

What if we ignore the * from the query when we try to compare with the results using fuzzy search ? The * will only be for the LSP queries to handle if they support wild card searches.

So a query sent to LS will look as follows Concurrent*Queue will return all symbols start with Concurrent and ends with Queue if the LS supports.

Then at vscode client side, We remove all * from the query and use ConcurrentQueue as the fuzzy search query which will also highlight the items which matched the LS query with wild card as it works in file search.

WDYT ?

gayanper avatar Aug 26 '22 11:08 gayanper

@gayanper I don't understand your suggestion. The only "*" usage is in the low level details of our implementation in cpptools and not at any higher level (user input or TypeScript).

sean-mcmanus avatar Aug 26 '22 19:08 sean-mcmanus

@sean-mcmanus i think my suggestion should goto vscode. When i made my suggestion I thought i was reading a vscode. But now i see its ccptools. Sorry

gayanper avatar Aug 27 '22 09:08 gayanper

Possibly related VS Code issue tickets: microsoft/vscode#33746 and microsoft/vscode#156865.

Possibly related Stack Overflow question: How can I search symbols with partial words in VS Code with IntelliSense?

starball5 avatar Feb 18 '23 23:02 starball5

@ppggff Not yet. We're working on other features (clang-tidy integration, create definition from declaration, etc.). However, I think it'd be pretty quick for us to add an opt-in setting to enable it, and a few lines of code to implement (there's already a PR that implements this, but it was abandoned due to potential performance reduction).

Hi @sean-mcmanus , one more year again and any plan to add the opt-in setting? In my opinion, this should be a high-priority feature

Shaka0723 avatar Mar 10 '23 06:03 Shaka0723

Does this change solve this requirement https://github.com/microsoft/vscode/pull/159377 ?

gayanper avatar Mar 10 '23 06:03 gayanper

I've filed a feature request on VS at https://developercommunity.visualstudio.com/t/Add-C-fuzzy-symbol-search/10306966 -- if VS adds that feature then we should get that as well. I've mentioned the upvotes on this issue, but upvoting that VS issue may help as well.

@gayanper I don't understand your PR.

sean-mcmanus avatar Mar 10 '23 19:03 sean-mcmanus

one more half year passed and any progress made? I am being suffered on lack of this feauture. Hope it can be merged asap

Shaka0723 avatar Sep 26 '23 00:09 Shaka0723

@Shaka0723 No progress yet. It's currently the 10th most upvoted feature request. We're currently working on the 1st most upvoted feature request. See https://github.com/Microsoft/vscode-cpptools/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+-label%3Adebugger .

sean-mcmanus avatar Sep 26 '23 01:09 sean-mcmanus

A significant update to Go To Symbol has been published in the insiders build - see https://github.com/microsoft/vscode-cpptools/issues/11557

fearthecowboy avatar Feb 13 '24 22:02 fearthecowboy