@@ -119,7 +119,7 @@ impl Completion {
119 fn item_to_transaction(
119 fn item_to_transaction(
120 doc: &Document,
120 doc: &Document,
121 view_id: ViewId,
121 view_id: ViewId,
122− item: &CompletionItem,
122+ item: &lsp::CompletionItem,
123 offset_encoding: OffsetEncoding,
123 offset_encoding: OffsetEncoding,
124 trigger_offset: usize,
124 trigger_offset: usize,
125 include_placeholder: bool,
125 include_placeholder: bool,
@@ -130,7 +130,7 @@ impl Completion {
130 let text = doc.text().slice(..);
130 let text = doc.text().slice(..);
131 let primary_cursor = selection.primary().cursor(text);
131 let primary_cursor = selection.primary().cursor(text);
133− let (edit_offset, new_text) = if let Some(edit) = &item.item.text_edit {
133+ let (edit_offset, new_text) = if let Some(edit) = &item.text_edit {
134 let edit = match edit {
134 let edit = match edit {
135 lsp::CompletionTextEdit::Edit(edit) => edit.clone(),
135 lsp::CompletionTextEdit::Edit(edit) => edit.clone(),
136 lsp::CompletionTextEdit::InsertAndReplace(item) => {
136 lsp::CompletionTextEdit::InsertAndReplace(item) => {
@@ -153,10 +153,9 @@ impl Completion {
153 (Some((start_offset, end_offset)), edit.new_text)
153 (Some((start_offset, end_offset)), edit.new_text)
155 let new_text = item
155 let new_text = item
157 .insert_text
156 .insert_text
159− .unwrap_or_else(|| item.item.label.clone());
158+ .unwrap_or_else(|| item.label.clone());
160 // check that we are still at the correct savepoint
159 // check that we are still at the correct savepoint
161 // we can still generate a transaction regardless but if the
160 // we can still generate a transaction regardless but if the
162 // document changed (and not just the selection) then we will
161 // document changed (and not just the selection) then we will
@@ -165,9 +164,9 @@ impl Completion {
165 (None, new_text)
164 (None, new_text)
168− if matches!(item.item.kind, Some(lsp::CompletionItemKind::SNIPPET))
167+ if matches!(item.kind, Some(lsp::CompletionItemKind::SNIPPET))
169 || matches!(
168 || matches!(
170− item.item.insert_text_format,
169+ item.insert_text_format,
171 Some(lsp::InsertTextFormat::SNIPPET)
170 Some(lsp::InsertTextFormat::SNIPPET)
@@ -256,7 +255,7 @@ impl Completion {
256 let transaction = item_to_transaction(
255 let transaction = item_to_transaction(
259− item,
258+ &item.item,
260 language_server!(item).offset_encoding(),
259 language_server!(item).offset_encoding(),
261 trigger_offset,
260 trigger_offset,
@@ -294,7 +293,7 @@ impl Completion {
294 let transaction = item_to_transaction(
293 let transaction = item_to_transaction(
297− &item,
296+ &item.item,
298 offset_encoding,
297 offset_encoding,
299 trigger_offset,
298 trigger_offset,