[PATCH] D44882: [clangd] Implementation of workspace/symbol request
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 30 09:49:45 PDT 2018
MaskRay added inline comments.
================
Comment at: clangd/FindSymbols.cpp:31
+
+ if (supportedSymbolKinds &&
+ std::find(supportedSymbolKinds->begin(), supportedSymbolKinds->end(),
----------------
malaperle wrote:
> MaskRay wrote:
> > This std::find loop adds some overhead to each candidate... In my experience the client usually doesn't care about the returned symbol kinds, they are used to give a category name. You can always patch the upstream to add missing categories.
> >
> > This is one instance where LSP is over specified. nvm I don't have strong opinion here
> I have a client that throws an exception when the symbolkind is not known and the whole request fails, so I think it's worth checking. But if it's too slow I can look at making it faster. Unfortunately, I cannot patch any upstream project :)
https://github.com/gluon-lang/languageserver-types/blob/master/src/lib.rs#L2016
LanguageClient-neovim returns empty candidate list if one of the candidates has unknown SymbolKind. Apparently they should be more tolerant and there is an issue tracking it.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D44882
More information about the cfe-commits
mailing list