assistant2: Fix filtering issue when using @mention completion provider (#27541)
Previously `src` would not show up because it was filtered out: <img width="466" alt="image" src="https://github.com/user-attachments/assets/f3802660-ad73-44be-967d-c332466d9aba" /> Release Notes: - N/A
This commit is contained in:
parent
9e02fee98d
commit
2b5095ac91
2 changed files with 21 additions and 2 deletions
|
@ -544,6 +544,10 @@ impl CompletionProvider for ContextPickerCompletionProvider {
|
|||
fn sort_completions(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn filter_completions(&self) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
fn confirm_completion_callback(
|
||||
|
|
|
@ -4326,6 +4326,10 @@ impl Editor {
|
|||
.as_ref()
|
||||
.map_or(true, |provider| provider.sort_completions());
|
||||
|
||||
let filter_completions = provider
|
||||
.as_ref()
|
||||
.map_or(true, |provider| provider.filter_completions());
|
||||
|
||||
let id = post_inc(&mut self.next_completion_id);
|
||||
let task = cx.spawn_in(window, async move |editor, cx| {
|
||||
async move {
|
||||
|
@ -4374,8 +4378,15 @@ impl Editor {
|
|||
completions.into(),
|
||||
);
|
||||
|
||||
menu.filter(query.as_deref(), cx.background_executor().clone())
|
||||
.await;
|
||||
menu.filter(
|
||||
if filter_completions {
|
||||
query.as_deref()
|
||||
} else {
|
||||
None
|
||||
},
|
||||
cx.background_executor().clone(),
|
||||
)
|
||||
.await;
|
||||
|
||||
menu.visible().then_some(menu)
|
||||
};
|
||||
|
@ -18041,6 +18052,10 @@ pub trait CompletionProvider {
|
|||
fn sort_completions(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn filter_completions(&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
pub trait CodeActionProvider {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue