[PATCH] D39836: [clangd] Drop impossible completions (unavailable or inaccessible)

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 9 08:45:38 PST 2017

sammccall added a comment.

So I probably should have started from the other end, here :-)

I'd really like to make the completion retrieval and ranking more flexible. In particular

- incorporating results from other sources (indexes: both in-memory and external services).
- combining more quality signals like usage count and fuzzy-match-strength in a non-lexicographic-sort way

The biggest difficulty in *supporting* unusable functions is maintaining the invariant that all unusable functions are ranked lower than usable ones - all code that deals with ranking has to deal with this special case, e.g. by making score a tuple instead of a single number.

If the current approach of "give them a penalty" is enough, knowing that in the future it may lead to e.g. a very widely used but inaccessible protected function being ranked highly, then that seems fine to me too. A wider configuration space means testing is more work, but happy to live with it. What do you think?

(With my user-hat on, configurable is fine, though I do strongly feel they should be off by default, and it seems unlikely many users will change the defaults.)


More information about the cfe-commits mailing list