]> git.lizzy.rs Git - rust.git/commitdiff
Merge #6010
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Tue, 15 Sep 2020 20:15:04 +0000 (20:15 +0000)
committerGitHub <noreply@github.com>
Tue, 15 Sep 2020 20:15:04 +0000 (20:15 +0000)
6010: Avoid checking all ancestors and fix mis-completion r=jonas-schievink a=oxalica

Refactor the logic of `completion_match` to check deterministic number of ancestors instead of `token.ancestors().find_map()`.
This should fix wrong completions (https://github.com/rust-analyzer/rust-analyzer/pull/5976#issuecomment-692332191) and hopefully make completion to be faster (#6004).

More play and test? @jonas-schievink @hammypants

If this patch works, we can avoid the revert #6005 . :disappointed:

Co-authored-by: oxalica <oxalicc@pm.me>

Trivial merge