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

Should we limit maximum amount of symbols returned by workspaceSymbomProvider? #1808

Closed
SirIntruder opened this issue Oct 25, 2017 · 7 comments
Milestone

Comments

@SirIntruder
Copy link

VS 17.2, c# 1.12, WIn 10

My current workspace has >30.000 symbols, which make vscode symbol search almost unusable.
Problem is that when search term is empty string, all symbols are returned, and vscode dropdown UI takes FOREVER with inserting 30.000 items in the dropdown UI.

I posted this issue to vscode repo:
microsoft/vscode#36941

I later saw somobody had a similar issue with vscode with IIRC PHP, half a year ago. Sombody said another language ext solved the issue by capping resulting symbol list, which makes sense since nobody wants to scroll in the dropdown with tens of thousands of elements - they will narrow down the search until item they are looking for appears close to the top.

Which you can't do in big workspaces currently, since search is so unresponsive.

Another thing to consider is to handle case when search term is empty string specifically, since that's the one that is causing most problems. Personaly, I quick fixed the problem for myself by just returning empty list when search terms are empty.

@SirIntruder SirIntruder changed the title Should we limit maximum amount of symbols return in workspaceSymbomProvider? Should we limit maximum amount of symbols returned by workspaceSymbomProvider? Oct 25, 2017
@rchande
Copy link

rchande commented Oct 27, 2017

@DustinCampbell Do you have a sense of whether people commonly use ctrl-t to bring up all of the symbols in their solution and browse the list without typing anything more? Currently, we return all of the symbols in no particular order, so this isn't an especially great experience. Could we simply not search if the search string is empty?

@rchande
Copy link

rchande commented Oct 27, 2017

We could also just choose a really small limit for the empty search string case.

@DustinCampbell
Copy link
Member

@rchande : I have no idea.

@DustinCampbell
Copy link
Member

Note that, in Visual Studio we don't produce a list until the first two characters are typed.

@SirIntruder
Copy link
Author

Capping resulting array before returning is kind of a must have currently, since vscode freezes completely when processing large array.

Not requesting all workspace symbol is also good IMHO, but not as critical, since it "only" takes a couple of seconds and is not a blocking call.

Anyway, if we want to fix this, it should be pretty symple, here is setup that worked for me:

    provideWorkspaceSymbols(search, token) {
	if (search == "") return null;
        return serverUtils.findSymbols(this._server, { Filter: search, FileName: '' }, token).then(res => {
            if (res && Array.isArray(res.QuickFixes)) {
                return res.QuickFixes.slice(0, 100).map(OmnisharpWorkspaceSymbolProvider._asSymbolInformation);
            }
        });
    }

btw, not that I could use symbol search I was going to report fuzzy search not finding "DummyController" when searching for "Controller", but it is fixed the same day in 13.0beta4, so kudos for that 😆

@filipw
Copy link
Contributor

filipw commented Oct 29, 2017

I think in this case the cap should be on the server side (perhaps the filter object can have a Limit property allowing the caller to set the cap) and it would benefit other OmniSharp clients too.

But yeah, I don't think it's reasonable to return hundreds of results

@akshita31
Copy link
Contributor

This is fixed by #2487

@akshita31 akshita31 added this to the 1.17 milestone Sep 23, 2018
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

5 participants