This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Make workspace/symbols actually rank its results.
ClosedPublic

Authored by sammccall on Jun 6 2018, 5:17 AM.

Event Timeline

sammccall created this revision.Jun 6 2018, 5:17 AM
hokein accepted this revision.Jun 6 2018, 8:10 AM

LGTM.

clangd/FindSymbols.cpp
159

Should we add a log statement here? IMO, this rarely happens? If it happens, it means that the fuzzy matcher algorithms used by index and clangd side have disagreement.

This revision is now accepted and ready to land.Jun 6 2018, 8:10 AM

This works much better! Just a nit.

clangd/FindSymbols.cpp
20

nit: I don't think this is used. Remove?

sammccall added inline comments.Jun 6 2018, 11:50 PM
clangd/FindSymbols.cpp
20

This is consumed by the LLVM_DEBUG macro. You can enable program-wide debug output with -debug, but much more useful is -debug-only=somestring which will only enable LLVM_DEBUG sections in files with the matching DEBUG_TYPE.

So here if you get mysterious ranking of workspace/symbol results, you can run clangd with -debug-only=FindSymbols and get the signals and component scores dumped to stderr.

sammccall marked an inline comment as done.Jun 6 2018, 11:53 PM
This revision was automatically updated to reflect the committed changes.