From 5c6565a9e0d164c5c91f0820aa7da97da23aede3 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Tue, 19 Nov 2024 19:49:36 +0100 Subject: [PATCH] editor: Use completion filter_range for fuzzy matching (#20869) Fixes regression from #13958 Closes #20868 Release Notes: - N/A --- crates/editor/src/editor.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 6167c24bff4455..d303ecf0f39982 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -1036,7 +1036,12 @@ impl CompletionsMenu { let match_candidates = completions .iter() .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(); Self {