@@ -3950,7 +3950,6 @@ pub fn completion(cx: &mut Context) {
3950 iter.reverse();
3950 iter.reverse();
3951 let offset = iter.take_while(|ch| chars::char_is_word(*ch)).count();
3951 let offset = iter.take_while(|ch| chars::char_is_word(*ch)).count();
3952 let start_offset = cursor.saturating_sub(offset);
3952 let start_offset = cursor.saturating_sub(offset);
3953− let prefix = text.slice(start_offset..cursor).to_string();
3955 cx.callback(
3954 cx.callback(
@@ -3960,7 +3959,7 @@ pub fn completion(cx: &mut Context) {
3963− let mut items = match response {
3962+ let items = match response {
3964 Some(lsp::CompletionResponse::Array(items)) => items,
3963 Some(lsp::CompletionResponse::Array(items)) => items,
3965 // TODO: do something with is_incomplete
3964 // TODO: do something with is_incomplete
3966 Some(lsp::CompletionResponse::List(lsp::CompletionList {
3965 Some(lsp::CompletionResponse::List(lsp::CompletionList {
@@ -3970,15 +3969,6 @@ pub fn completion(cx: &mut Context) {
3970 None => Vec::new(),
3969 None => Vec::new(),
3973− if !prefix.is_empty() {
3974− items.retain(|item| {
3977− .unwrap_or(&item.label)
3978− .starts_with(&prefix)
3982 if items.is_empty() {
3972 if items.is_empty() {
3983 // editor.set_error("No completion available");
3973 // editor.set_error("No completion available");