editor: Use completion filter_range for fuzzy matching (#20869)

Fixes regression from #13958

Closes #20868

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-11-19 19:49:36 +01:00 committed by GitHub
parent 7853e32f80
commit 5c6565a9e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1036,7 +1036,12 @@ impl CompletionsMenu {
let match_candidates = completions let match_candidates = completions
.iter() .iter()
.enumerate() .enumerate()
.map(|(id, completion)| StringMatchCandidate::new(id, completion.label.text.clone())) .map(|(id, completion)| {
StringMatchCandidate::new(
id,
completion.label.text[completion.label.filter_range.clone()].into(),
)
})
.collect(); .collect();
Self { Self {