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

Marc-Andre Laperle via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 25 14:39:41 PDT 2018


malaperle created this revision.
Herald added subscribers: cfe-commits, MaskRay, ioeric, jkorous-apple, mgrang, ilya-biryukov, mgorny, klimek.

This is a basic implementation of the "workspace/symbol" request which is
used to find symbols by a string query. Since this is similar to code completion
in terms of result, this implementation reuses the "fuzzyFind" in order to get
matches. The index model was augmented to include more symbols like class
members so that those can also be found by fuzzyFind and therefore
workspace/symbol. Because fuzzyFind can now returns more results, a new option
flag is introduced to optionally narrow down results to only completion-matches;
this is how code completion can still behave the way it did before.

For now, results are sorted alphanumerically and improvements to scoring could
be done in the future.
Another further improvement would be to include symbols in anonymous namespaces.

Signed-off-by: Marc-Andre Laperle <marc-andre.laperle at ericsson.com>


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D44882

Files:
  clangd/CMakeLists.txt
  clangd/ClangdLSPServer.cpp
  clangd/ClangdLSPServer.h
  clangd/ClangdServer.cpp
  clangd/ClangdServer.h
  clangd/CodeComplete.cpp
  clangd/Protocol.cpp
  clangd/Protocol.h
  clangd/ProtocolHandlers.cpp
  clangd/ProtocolHandlers.h
  clangd/SourceCode.cpp
  clangd/SourceCode.h
  clangd/WorkspaceSymbols.cpp
  clangd/WorkspaceSymbols.h
  clangd/XRefs.cpp
  clangd/index/Index.h
  clangd/index/MemIndex.cpp
  clangd/index/SymbolCollector.cpp
  clangd/index/SymbolYAML.cpp
  clangd/tool/ClangdMain.cpp
  test/clangd/initialize-params-invalid.test
  test/clangd/initialize-params.test
  unittests/clangd/CMakeLists.txt
  unittests/clangd/CodeCompleteTests.cpp
  unittests/clangd/FileIndexTests.cpp
  unittests/clangd/SymbolCollectorTests.cpp
  unittests/clangd/SyncAPI.cpp
  unittests/clangd/SyncAPI.h
  unittests/clangd/WorkspaceSymbolsTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44882.139749.patch
Type: text/x-patch
Size: 65982 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180325/9cd836d2/attachment-0001.bin>


More information about the cfe-commits mailing list