[PATCH] D44882: [clangd] Implementation of workspace/symbol request

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 27 13:13:03 PDT 2018


MaskRay added a comment.

> Have you considered also allowing '.' and ' ' (space) as separators in the request? Having additional separators doesn't really hurt complexity of the implementation, but allows to switch between tools for different languages easier.

I would suggest allowing patterns containing space to match text without space, e.g. pattern `a b` can match text `aB`. The initial character of each word in the pattern should be seen as a `Head` position. This behavior matches many fuzzy matching plugins used in Emacs and Vim.



================
Comment at: clangd/SourceCode.cpp:110
+
+llvm::Optional<Location> offsetRangeToLocation(SourceManager &SourceMgr,
+                                               StringRef File,
----------------
May I ask a question about the conversion between SourceLocation and LSP location? When the document is slightly out of sync with the indexed version, what will be returned?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D44882





More information about the cfe-commits mailing list