[PATCH] D39882: [clangd] Filter completion results by fuzzy-matching identifiers.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 23 01:02:53 PST 2017


sammccall added a comment.

In https://reviews.llvm.org/D39882#932858, @ilya-biryukov wrote:

> We definitely need to:
>
> - Rebase this change on top of current head (to account for limits and scoring)


Done. There's very little interaction - for now the match doesn't affect scoring, we're just shifting work from the client to the server.

> - Set `incomplete=true` for fuzzy-matched completion results

Why? If you complete "foo.b^" then "qux" isn't a valid result. Clients *must* requery when erasing anyway, regardless of isIncomplete - it's only "further typing" that can reuse the result set.

> Maybe also make fuzzy-matching configurable via a flag? Off-by-default for now, so we could start testing it before we finish optimizing single-identifier edits. When we have it, enable fuzzy-matching by default.

Why?
I don't think it makes sense to put this behind a flag, unless we're just worried the code is buggy. I'm already concerned about the proliferation of flags for features users *might* care about, this one either works or it doesn't.
This patch just says "don't return qux() if the user presses ctrl-space after foo.b". It doesn't affect the existing behavior when user types "foo." - we'll still request completion, the filter will be empty. And this patch doesn't affect ranking.


https://reviews.llvm.org/D39882





More information about the cfe-commits mailing list