This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Use fuzzy match to select top N index results.
ClosedPublic

Authored by sammccall on Jan 15 2018, 4:10 AM.

Details

Summary

This makes performance slower but more predictable (it always processes
every symbol). We need to find ways to make this fast, possibly by precomputing
short queries or capping the number of scored results. But our current approach
is too naive.

It also no longer returns results in a "good" order. In fact it's pathological:
the top N results are ranked from worst to best. Indexes aren't responsible for
ranking and MergedIndex can't do a good job, so I'm pleased that this will make
any hidden assumptions we have more noticeable :-)

Event Timeline

sammccall created this revision.Jan 15 2018, 4:10 AM
hokein accepted this revision.Jan 15 2018, 7:31 AM

LGTM.

clangd/index/MemIndex.cpp
60

this should be more?

This revision is now accepted and ready to land.Jan 15 2018, 7:31 AM
This revision was automatically updated to reflect the committed changes.
sammccall marked an inline comment as done.