This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Make WorkspaceSymbols request work with empty queries
ClosedPublic

Authored by kadircet on Mar 2 2021, 7:49 AM.

Details

Summary

Clangd uses codecompletion limit as the limit for workspacesymbols, so
in theory this should only be an order of magnitude slower than a
codecompletion request with empty identifier (as code completion limits
the available symbols).

This is also what LSP suggests "Clients may send an empty string here to request all symbols.".
Clangd doesn't really fulfill the "all" part of that statement, but we
never do unless user set the index query limit to zero explicitly.

Fixes https://github.com/clangd/clangd/issues/707.

Diff Detail

Event Timeline

kadircet created this revision.Mar 2 2021, 7:49 AM
kadircet requested review of this revision.Mar 2 2021, 7:49 AM

I've asked on the bug for some more context for the request.
I don't see a problem with this change per se but I'm not sure it'll actually fix the bug.

sammccall accepted this revision.Mar 2 2021, 12:53 PM

LGTM

OK, I think we've established that the request was for a way to dump out clangd's whole index, and workspace/symbol isn't actually a good way to do that.
Nevertheless, this seems useful and endorsed by the spec.

https://reviews.llvm.org/D44882#inline-394499 was the original motivation for the special case, but it predates the spec text and things have probably changed.

This revision is now accepted and ready to land.Mar 2 2021, 12:53 PM