Add default method for CompletionProvider::resolve_completions
(#32045)
Release Notes: - N/A
This commit is contained in:
parent
894f3b9d15
commit
03a030fd00
6 changed files with 11 additions and 65 deletions
|
@ -15,7 +15,6 @@ use language::{
|
|||
use project::{Completion, CompletionResponse, CompletionSource, search::SearchQuery};
|
||||
use settings::Settings;
|
||||
use std::{
|
||||
cell::RefCell,
|
||||
ops::Range,
|
||||
rc::Rc,
|
||||
sync::{Arc, LazyLock},
|
||||
|
@ -73,16 +72,6 @@ impl CompletionProvider for MessageEditorCompletionProvider {
|
|||
})
|
||||
}
|
||||
|
||||
fn resolve_completions(
|
||||
&self,
|
||||
_buffer: Entity<Buffer>,
|
||||
_completion_indices: Vec<usize>,
|
||||
_completions: Rc<RefCell<Box<[Completion]>>>,
|
||||
_cx: &mut Context<Editor>,
|
||||
) -> Task<anyhow::Result<bool>> {
|
||||
Task::ready(Ok(false))
|
||||
}
|
||||
|
||||
fn is_completion_trigger(
|
||||
&self,
|
||||
_buffer: &Entity<Buffer>,
|
||||
|
@ -255,7 +244,7 @@ impl MessageEditor {
|
|||
{
|
||||
if !candidates.is_empty() {
|
||||
return cx.spawn(async move |_, cx| {
|
||||
let completion_response = Self::resolve_completions_for_candidates(
|
||||
let completion_response = Self::completions_for_candidates(
|
||||
&cx,
|
||||
query.as_str(),
|
||||
&candidates,
|
||||
|
@ -273,7 +262,7 @@ impl MessageEditor {
|
|||
{
|
||||
if !candidates.is_empty() {
|
||||
return cx.spawn(async move |_, cx| {
|
||||
let completion_response = Self::resolve_completions_for_candidates(
|
||||
let completion_response = Self::completions_for_candidates(
|
||||
&cx,
|
||||
query.as_str(),
|
||||
candidates,
|
||||
|
@ -292,7 +281,7 @@ impl MessageEditor {
|
|||
}]))
|
||||
}
|
||||
|
||||
async fn resolve_completions_for_candidates(
|
||||
async fn completions_for_candidates(
|
||||
cx: &AsyncApp,
|
||||
query: &str,
|
||||
candidates: &[StringMatchCandidate],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue