From 2a43638052213d1faa690e6d68bd5702e44fa027 Mon Sep 17 00:00:00 2001 From: gfreezy Date: Sun, 20 Jan 2019 12:02:00 +0800 Subject: use a combination of `source_change` and `text_edit` for `CompleteItem` --- crates/ra_ide_api/src/completion/complete_dot.rs | 14 ++++++---- .../ra_ide_api/src/completion/complete_fn_param.rs | 2 +- .../ra_ide_api/src/completion/complete_keyword.rs | 14 +++++----- crates/ra_ide_api/src/completion/complete_path.rs | 4 +-- crates/ra_ide_api/src/completion/complete_scope.rs | 4 +-- .../ra_ide_api/src/completion/complete_snippet.rs | 2 +- .../src/completion/completion_context.rs | 5 +++- .../ra_ide_api/src/completion/completion_item.rs | 30 +++++++++++++--------- .../completion_item__bindings_from_for.snap | 10 ++++---- .../completion_item__bindings_from_if_let.snap | 14 +++++----- .../completion_item__bindings_from_let.snap | 14 +++++----- ...em__completes_break_and_continue_in_loops1.snap | 30 +++++++++++----------- ...em__completes_break_and_continue_in_loops2.snap | 22 ++++++++-------- .../completion_item__deeply_nested_use_tree.snap | 6 ++--- ...t_add_semi_after_return_if_not_a_statement.snap | 22 ++++++++-------- ...ont_render_function_parens_if_already_call.snap | 10 ++++---- ...m__dont_render_function_parens_in_use_item.snap | 6 ++--- ...__dont_show_both_completions_for_shadowing.snap | 10 ++++---- ...n_item__inserts_parens_for_function_calls1.snap | 10 ++++---- ...n_item__inserts_parens_for_function_calls2.snap | 10 ++++---- .../completion_item__keywords_in_function1.snap | 22 ++++++++-------- .../completion_item__keywords_in_function2.snap | 30 +++++++++++----------- .../completion_item__keywords_in_function3.snap | 22 ++++++++-------- .../completion_item__keywords_in_function4.snap | 22 ++++++++-------- .../completion_item__keywords_in_use_stmt1.snap | 14 +++++----- .../completion_item__keywords_in_use_stmt2.snap | 10 ++++---- .../completion_item__keywords_in_use_stmt3.snap | 10 ++++---- ...etion_item__last_return_in_block_has_semi1.snap | 22 ++++++++-------- ...etion_item__last_return_in_block_has_semi2.snap | 22 ++++++++-------- .../completion_item__method_completion.snap | 6 ++--- .../snapshots/completion_item__module_items.snap | 14 +++++----- ...etion_item__module_items_in_nested_modules.snap | 10 ++++---- .../completion_item__nested_use_tree.snap | 10 ++++---- ...item__no_semi_after_break_continue_in_expr.snap | 30 +++++++++++----------- ...mpletion_item__param_completion_last_param.snap | 6 ++--- ...ompletion_item__param_completion_nth_param.snap | 6 ++--- ...pletion_item__param_completion_trait_param.snap | 6 ++--- .../completion_item__reference_completion.snap | 10 ++++---- .../snapshots/completion_item__return_type.snap | 10 ++++---- .../completion_item__self_in_methods.snap | 6 ++--- .../completion_item__snippets_in_expressions.snap | 10 ++++---- .../completion_item__snippets_in_items.snap | 10 ++++---- .../completion_item__struct_field_completion.snap | 6 ++--- ...on_item__struct_field_completion_autoderef.snap | 10 ++++---- ...pletion_item__struct_field_completion_self.snap | 10 ++++---- ...pletion_item__use_item_starting_with_crate.snap | 10 ++++---- ...mpletion_item__use_item_starting_with_self.snap | 6 ++--- crates/ra_lsp_server/src/conv.rs | 11 +++----- 48 files changed, 305 insertions(+), 295 deletions(-) (limited to 'crates') diff --git a/crates/ra_ide_api/src/completion/complete_dot.rs b/crates/ra_ide_api/src/completion/complete_dot.rs index e1c0d26c7..fb8b2fc88 100644 --- a/crates/ra_ide_api/src/completion/complete_dot.rs +++ b/crates/ra_ide_api/src/completion/complete_dot.rs @@ -31,7 +31,7 @@ fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) for field in s.fields(ctx.db) { CompletionItem::new( CompletionKind::Reference, - ctx.leaf_range(), + ctx.source_range(), field.name().to_string(), ) .kind(CompletionItemKind::Field) @@ -45,9 +45,13 @@ fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) } Ty::Tuple(fields) => { for (i, _ty) in fields.iter().enumerate() { - CompletionItem::new(CompletionKind::Reference, ctx.leaf_range(), i.to_string()) - .kind(CompletionItemKind::Field) - .add_to(acc); + CompletionItem::new( + CompletionKind::Reference, + ctx.source_range(), + i.to_string(), + ) + .kind(CompletionItemKind::Field) + .add_to(acc); } } _ => {} @@ -61,7 +65,7 @@ fn complete_methods(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty if sig.has_self_param() { CompletionItem::new( CompletionKind::Reference, - ctx.leaf_range(), + ctx.source_range(), sig.name().to_string(), ) .from_function(ctx, func) diff --git a/crates/ra_ide_api/src/completion/complete_fn_param.rs b/crates/ra_ide_api/src/completion/complete_fn_param.rs index c3e3ea931..8d4df4ea1 100644 --- a/crates/ra_ide_api/src/completion/complete_fn_param.rs +++ b/crates/ra_ide_api/src/completion/complete_fn_param.rs @@ -34,7 +34,7 @@ pub(super) fn complete_fn_param(acc: &mut Completions, ctx: &CompletionContext) } }) .for_each(|(label, lookup)| { - CompletionItem::new(CompletionKind::Magic, ctx.leaf_range(), label) + CompletionItem::new(CompletionKind::Magic, ctx.source_range(), label) .lookup_by(lookup) .add_to(acc) }); diff --git a/crates/ra_ide_api/src/completion/complete_keyword.rs b/crates/ra_ide_api/src/completion/complete_keyword.rs index 006b20076..10ae01bc5 100644 --- a/crates/ra_ide_api/src/completion/complete_keyword.rs +++ b/crates/ra_ide_api/src/completion/complete_keyword.rs @@ -9,26 +9,26 @@ use crate::completion::{CompletionContext, CompletionItem, Completions, Completi pub(super) fn complete_use_tree_keyword(acc: &mut Completions, ctx: &CompletionContext) { // complete keyword "crate" in use stmt - let leaf_range = ctx.leaf_range(); + let source_range = ctx.source_range(); match (ctx.use_item_syntax.as_ref(), ctx.path_prefix.as_ref()) { (Some(_), None) => { - CompletionItem::new(CompletionKind::Keyword, leaf_range, "crate") + CompletionItem::new(CompletionKind::Keyword, source_range, "crate") .kind(CompletionItemKind::Keyword) .insert_text("crate::") .add_to(acc); - CompletionItem::new(CompletionKind::Keyword, leaf_range, "self") + CompletionItem::new(CompletionKind::Keyword, source_range, "self") .kind(CompletionItemKind::Keyword) .add_to(acc); - CompletionItem::new(CompletionKind::Keyword, leaf_range, "super") + CompletionItem::new(CompletionKind::Keyword, source_range, "super") .kind(CompletionItemKind::Keyword) .insert_text("super::") .add_to(acc); } (Some(_), Some(_)) => { - CompletionItem::new(CompletionKind::Keyword, leaf_range, "self") + CompletionItem::new(CompletionKind::Keyword, source_range, "self") .kind(CompletionItemKind::Keyword) .add_to(acc); - CompletionItem::new(CompletionKind::Keyword, leaf_range, "super") + CompletionItem::new(CompletionKind::Keyword, source_range, "super") .kind(CompletionItemKind::Keyword) .insert_text("super::") .add_to(acc); @@ -38,7 +38,7 @@ pub(super) fn complete_use_tree_keyword(acc: &mut Completions, ctx: &CompletionC } fn keyword(ctx: &CompletionContext, kw: &str, snippet: &str) -> CompletionItem { - CompletionItem::new(CompletionKind::Keyword, ctx.leaf_range(), kw) + CompletionItem::new(CompletionKind::Keyword, ctx.source_range(), kw) .kind(CompletionItemKind::Keyword) .snippet(snippet) .build() diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs index 513a2ee89..804954ee1 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide_api/src/completion/complete_path.rs @@ -17,7 +17,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { for (name, res) in module_scope.entries() { CompletionItem::new( CompletionKind::Reference, - ctx.leaf_range(), + ctx.source_range(), name.to_string(), ) .from_resolution(ctx, res) @@ -30,7 +30,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { .for_each(|(variant_name, _variant)| { CompletionItem::new( CompletionKind::Reference, - ctx.leaf_range(), + ctx.source_range(), variant_name.to_string(), ) .kind(CompletionItemKind::EnumVariant) diff --git a/crates/ra_ide_api/src/completion/complete_scope.rs b/crates/ra_ide_api/src/completion/complete_scope.rs index 958a12f22..20fc77f06 100644 --- a/crates/ra_ide_api/src/completion/complete_scope.rs +++ b/crates/ra_ide_api/src/completion/complete_scope.rs @@ -31,7 +31,7 @@ pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) { .for_each(|(name, res)| { CompletionItem::new( CompletionKind::Reference, - ctx.leaf_range(), + ctx.source_range(), name.to_string(), ) .from_resolution(ctx, res) @@ -52,7 +52,7 @@ fn complete_fn( .for_each(|entry| { CompletionItem::new( CompletionKind::Reference, - ctx.leaf_range(), + ctx.source_range(), entry.name().to_string(), ) .kind(CompletionItemKind::Binding) diff --git a/crates/ra_ide_api/src/completion/complete_snippet.rs b/crates/ra_ide_api/src/completion/complete_snippet.rs index 4fa23bbf6..d3344b865 100644 --- a/crates/ra_ide_api/src/completion/complete_snippet.rs +++ b/crates/ra_ide_api/src/completion/complete_snippet.rs @@ -1,7 +1,7 @@ use crate::completion::{CompletionItem, Completions, CompletionKind, CompletionItemKind, CompletionContext, completion_item::Builder}; fn snippet(ctx: &CompletionContext, label: &str, snippet: &str) -> Builder { - CompletionItem::new(CompletionKind::Snippet, ctx.leaf_range(), label) + CompletionItem::new(CompletionKind::Snippet, ctx.source_range(), label) .snippet(snippet) .kind(CompletionItemKind::Snippet) } diff --git a/crates/ra_ide_api/src/completion/completion_context.rs b/crates/ra_ide_api/src/completion/completion_context.rs index de9b95c81..fd4cfc944 100644 --- a/crates/ra_ide_api/src/completion/completion_context.rs +++ b/crates/ra_ide_api/src/completion/completion_context.rs @@ -65,7 +65,10 @@ impl<'a> CompletionContext<'a> { Some(ctx) } - pub(crate) fn leaf_range(&self) -> TextRange { + // The range of the identifier that is being completed. + // This is purely advisory and can be used, for example, to highlight this range in the editor. + // Clients are expected to ignore this field. + pub(crate) fn source_range(&self) -> TextRange { self.leaf.range() } diff --git a/crates/ra_ide_api/src/completion/completion_item.rs b/crates/ra_ide_api/src/completion/completion_item.rs index da8da94d1..f46d9e581 100644 --- a/crates/ra_ide_api/src/completion/completion_item.rs +++ b/crates/ra_ide_api/src/completion/completion_item.rs @@ -2,6 +2,7 @@ use hir::PerNs; use crate::completion::completion_context::CompletionContext; use ra_syntax::TextRange; +use ra_text_edit::TextEdit; /// `CompletionItem` describes a single completion variant in the editor pop-up. /// It is basically a POD with various properties. To construct a @@ -17,8 +18,8 @@ pub struct CompletionItem { lookup: Option, insert_text: Option, insert_text_format: InsertTextFormat, - replace_range: TextRange, - delete_range: Option, + source_range: TextRange, + text_edit: Option, } #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -64,7 +65,7 @@ impl CompletionItem { ) -> Builder { let label = label.into(); Builder { - replace_range, + source_range: replace_range, completion_kind, label, insert_text: None, @@ -72,7 +73,7 @@ impl CompletionItem { detail: None, lookup: None, kind: None, - delete_range: None, + text_edit: None, } } /// What user sees in pop-up in the UI. @@ -103,18 +104,18 @@ impl CompletionItem { pub fn kind(&self) -> Option { self.kind } - pub fn delete_range(&self) -> Option { - self.delete_range + pub fn take_text_edit(&mut self) -> Option { + self.text_edit.take() } - pub fn replace_range(&self) -> TextRange { - self.replace_range + pub fn source_range(&self) -> TextRange { + self.source_range } } /// A helper to make `CompletionItem`s. #[must_use] pub(crate) struct Builder { - replace_range: TextRange, + source_range: TextRange, completion_kind: CompletionKind, label: String, insert_text: Option, @@ -122,7 +123,7 @@ pub(crate) struct Builder { detail: Option, lookup: Option, kind: Option, - delete_range: Option, + text_edit: Option, } impl Builder { @@ -132,14 +133,14 @@ impl Builder { pub(crate) fn build(self) -> CompletionItem { CompletionItem { - replace_range: self.replace_range, + source_range: self.source_range, label: self.label, detail: self.detail, insert_text_format: self.insert_text_format, lookup: self.lookup, kind: self.kind, completion_kind: self.completion_kind, - delete_range: self.delete_range, + text_edit: self.text_edit, insert_text: self.insert_text, } } @@ -165,6 +166,11 @@ impl Builder { self } #[allow(unused)] + pub(crate) fn text_edit(mut self, edit: TextEdit) -> Builder { + self.text_edit = Some(edit); + self + } + #[allow(unused)] pub(crate) fn detail(self, detail: impl Into) -> Builder { self.set_detail(Some(detail)) } diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_for.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_for.snap index ff8646ab2..132048d9c 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_for.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_for.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.674785+00:00 +Created: 2019-01-20T04:00:48.241096+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,8 +13,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [62; 100), - delete_range: None + source_range: [62; 100), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -28,7 +28,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "quux()$0" ), insert_text_format: Snippet, - replace_range: [62; 100), - delete_range: None + source_range: [62; 100), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_if_let.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_if_let.snap index 2176af32d..e7b628f19 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_if_let.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_if_let.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.676585+00:00 +Created: 2019-01-20T04:00:48.242456+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,8 +13,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [213; 231), - delete_range: None + source_range: [213; 231), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -26,8 +26,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [213; 231), - delete_range: None + source_range: [213; 231), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -41,7 +41,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "quux()$0" ), insert_text_format: Snippet, - replace_range: [213; 231), - delete_range: None + source_range: [213; 231), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_let.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_let.snap index 49745745d..403fe0c4c 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_let.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__bindings_from_let.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.676674+00:00 +Created: 2019-01-20T04:00:48.243016+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,8 +13,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [78; 79), - delete_range: None + source_range: [78; 79), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -26,8 +26,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [78; 79), - delete_range: None + source_range: [78; 79), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -41,7 +41,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "quux($0)" ), insert_text_format: Snippet, - replace_range: [78; 79), - delete_range: None + source_range: [78; 79), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops1.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops1.snap index c8a0a78aa..413960191 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops1.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops1.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.630898+00:00 +Created: 2019-01-20T04:00:48.206357+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "if $0 {}" ), insert_text_format: Snippet, - replace_range: [54; 56), - delete_range: None + source_range: [54; 56), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -30,8 +30,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "match $0 {}" ), insert_text_format: Snippet, - replace_range: [54; 56), - delete_range: None + source_range: [54; 56), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -45,8 +45,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "while $0 {}" ), insert_text_format: Snippet, - replace_range: [54; 56), - delete_range: None + source_range: [54; 56), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -60,8 +60,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "loop {$0}" ), insert_text_format: Snippet, - replace_range: [54; 56), - delete_range: None + source_range: [54; 56), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -75,8 +75,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "continue;" ), insert_text_format: Snippet, - replace_range: [54; 56), - delete_range: None + source_range: [54; 56), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -90,8 +90,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "break;" ), insert_text_format: Snippet, - replace_range: [54; 56), - delete_range: None + source_range: [54; 56), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -105,7 +105,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "return $0;" ), insert_text_format: Snippet, - replace_range: [54; 56), - delete_range: None + source_range: [54; 56), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops2.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops2.snap index 707021e21..dc2fc95e3 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops2.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops2.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.647435+00:00 +Created: 2019-01-20T04:00:48.217822+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "if $0 {}" ), insert_text_format: Snippet, - replace_range: [59; 61), - delete_range: None + source_range: [59; 61), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -30,8 +30,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "match $0 {}" ), insert_text_format: Snippet, - replace_range: [59; 61), - delete_range: None + source_range: [59; 61), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -45,8 +45,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "while $0 {}" ), insert_text_format: Snippet, - replace_range: [59; 61), - delete_range: None + source_range: [59; 61), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -60,8 +60,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "loop {$0}" ), insert_text_format: Snippet, - replace_range: [59; 61), - delete_range: None + source_range: [59; 61), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -75,7 +75,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "return $0;" ), insert_text_format: Snippet, - replace_range: [59; 61), - delete_range: None + source_range: [59; 61), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__deeply_nested_use_tree.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__deeply_nested_use_tree.snap index a65ab3cc0..26ca18933 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__deeply_nested_use_tree.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__deeply_nested_use_tree.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.649286+00:00 +Created: 2019-01-20T04:00:48.217724+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,7 +13,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [23; 25), - delete_range: None + source_range: [23; 25), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_add_semi_after_return_if_not_a_statement.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_add_semi_after_return_if_not_a_statement.snap index a935b06f4..f5ae8c29f 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_add_semi_after_return_if_not_a_statement.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_add_semi_after_return_if_not_a_statement.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.640573+00:00 +Created: 2019-01-20T04:00:48.208392+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "if $0 {}" ), insert_text_format: Snippet, - replace_range: [84; 102), - delete_range: None + source_range: [84; 102), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -30,8 +30,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "match $0 {}" ), insert_text_format: Snippet, - replace_range: [84; 102), - delete_range: None + source_range: [84; 102), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -45,8 +45,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "while $0 {}" ), insert_text_format: Snippet, - replace_range: [84; 102), - delete_range: None + source_range: [84; 102), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -60,8 +60,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "loop {$0}" ), insert_text_format: Snippet, - replace_range: [84; 102), - delete_range: None + source_range: [84; 102), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -75,7 +75,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "return $0" ), insert_text_format: Snippet, - replace_range: [84; 102), - delete_range: None + source_range: [84; 102), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_if_already_call.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_if_already_call.snap index abc01d4d6..88c9287fd 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_if_already_call.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_if_already_call.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.670539+00:00 +Created: 2019-01-20T04:00:48.239872+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,8 +13,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [35; 39), - delete_range: None + source_range: [35; 39), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -26,7 +26,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [35; 39), - delete_range: None + source_range: [35; 39), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_in_use_item.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_in_use_item.snap index 2d3234b2c..33286e68b 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_in_use_item.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_render_function_parens_in_use_item.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.671764+00:00 +Created: 2019-01-20T04:00:48.239894+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,7 +13,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [40; 41), - delete_range: None + source_range: [40; 41), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_show_both_completions_for_shadowing.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_show_both_completions_for_shadowing.snap index 6e4817d1a..2db0eb755 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_show_both_completions_for_shadowing.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_show_both_completions_for_shadowing.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.680378+00:00 +Created: 2019-01-20T04:00:48.248606+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,8 +13,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [108; 146), - delete_range: None + source_range: [108; 146), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -28,7 +28,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "foo()$0" ), insert_text_format: Snippet, - replace_range: [108; 146), - delete_range: None + source_range: [108; 146), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls1.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls1.snap index 4ec75e2ca..7ae216cd2 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls1.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls1.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.681170+00:00 +Created: 2019-01-20T04:00:48.249349+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "no_args()$0" ), insert_text_format: Snippet, - replace_range: [53; 56), - delete_range: None + source_range: [53; 56), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -30,7 +30,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "main()$0" ), insert_text_format: Snippet, - replace_range: [53; 56), - delete_range: None + source_range: [53; 56), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls2.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls2.snap index 11a8f1757..231d75d7a 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls2.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__inserts_parens_for_function_calls2.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.686781+00:00 +Created: 2019-01-20T04:00:48.255317+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "main()$0" ), insert_text_format: Snippet, - replace_range: [72; 77), - delete_range: None + source_range: [72; 77), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -30,7 +30,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "with_args($0)" ), insert_text_format: Snippet, - replace_range: [72; 77), - delete_range: None + source_range: [72; 77), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function1.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function1.snap index 02e88a96e..4d309b20e 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function1.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function1.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.640068+00:00 +Created: 2019-01-20T04:00:48.207728+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "if $0 {}" ), insert_text_format: Snippet, - replace_range: [24; 54), - delete_range: None + source_range: [24; 54), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -30,8 +30,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "match $0 {}" ), insert_text_format: Snippet, - replace_range: [24; 54), - delete_range: None + source_range: [24; 54), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -45,8 +45,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "while $0 {}" ), insert_text_format: Snippet, - replace_range: [24; 54), - delete_range: None + source_range: [24; 54), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -60,8 +60,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "loop {$0}" ), insert_text_format: Snippet, - replace_range: [24; 54), - delete_range: None + source_range: [24; 54), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -75,7 +75,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "return;" ), insert_text_format: Snippet, - replace_range: [24; 54), - delete_range: None + source_range: [24; 54), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function2.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function2.snap index 41dc288f6..0f1e66ac3 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function2.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function2.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.640134+00:00 +Created: 2019-01-20T04:00:48.207381+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "if $0 {}" ), insert_text_format: Snippet, - replace_range: [91; 105), - delete_range: None + source_range: [91; 105), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -30,8 +30,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "match $0 {}" ), insert_text_format: Snippet, - replace_range: [91; 105), - delete_range: None + source_range: [91; 105), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -45,8 +45,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "while $0 {}" ), insert_text_format: Snippet, - replace_range: [91; 105), - delete_range: None + source_range: [91; 105), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -60,8 +60,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "loop {$0}" ), insert_text_format: Snippet, - replace_range: [91; 105), - delete_range: None + source_range: [91; 105), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -75,8 +75,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "else {$0}" ), insert_text_format: Snippet, - replace_range: [91; 105), - delete_range: None + source_range: [91; 105), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -90,8 +90,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "else if $0 {}" ), insert_text_format: Snippet, - replace_range: [91; 105), - delete_range: None + source_range: [91; 105), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -105,7 +105,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "return;" ), insert_text_format: Snippet, - replace_range: [91; 105), - delete_range: None + source_range: [91; 105), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function3.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function3.snap index 6cbed012f..25c29dc18 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function3.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function3.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.640767+00:00 +Created: 2019-01-20T04:00:48.211090+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "if $0 {}" ), insert_text_format: Snippet, - replace_range: [31; 65), - delete_range: None + source_range: [31; 65), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -30,8 +30,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "match $0 {}" ), insert_text_format: Snippet, - replace_range: [31; 65), - delete_range: None + source_range: [31; 65), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -45,8 +45,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "while $0 {}" ), insert_text_format: Snippet, - replace_range: [31; 65), - delete_range: None + source_range: [31; 65), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -60,8 +60,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "loop {$0}" ), insert_text_format: Snippet, - replace_range: [31; 65), - delete_range: None + source_range: [31; 65), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -75,7 +75,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "return $0;" ), insert_text_format: Snippet, - replace_range: [31; 65), - delete_range: None + source_range: [31; 65), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function4.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function4.snap index b95cb72c1..7e43be4b0 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function4.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function4.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.664707+00:00 +Created: 2019-01-20T04:00:48.218272+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "if $0 {}" ), insert_text_format: Snippet, - replace_range: [24; 58), - delete_range: None + source_range: [24; 58), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -30,8 +30,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "match $0 {}" ), insert_text_format: Snippet, - replace_range: [24; 58), - delete_range: None + source_range: [24; 58), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -45,8 +45,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "while $0 {}" ), insert_text_format: Snippet, - replace_range: [24; 58), - delete_range: None + source_range: [24; 58), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -60,8 +60,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "loop {$0}" ), insert_text_format: Snippet, - replace_range: [24; 58), - delete_range: None + source_range: [24; 58), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -75,7 +75,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "return;" ), insert_text_format: Snippet, - replace_range: [24; 58), - delete_range: None + source_range: [24; 58), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt1.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt1.snap index d53c9e72f..7ed890b74 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt1.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt1.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.639067+00:00 +Created: 2019-01-20T04:00:48.207433+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "crate::" ), insert_text_format: PlainText, - replace_range: [16; 30), - delete_range: None + source_range: [16; 30), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -28,8 +28,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [16; 30), - delete_range: None + source_range: [16; 30), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -43,7 +43,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "super::" ), insert_text_format: PlainText, - replace_range: [16; 30), - delete_range: None + source_range: [16; 30), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt2.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt2.snap index fee3b6e3b..8d33629ed 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt2.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt2.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.643595+00:00 +Created: 2019-01-20T04:00:48.214287+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,8 +13,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [18; 20), - delete_range: None + source_range: [18; 20), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -28,7 +28,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "super::" ), insert_text_format: PlainText, - replace_range: [18; 20), - delete_range: None + source_range: [18; 20), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt3.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt3.snap index 2181d6c8b..66ab20f41 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt3.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt3.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.648502+00:00 +Created: 2019-01-20T04:00:48.217815+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,8 +13,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [23; 24), - delete_range: None + source_range: [23; 24), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -28,7 +28,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "super::" ), insert_text_format: PlainText, - replace_range: [23; 24), - delete_range: None + source_range: [23; 24), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi1.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi1.snap index 6da2c0ea9..2dc47e9b1 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi1.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi1.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.640449+00:00 +Created: 2019-01-20T04:00:48.208669+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "if $0 {}" ), insert_text_format: Snippet, - replace_range: [62; 100), - delete_range: None + source_range: [62; 100), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -30,8 +30,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "match $0 {}" ), insert_text_format: Snippet, - replace_range: [62; 100), - delete_range: None + source_range: [62; 100), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -45,8 +45,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "while $0 {}" ), insert_text_format: Snippet, - replace_range: [62; 100), - delete_range: None + source_range: [62; 100), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -60,8 +60,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "loop {$0}" ), insert_text_format: Snippet, - replace_range: [62; 100), - delete_range: None + source_range: [62; 100), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -75,7 +75,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "return $0;" ), insert_text_format: Snippet, - replace_range: [62; 100), - delete_range: None + source_range: [62; 100), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi2.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi2.snap index 33bc4bb51..59e11c585 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi2.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi2.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.649440+00:00 +Created: 2019-01-20T04:00:48.221138+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "if $0 {}" ), insert_text_format: Snippet, - replace_range: [62; 100), - delete_range: None + source_range: [62; 100), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -30,8 +30,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "match $0 {}" ), insert_text_format: Snippet, - replace_range: [62; 100), - delete_range: None + source_range: [62; 100), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -45,8 +45,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "while $0 {}" ), insert_text_format: Snippet, - replace_range: [62; 100), - delete_range: None + source_range: [62; 100), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -60,8 +60,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "loop {$0}" ), insert_text_format: Snippet, - replace_range: [62; 100), - delete_range: None + source_range: [62; 100), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -75,7 +75,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "return $0;" ), insert_text_format: Snippet, - replace_range: [62; 100), - delete_range: None + source_range: [62; 100), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__method_completion.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__method_completion.snap index 9081bd50d..44624473e 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__method_completion.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__method_completion.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.629020+00:00 +Created: 2019-01-20T04:00:48.203164+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,7 +15,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "the_method($0)" ), insert_text_format: Snippet, - replace_range: [143; 144), - delete_range: None + source_range: [143; 144), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items.snap index be75ec0b5..9ebb8a357 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.676740+00:00 +Created: 2019-01-20T04:00:48.243581+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "quux()$0" ), insert_text_format: Snippet, - replace_range: [72; 102), - delete_range: None + source_range: [72; 102), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -28,8 +28,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [72; 102), - delete_range: None + source_range: [72; 102), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -41,7 +41,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [72; 102), - delete_range: None + source_range: [72; 102), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items_in_nested_modules.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items_in_nested_modules.snap index 8277a6191..9b7aa0540 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items_in_nested_modules.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__module_items_in_nested_modules.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.677905+00:00 +Created: 2019-01-20T04:00:48.244757+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "quux()$0" ), insert_text_format: Snippet, - replace_range: [100; 102), - delete_range: None + source_range: [100; 102), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -28,7 +28,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [100; 102), - delete_range: None + source_range: [100; 102), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__nested_use_tree.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__nested_use_tree.snap index bb2830737..555f7acc6 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__nested_use_tree.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__nested_use_tree.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.666350+00:00 +Created: 2019-01-20T04:00:48.222109+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,8 +13,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [12; 14), - delete_range: None + source_range: [12; 14), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -26,7 +26,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [12; 14), - delete_range: None + source_range: [12; 14), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__no_semi_after_break_continue_in_expr.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__no_semi_after_break_continue_in_expr.snap index 8bcf60fa8..fd56a6c8c 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__no_semi_after_break_continue_in_expr.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__no_semi_after_break_continue_in_expr.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.640842+00:00 +Created: 2019-01-20T04:00:48.209867+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "if $0 {}" ), insert_text_format: Snippet, - replace_range: [106; 108), - delete_range: None + source_range: [106; 108), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -30,8 +30,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "match $0 {}" ), insert_text_format: Snippet, - replace_range: [106; 108), - delete_range: None + source_range: [106; 108), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -45,8 +45,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "while $0 {}" ), insert_text_format: Snippet, - replace_range: [106; 108), - delete_range: None + source_range: [106; 108), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -60,8 +60,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "loop {$0}" ), insert_text_format: Snippet, - replace_range: [106; 108), - delete_range: None + source_range: [106; 108), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -75,8 +75,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "continue" ), insert_text_format: Snippet, - replace_range: [106; 108), - delete_range: None + source_range: [106; 108), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -90,8 +90,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "break" ), insert_text_format: Snippet, - replace_range: [106; 108), - delete_range: None + source_range: [106; 108), + text_edit: None }, CompletionItem { completion_kind: Keyword, @@ -105,7 +105,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "return" ), insert_text_format: Snippet, - replace_range: [106; 108), - delete_range: None + source_range: [106; 108), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__param_completion_last_param.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__param_completion_last_param.snap index 67a075129..e0e5929ff 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__param_completion_last_param.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__param_completion_last_param.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.629063+00:00 +Created: 2019-01-20T04:00:48.203211+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,7 +13,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), insert_text: None, insert_text_format: PlainText, - replace_range: [98; 102), - delete_range: None + source_range: [98; 102), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__param_completion_nth_param.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__param_completion_nth_param.snap index 7f349ea16..2899cf98e 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__param_completion_nth_param.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__param_completion_nth_param.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.629062+00:00 +Created: 2019-01-20T04:00:48.203236+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,7 +13,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), insert_text: None, insert_text_format: PlainText, - replace_range: [98; 102), - delete_range: None + source_range: [98; 102), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__param_completion_trait_param.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__param_completion_trait_param.snap index 8aa07e2bc..8a4d9ef63 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__param_completion_trait_param.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__param_completion_trait_param.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.630980+00:00 +Created: 2019-01-20T04:00:48.206552+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,7 +13,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), insert_text: None, insert_text_format: PlainText, - replace_range: [269; 273), - delete_range: None + source_range: [269; 273), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__reference_completion.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__reference_completion.snap index 1e69b865f..404c738bd 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__reference_completion.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__reference_completion.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.664242+00:00 +Created: 2019-01-20T04:00:48.220278+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,8 +13,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [45; 47), - delete_range: None + source_range: [45; 47), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -26,7 +26,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [45; 47), - delete_range: None + source_range: [45; 47), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__return_type.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__return_type.snap index 5d2d01872..6bef3ed95 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__return_type.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__return_type.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.678426+00:00 +Created: 2019-01-20T04:00:48.245820+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,8 +13,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [46; 60), - delete_range: None + source_range: [46; 60), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -28,7 +28,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "x()$0" ), insert_text_format: Snippet, - replace_range: [46; 60), - delete_range: None + source_range: [46; 60), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__self_in_methods.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__self_in_methods.snap index 61ed4d0f2..56bfe1b0d 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__self_in_methods.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__self_in_methods.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.679470+00:00 +Created: 2019-01-20T04:00:48.244260+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,7 +13,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [24; 26), - delete_range: None + source_range: [24; 26), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_expressions.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_expressions.snap index 10ced4f28..648d7f189 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_expressions.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_expressions.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.681192+00:00 +Created: 2019-01-20T04:00:48.252281+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "eprintln!(\"$0 = {:?}\", $0);" ), insert_text_format: Snippet, - replace_range: [16; 18), - delete_range: None + source_range: [16; 18), + text_edit: None }, CompletionItem { completion_kind: Snippet, @@ -30,7 +30,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "eprintln!(\"$0 = {:#?}\", $0);" ), insert_text_format: Snippet, - replace_range: [16; 18), - delete_range: None + source_range: [16; 18), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_items.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_items.snap index 5a87ae357..f5d0140ea 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_items.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__snippets_in_items.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.682017+00:00 +Created: 2019-01-20T04:00:48.253073+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -17,8 +17,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "#[test]\nfn ${1:feature}() {\n $0\n}" ), insert_text_format: Snippet, - replace_range: [49; 79), - delete_range: None + source_range: [49; 79), + text_edit: None }, CompletionItem { completion_kind: Snippet, @@ -32,7 +32,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "pub(crate) $0" ), insert_text_format: Snippet, - replace_range: [49; 79), - delete_range: None + source_range: [49; 79), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_field_completion.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_field_completion.snap index 6208d04a4..530c76a02 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_field_completion.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_field_completion.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.628928+00:00 +Created: 2019-01-20T04:00:48.203121+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,7 +15,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [84; 85), - delete_range: None + source_range: [84; 85), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_field_completion_autoderef.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_field_completion_autoderef.snap index 6de8ada5a..ec861bf7e 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_field_completion_autoderef.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_field_completion_autoderef.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.629043+00:00 +Created: 2019-01-20T04:00:48.203230+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [125; 126), - delete_range: None + source_range: [125; 126), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -30,7 +30,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "foo($0)" ), insert_text_format: Snippet, - replace_range: [125; 126), - delete_range: None + source_range: [125; 126), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_field_completion_self.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_field_completion_self.snap index 3e5c4fca9..ee69884c8 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_field_completion_self.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__struct_field_completion_self.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.629041+00:00 +Created: 2019-01-20T04:00:48.203235+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -15,8 +15,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [120; 121), - delete_range: None + source_range: [120; 121), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -30,7 +30,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "foo($0)" ), insert_text_format: Snippet, - replace_range: [120; 121), - delete_range: None + source_range: [120; 121), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_crate.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_crate.snap index bbec167d5..29f7f86f1 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_crate.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_crate.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.667522+00:00 +Created: 2019-01-20T04:00:48.223130+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,8 +13,8 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [11; 13), - delete_range: None + source_range: [11; 13), + text_edit: None }, CompletionItem { completion_kind: Reference, @@ -26,7 +26,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [11; 13), - delete_range: None + source_range: [11; 13), + text_edit: None } ] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_self.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_self.snap index ed571c605..8b6aca26e 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_self.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__use_item_starting_with_self.snap @@ -1,4 +1,4 @@ -Created: 2019-01-19T16:37:23.669476+00:00 +Created: 2019-01-20T04:00:48.225170+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,7 +13,7 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: None, insert_text: None, insert_text_format: PlainText, - replace_range: [24; 26), - delete_range: None + source_range: [24; 26), + text_edit: None } ] diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index 54a977b7a..23b226fac 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs @@ -13,7 +13,6 @@ use ra_syntax::{SyntaxKind, TextRange, TextUnit}; use ra_text_edit::{AtomTextEdit, TextEdit}; use crate::{req, server_world::ServerWorld, Result}; -use ra_text_edit::TextEditBuilder; pub trait Conv { type Output; @@ -79,13 +78,11 @@ impl ConvWith for CompletionItem { type Ctx = LineIndex; type Output = ::lsp_types::CompletionItem; - fn conv_with(self, ctx: &LineIndex) -> ::lsp_types::CompletionItem { - let atom_text_edit = AtomTextEdit::replace(self.replace_range(), self.insert_text()); + fn conv_with(mut self, ctx: &LineIndex) -> ::lsp_types::CompletionItem { + let atom_text_edit = AtomTextEdit::replace(self.source_range(), self.insert_text()); let text_edit = (&atom_text_edit).conv_with(ctx); - let additional_text_edits = if let Some(delete_range) = self.delete_range() { - let mut builder = TextEditBuilder::default(); - builder.delete(delete_range); - Some(builder.finish().conv_with(ctx)) + let additional_text_edits = if let Some(edit) = self.take_text_edit() { + Some(edit.conv_with(ctx)) } else { None }; -- cgit v1.2.3