From 94d96b60f334e662f516bd0f04cc4191d7a804e6 Mon Sep 17 00:00:00 2001 From: gfreezy Date: Sun, 20 Jan 2019 00:38:34 +0800 Subject: refactor to use `remove_range` and `replace_range` instead of TextEdit --- crates/ra_ide_api/src/completion/complete_dot.rs | 16 +-- .../ra_ide_api/src/completion/complete_fn_param.rs | 2 +- .../ra_ide_api/src/completion/complete_keyword.rs | 13 +-- crates/ra_ide_api/src/completion/complete_path.rs | 20 ++-- crates/ra_ide_api/src/completion/complete_scope.rs | 20 ++-- .../ra_ide_api/src/completion/complete_snippet.rs | 4 +- .../ra_ide_api/src/completion/completion_item.rs | 110 +++++++-------------- .../completion_item__bindings_from_for.snap | 19 ++-- .../completion_item__bindings_from_if_let.snap | 24 ++--- .../completion_item__bindings_from_let.snap | 24 ++--- ...em__completes_break_and_continue_in_loops1.snap | 86 +++++++--------- ...em__completes_break_and_continue_in_loops2.snap | 62 +++++------- .../completion_item__deeply_nested_use_tree.snap | 7 +- ...t_add_semi_after_return_if_not_a_statement.snap | 62 +++++------- ...ont_render_function_parens_if_already_call.snap | 12 ++- ...m__dont_render_function_parens_in_use_item.snap | 7 +- ...__dont_show_both_completions_for_shadowing.snap | 19 ++-- ...n_item__inserts_parens_for_function_calls1.snap | 26 +++-- ...n_item__inserts_parens_for_function_calls2.snap | 26 +++-- .../completion_item__keywords_in_function1.snap | 62 +++++------- .../completion_item__keywords_in_function2.snap | 86 +++++++--------- .../completion_item__keywords_in_function3.snap | 62 +++++------- .../completion_item__keywords_in_function4.snap | 62 +++++------- .../completion_item__keywords_in_use_stmt1.snap | 31 +++--- .../completion_item__keywords_in_use_stmt2.snap | 19 ++-- .../completion_item__keywords_in_use_stmt3.snap | 19 ++-- ...etion_item__last_return_in_block_has_semi1.snap | 62 +++++------- ...etion_item__last_return_in_block_has_semi2.snap | 62 +++++------- .../completion_item__method_completion.snap | 14 ++- .../snapshots/completion_item__module_items.snap | 24 ++--- ...etion_item__module_items_in_nested_modules.snap | 19 ++-- .../completion_item__nested_use_tree.snap | 12 ++- ...item__no_semi_after_break_continue_in_expr.snap | 86 +++++++--------- ...mpletion_item__param_completion_last_param.snap | 7 +- ...ompletion_item__param_completion_nth_param.snap | 7 +- ...pletion_item__param_completion_trait_param.snap | 7 +- .../completion_item__reference_completion.snap | 12 ++- .../snapshots/completion_item__return_type.snap | 19 ++-- .../completion_item__self_in_methods.snap | 7 +- .../completion_item__snippets_in_expressions.snap | 26 +++-- .../completion_item__snippets_in_items.snap | 26 +++-- .../completion_item__struct_field_completion.snap | 7 +- ...on_item__struct_field_completion_autoderef.snap | 19 ++-- ...pletion_item__struct_field_completion_self.snap | 19 ++-- ...pletion_item__use_item_starting_with_crate.snap | 12 ++- ...mpletion_item__use_item_starting_with_self.snap | 7 +- 46 files changed, 606 insertions(+), 748 deletions(-) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/src/completion/complete_dot.rs b/crates/ra_ide_api/src/completion/complete_dot.rs index aaf739500..e1c0d26c7 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, + ctx.leaf_range(), field.name().to_string(), ) .kind(CompletionItemKind::Field) @@ -45,7 +45,7 @@ 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, i.to_string()) + CompletionItem::new(CompletionKind::Reference, ctx.leaf_range(), i.to_string()) .kind(CompletionItemKind::Field) .add_to(acc); } @@ -59,10 +59,14 @@ fn complete_methods(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty receiver.iterate_methods(ctx.db, |func| { let sig = func.signature(ctx.db); if sig.has_self_param() { - CompletionItem::new(CompletionKind::Reference, ctx, sig.name().to_string()) - .from_function(ctx, func) - .kind(CompletionItemKind::Method) - .add_to(acc); + CompletionItem::new( + CompletionKind::Reference, + ctx.leaf_range(), + sig.name().to_string(), + ) + .from_function(ctx, func) + .kind(CompletionItemKind::Method) + .add_to(acc); } None::<()> }); 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 e3d1470c2..c3e3ea931 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, label) + CompletionItem::new(CompletionKind::Magic, ctx.leaf_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 3fbf36313..006b20076 100644 --- a/crates/ra_ide_api/src/completion/complete_keyword.rs +++ b/crates/ra_ide_api/src/completion/complete_keyword.rs @@ -9,25 +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(); match (ctx.use_item_syntax.as_ref(), ctx.path_prefix.as_ref()) { (Some(_), None) => { - CompletionItem::new(CompletionKind::Keyword, ctx, "crate") + CompletionItem::new(CompletionKind::Keyword, leaf_range, "crate") .kind(CompletionItemKind::Keyword) .insert_text("crate::") .add_to(acc); - CompletionItem::new(CompletionKind::Keyword, ctx, "self") + CompletionItem::new(CompletionKind::Keyword, leaf_range, "self") .kind(CompletionItemKind::Keyword) .add_to(acc); - CompletionItem::new(CompletionKind::Keyword, ctx, "super") + CompletionItem::new(CompletionKind::Keyword, leaf_range, "super") .kind(CompletionItemKind::Keyword) .insert_text("super::") .add_to(acc); } (Some(_), Some(_)) => { - CompletionItem::new(CompletionKind::Keyword, ctx, "self") + CompletionItem::new(CompletionKind::Keyword, leaf_range, "self") .kind(CompletionItemKind::Keyword) .add_to(acc); - CompletionItem::new(CompletionKind::Keyword, ctx, "super") + CompletionItem::new(CompletionKind::Keyword, leaf_range, "super") .kind(CompletionItemKind::Keyword) .insert_text("super::") .add_to(acc); @@ -37,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, kw) + CompletionItem::new(CompletionKind::Keyword, ctx.leaf_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 7413c71e8..513a2ee89 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide_api/src/completion/complete_path.rs @@ -15,18 +15,26 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { hir::Def::Module(module) => { let module_scope = module.scope(ctx.db); for (name, res) in module_scope.entries() { - CompletionItem::new(CompletionKind::Reference, ctx, name.to_string()) - .from_resolution(ctx, res) - .add_to(acc); + CompletionItem::new( + CompletionKind::Reference, + ctx.leaf_range(), + name.to_string(), + ) + .from_resolution(ctx, res) + .add_to(acc); } } hir::Def::Enum(e) => { e.variants(ctx.db) .into_iter() .for_each(|(variant_name, _variant)| { - CompletionItem::new(CompletionKind::Reference, ctx, variant_name.to_string()) - .kind(CompletionItemKind::EnumVariant) - .add_to(acc) + CompletionItem::new( + CompletionKind::Reference, + ctx.leaf_range(), + variant_name.to_string(), + ) + .kind(CompletionItemKind::EnumVariant) + .add_to(acc) }); } _ => return, diff --git a/crates/ra_ide_api/src/completion/complete_scope.rs b/crates/ra_ide_api/src/completion/complete_scope.rs index bb080a341..958a12f22 100644 --- a/crates/ra_ide_api/src/completion/complete_scope.rs +++ b/crates/ra_ide_api/src/completion/complete_scope.rs @@ -29,9 +29,13 @@ pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) { } }) .for_each(|(name, res)| { - CompletionItem::new(CompletionKind::Reference, ctx, name.to_string()) - .from_resolution(ctx, res) - .add_to(acc) + CompletionItem::new( + CompletionKind::Reference, + ctx.leaf_range(), + name.to_string(), + ) + .from_resolution(ctx, res) + .add_to(acc) }); } @@ -46,9 +50,13 @@ fn complete_fn( .flat_map(|scope| scopes.scopes.entries(scope).iter()) .filter(|entry| shadowed.insert(entry.name())) .for_each(|entry| { - CompletionItem::new(CompletionKind::Reference, ctx, entry.name().to_string()) - .kind(CompletionItemKind::Binding) - .add_to(acc) + CompletionItem::new( + CompletionKind::Reference, + ctx.leaf_range(), + entry.name().to_string(), + ) + .kind(CompletionItemKind::Binding) + .add_to(acc) }); } diff --git a/crates/ra_ide_api/src/completion/complete_snippet.rs b/crates/ra_ide_api/src/completion/complete_snippet.rs index fb94e3674..4fa23bbf6 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<'a>(ctx: &'a CompletionContext<'a>, label: &str, snippet: &str) -> Builder<'a> { - CompletionItem::new(CompletionKind::Snippet, ctx, label) +fn snippet(ctx: &CompletionContext, label: &str, snippet: &str) -> Builder { + CompletionItem::new(CompletionKind::Snippet, ctx.leaf_range(), label) .snippet(snippet) .kind(CompletionItemKind::Snippet) } diff --git a/crates/ra_ide_api/src/completion/completion_item.rs b/crates/ra_ide_api/src/completion/completion_item.rs index f9a266524..da8da94d1 100644 --- a/crates/ra_ide_api/src/completion/completion_item.rs +++ b/crates/ra_ide_api/src/completion/completion_item.rs @@ -1,10 +1,7 @@ use hir::PerNs; -use ra_text_edit::{ - AtomTextEdit, - TextEdit, -}; use crate::completion::completion_context::CompletionContext; +use ra_syntax::TextRange; /// `CompletionItem` describes a single completion variant in the editor pop-up. /// It is basically a POD with various properties. To construct a @@ -18,26 +15,10 @@ pub struct CompletionItem { kind: Option, detail: Option, lookup: Option, - /// The format of the insert text. The format applies to both the `insert_text` property - /// and the `insert` property of a provided `text_edit`. + insert_text: Option, insert_text_format: InsertTextFormat, - /// An edit which is applied to a document when selecting this completion. When an edit is - /// provided the value of `insert_text` is ignored. - /// - /// *Note:* The range of the edit must be a single line range and it must contain the position - /// at which completion has been requested. - /// - /// *Note:* If sending a range that overlaps a string, the string should match the relevant - /// part of the replacement text, or be filtered out. - text_edit: Option, - /// An optional array of additional text edits that are applied when - /// selecting this completion. Edits must not overlap (including the same insert position) - /// with the main edit nor with themselves. - /// - /// Additional text edits should be used to change text unrelated to the current cursor position - /// (for example adding an import statement at the top of the file if the completion item will - /// insert an unqualified type). - additional_text_edits: Option, + replace_range: TextRange, + delete_range: Option, } #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -76,14 +57,14 @@ pub enum InsertTextFormat { } impl CompletionItem { - pub(crate) fn new<'a>( + pub(crate) fn new( completion_kind: CompletionKind, - ctx: &'a CompletionContext, + replace_range: TextRange, label: impl Into, - ) -> Builder<'a> { + ) -> Builder { let label = label.into(); Builder { - ctx, + replace_range, completion_kind, label, insert_text: None, @@ -91,8 +72,7 @@ impl CompletionItem { detail: None, lookup: None, kind: None, - text_edit: None, - additional_text_edits: None, + delete_range: None, } } /// What user sees in pop-up in the UI. @@ -114,22 +94,27 @@ impl CompletionItem { pub fn insert_text_format(&self) -> InsertTextFormat { self.insert_text_format.clone() } - + pub fn insert_text(&self) -> String { + match &self.insert_text { + Some(t) => t.clone(), + None => self.label.clone(), + } + } pub fn kind(&self) -> Option { self.kind } - pub fn text_edit(&mut self) -> Option<&AtomTextEdit> { - self.text_edit.as_ref() + pub fn delete_range(&self) -> Option { + self.delete_range } - pub fn take_additional_text_edits(&mut self) -> Option { - self.additional_text_edits.take() + pub fn replace_range(&self) -> TextRange { + self.replace_range } } /// A helper to make `CompletionItem`s. #[must_use] -pub(crate) struct Builder<'a> { - ctx: &'a CompletionContext<'a>, +pub(crate) struct Builder { + replace_range: TextRange, completion_kind: CompletionKind, label: String, insert_text: Option, @@ -137,76 +122,53 @@ pub(crate) struct Builder<'a> { detail: Option, lookup: Option, kind: Option, - text_edit: Option, - additional_text_edits: Option, + delete_range: Option, } -impl<'a> Builder<'a> { +impl Builder { pub(crate) fn add_to(self, acc: &mut Completions) { acc.add(self.build()) } pub(crate) fn build(self) -> CompletionItem { - let self_text_edit = self.text_edit; - let self_insert_text = self.insert_text; - let text_edit = match (self_text_edit, self_insert_text) { - (Some(text_edit), ..) => Some(text_edit), - (None, Some(insert_text)) => { - Some(AtomTextEdit::replace(self.ctx.leaf_range(), insert_text)) - } - _ => None, - }; - CompletionItem { + replace_range: self.replace_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, - text_edit, - additional_text_edits: self.additional_text_edits, + delete_range: self.delete_range, + insert_text: self.insert_text, } } - pub(crate) fn lookup_by(mut self, lookup: impl Into) -> Builder<'a> { + pub(crate) fn lookup_by(mut self, lookup: impl Into) -> Builder { self.lookup = Some(lookup.into()); self } - pub(crate) fn insert_text(mut self, insert_text: impl Into) -> Builder<'a> { + pub(crate) fn insert_text(mut self, insert_text: impl Into) -> Builder { self.insert_text = Some(insert_text.into()); self } #[allow(unused)] - pub(crate) fn insert_text_format( - mut self, - insert_text_format: InsertTextFormat, - ) -> Builder<'a> { + pub(crate) fn insert_text_format(mut self, insert_text_format: InsertTextFormat) -> Builder { self.insert_text_format = insert_text_format; self } - pub(crate) fn snippet(mut self, snippet: impl Into) -> Builder<'a> { + pub(crate) fn snippet(mut self, snippet: impl Into) -> Builder { self.insert_text_format = InsertTextFormat::Snippet; self.insert_text(snippet) } - pub(crate) fn kind(mut self, kind: CompletionItemKind) -> Builder<'a> { + pub(crate) fn kind(mut self, kind: CompletionItemKind) -> Builder { self.kind = Some(kind); self } #[allow(unused)] - pub(crate) fn text_edit(mut self, text_edit: AtomTextEdit) -> Builder<'a> { - self.text_edit = Some(text_edit); - self - } - #[allow(unused)] - pub(crate) fn additional_text_edits(mut self, additional_text_edits: TextEdit) -> Builder<'a> { - self.additional_text_edits = Some(additional_text_edits); - self - } - #[allow(unused)] - pub(crate) fn detail(self, detail: impl Into) -> Builder<'a> { + pub(crate) fn detail(self, detail: impl Into) -> Builder { self.set_detail(Some(detail)) } - pub(crate) fn set_detail(mut self, detail: Option>) -> Builder<'a> { + pub(crate) fn set_detail(mut self, detail: Option>) -> Builder { self.detail = detail.map(Into::into); self } @@ -214,7 +176,7 @@ impl<'a> Builder<'a> { mut self, ctx: &CompletionContext, resolution: &hir::Resolution, - ) -> Builder<'a> { + ) -> Builder { let resolved = resolution.def_id.map(|d| d.resolve(ctx.db)); let kind = match resolved { PerNs { @@ -259,7 +221,7 @@ impl<'a> Builder<'a> { mut self, ctx: &CompletionContext, function: hir::Function, - ) -> Builder<'a> { + ) -> Builder { // If not an import, add parenthesis automatically. if ctx.use_item_syntax.is_none() && !ctx.is_call { if function.signature(ctx.db).params().is_empty() { @@ -274,7 +236,7 @@ impl<'a> Builder<'a> { } } -impl<'a> Into for Builder<'a> { +impl<'a> Into for Builder { fn into(self) -> CompletionItem { self.build() } 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 40a5fd90f..ff8646ab2 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-19T13:42:17.835266+00:00 +Created: 2019-01-19T16:37:23.674785+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [62; 100), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -23,13 +24,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [62; 100), - insert: "quux()$0" - } + insert_text: Some( + "quux()$0" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [62; 100), + delete_range: 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 f6c0d7501..2176af32d 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-19T13:42:17.835796+00:00 +Created: 2019-01-19T16:37:23.676585+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [213; 231), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -23,9 +24,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [213; 231), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -35,13 +37,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [213; 231), - insert: "quux()$0" - } + insert_text: Some( + "quux()$0" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [213; 231), + delete_range: 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 a6fda0cf2..49745745d 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-19T13:42:17.835351+00:00 +Created: 2019-01-19T16:37:23.676674+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [78; 79), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -23,9 +24,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [78; 79), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -35,13 +37,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [78; 79), - insert: "quux($0)" - } + insert_text: Some( + "quux($0)" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [78; 79), + delete_range: 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 b27674da4..c8a0a78aa 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-19T13:42:17.819543+00:00 +Created: 2019-01-19T16:37:23.630898+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [54; 56), - insert: "if $0 {}" - } + insert_text: Some( + "if $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [54; 56), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [54; 56), - insert: "match $0 {}" - } + insert_text: Some( + "match $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [54; 56), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [54; 56), - insert: "while $0 {}" - } + insert_text: Some( + "while $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [54; 56), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [54; 56), - insert: "loop {$0}" - } + insert_text: Some( + "loop {$0}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [54; 56), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -79,14 +71,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [54; 56), - insert: "continue;" - } + insert_text: Some( + "continue;" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [54; 56), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -96,14 +86,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [54; 56), - insert: "break;" - } + insert_text: Some( + "break;" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [54; 56), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -113,13 +101,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [54; 56), - insert: "return $0;" - } + insert_text: Some( + "return $0;" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [54; 56), + delete_range: 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 4ebc16822..707021e21 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-19T13:42:17.830288+00:00 +Created: 2019-01-19T16:37:23.647435+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [59; 61), - insert: "if $0 {}" - } + insert_text: Some( + "if $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [59; 61), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [59; 61), - insert: "match $0 {}" - } + insert_text: Some( + "match $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [59; 61), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [59; 61), - insert: "while $0 {}" - } + insert_text: Some( + "while $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [59; 61), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [59; 61), - insert: "loop {$0}" - } + insert_text: Some( + "loop {$0}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [59; 61), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -79,13 +71,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [59; 61), - insert: "return $0;" - } + insert_text: Some( + "return $0;" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [59; 61), + delete_range: 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 b33bc3e04..a65ab3cc0 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-19T11:53:16.799862+00:00 +Created: 2019-01-19T16:37:23.649286+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,8 +11,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [23; 25), + delete_range: 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 0a96291ab..a935b06f4 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-19T13:42:17.821375+00:00 +Created: 2019-01-19T16:37:23.640573+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [84; 102), - insert: "if $0 {}" - } + insert_text: Some( + "if $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [84; 102), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [84; 102), - insert: "match $0 {}" - } + insert_text: Some( + "match $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [84; 102), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [84; 102), - insert: "while $0 {}" - } + insert_text: Some( + "while $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [84; 102), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [84; 102), - insert: "loop {$0}" - } + insert_text: Some( + "loop {$0}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [84; 102), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -79,13 +71,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [84; 102), - insert: "return $0" - } + insert_text: Some( + "return $0" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [84; 102), + delete_range: 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 5126c2bdc..abc01d4d6 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-19T11:53:16.799845+00:00 +Created: 2019-01-19T16:37:23.670539+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [35; 39), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -23,8 +24,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [35; 39), + delete_range: 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 dd91e337a..2d3234b2c 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-19T11:53:16.799820+00:00 +Created: 2019-01-19T16:37:23.671764+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,8 +11,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [40; 41), + delete_range: 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 9c1c3fe6a..6e4817d1a 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-19T13:42:17.841643+00:00 +Created: 2019-01-19T16:37:23.680378+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [108; 146), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -23,13 +24,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [108; 146), - insert: "foo()$0" - } + insert_text: Some( + "foo()$0" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [108; 146), + delete_range: 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 7d693be77..4ec75e2ca 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-19T13:42:17.844671+00:00 +Created: 2019-01-19T16:37:23.681170+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [53; 56), - insert: "no_args()$0" - } + insert_text: Some( + "no_args()$0" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [53; 56), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -28,13 +26,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [53; 56), - insert: "main()$0" - } + insert_text: Some( + "main()$0" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [53; 56), + delete_range: 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 1d2946c49..11a8f1757 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-19T13:42:17.849139+00:00 +Created: 2019-01-19T16:37:23.686781+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [72; 77), - insert: "main()$0" - } + insert_text: Some( + "main()$0" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [72; 77), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -28,13 +26,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [72; 77), - insert: "with_args($0)" - } + insert_text: Some( + "with_args($0)" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [72; 77), + delete_range: 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 2059d63e8..02e88a96e 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-19T13:42:17.819926+00:00 +Created: 2019-01-19T16:37:23.640068+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [24; 54), - insert: "if $0 {}" - } + insert_text: Some( + "if $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [24; 54), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [24; 54), - insert: "match $0 {}" - } + insert_text: Some( + "match $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [24; 54), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [24; 54), - insert: "while $0 {}" - } + insert_text: Some( + "while $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [24; 54), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [24; 54), - insert: "loop {$0}" - } + insert_text: Some( + "loop {$0}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [24; 54), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -79,13 +71,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [24; 54), - insert: "return;" - } + insert_text: Some( + "return;" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [24; 54), + delete_range: 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 2cc81582c..41dc288f6 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-19T13:42:17.819839+00:00 +Created: 2019-01-19T16:37:23.640134+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [91; 105), - insert: "if $0 {}" - } + insert_text: Some( + "if $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [91; 105), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [91; 105), - insert: "match $0 {}" - } + insert_text: Some( + "match $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [91; 105), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [91; 105), - insert: "while $0 {}" - } + insert_text: Some( + "while $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [91; 105), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [91; 105), - insert: "loop {$0}" - } + insert_text: Some( + "loop {$0}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [91; 105), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -79,14 +71,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [91; 105), - insert: "else {$0}" - } + insert_text: Some( + "else {$0}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [91; 105), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -96,14 +86,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [91; 105), - insert: "else if $0 {}" - } + insert_text: Some( + "else if $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [91; 105), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -113,13 +101,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [91; 105), - insert: "return;" - } + insert_text: Some( + "return;" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [91; 105), + delete_range: 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 26dec82c7..6cbed012f 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-19T13:42:17.822255+00:00 +Created: 2019-01-19T16:37:23.640767+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [31; 65), - insert: "if $0 {}" - } + insert_text: Some( + "if $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [31; 65), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [31; 65), - insert: "match $0 {}" - } + insert_text: Some( + "match $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [31; 65), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [31; 65), - insert: "while $0 {}" - } + insert_text: Some( + "while $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [31; 65), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [31; 65), - insert: "loop {$0}" - } + insert_text: Some( + "loop {$0}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [31; 65), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -79,13 +71,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [31; 65), - insert: "return $0;" - } + insert_text: Some( + "return $0;" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [31; 65), + delete_range: 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 4167165ec..b95cb72c1 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-19T13:42:17.830680+00:00 +Created: 2019-01-19T16:37:23.664707+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [24; 58), - insert: "if $0 {}" - } + insert_text: Some( + "if $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [24; 58), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [24; 58), - insert: "match $0 {}" - } + insert_text: Some( + "match $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [24; 58), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [24; 58), - insert: "while $0 {}" - } + insert_text: Some( + "while $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [24; 58), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [24; 58), - insert: "loop {$0}" - } + insert_text: Some( + "loop {$0}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [24; 58), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -79,13 +71,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [24; 58), - insert: "return;" - } + insert_text: Some( + "return;" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [24; 58), + delete_range: 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 db137d896..d53c9e72f 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-19T13:42:17.819227+00:00 +Created: 2019-01-19T16:37:23.639067+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: PlainText, - text_edit: Some( - AtomTextEdit { - delete: [16; 30), - insert: "crate::" - } + insert_text: Some( + "crate::" ), - additional_text_edits: None + insert_text_format: PlainText, + replace_range: [16; 30), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -28,9 +26,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [16; 30), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -40,13 +39,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: PlainText, - text_edit: Some( - AtomTextEdit { - delete: [16; 30), - insert: "super::" - } + insert_text: Some( + "super::" ), - additional_text_edits: None + insert_text_format: PlainText, + replace_range: [16; 30), + delete_range: 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 1ff0f4939..fee3b6e3b 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-19T13:42:17.822990+00:00 +Created: 2019-01-19T16:37:23.643595+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [18; 20), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -23,13 +24,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: PlainText, - text_edit: Some( - AtomTextEdit { - delete: [18; 20), - insert: "super::" - } + insert_text: Some( + "super::" ), - additional_text_edits: None + insert_text_format: PlainText, + replace_range: [18; 20), + delete_range: 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 e14bd209c..2181d6c8b 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-19T13:42:17.826915+00:00 +Created: 2019-01-19T16:37:23.648502+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [23; 24), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -23,13 +24,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: PlainText, - text_edit: Some( - AtomTextEdit { - delete: [23; 24), - insert: "super::" - } + insert_text: Some( + "super::" ), - additional_text_edits: None + insert_text_format: PlainText, + replace_range: [23; 24), + delete_range: 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 a72828355..6da2c0ea9 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-19T13:42:17.821139+00:00 +Created: 2019-01-19T16:37:23.640449+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [62; 100), - insert: "if $0 {}" - } + insert_text: Some( + "if $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [62; 100), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [62; 100), - insert: "match $0 {}" - } + insert_text: Some( + "match $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [62; 100), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [62; 100), - insert: "while $0 {}" - } + insert_text: Some( + "while $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [62; 100), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [62; 100), - insert: "loop {$0}" - } + insert_text: Some( + "loop {$0}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [62; 100), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -79,13 +71,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [62; 100), - insert: "return $0;" - } + insert_text: Some( + "return $0;" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [62; 100), + delete_range: 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 c5d5e74cb..33bc4bb51 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-19T13:42:17.829078+00:00 +Created: 2019-01-19T16:37:23.649440+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [62; 100), - insert: "if $0 {}" - } + insert_text: Some( + "if $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [62; 100), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [62; 100), - insert: "match $0 {}" - } + insert_text: Some( + "match $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [62; 100), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [62; 100), - insert: "while $0 {}" - } + insert_text: Some( + "while $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [62; 100), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [62; 100), - insert: "loop {$0}" - } + insert_text: Some( + "loop {$0}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [62; 100), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -79,13 +71,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [62; 100), - insert: "return $0;" - } + insert_text: Some( + "return $0;" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [62; 100), + delete_range: 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 c18b44d59..9081bd50d 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-19T13:42:17.817204+00:00 +Created: 2019-01-19T16:37:23.629020+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,13 +11,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [143; 144), - insert: "the_method($0)" - } + insert_text: Some( + "the_method($0)" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [143; 144), + delete_range: 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 8d262a91d..be75ec0b5 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-19T13:42:17.835687+00:00 +Created: 2019-01-19T16:37:23.676740+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [72; 102), - insert: "quux()$0" - } + insert_text: Some( + "quux()$0" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [72; 102), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -28,9 +26,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [72; 102), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -40,8 +39,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [72; 102), + delete_range: 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 097344521..8277a6191 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-19T13:42:17.836102+00:00 +Created: 2019-01-19T16:37:23.677905+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [100; 102), - insert: "quux()$0" - } + insert_text: Some( + "quux()$0" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [100; 102), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -28,8 +26,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [100; 102), + delete_range: 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 dbe1e0445..bb2830737 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-19T11:53:16.799743+00:00 +Created: 2019-01-19T16:37:23.666350+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [12; 14), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -23,8 +24,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [12; 14), + delete_range: 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 26c54018e..8bcf60fa8 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-19T13:42:17.821881+00:00 +Created: 2019-01-19T16:37:23.640842+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [106; 108), - insert: "if $0 {}" - } + insert_text: Some( + "if $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [106; 108), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [106; 108), - insert: "match $0 {}" - } + insert_text: Some( + "match $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [106; 108), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [106; 108), - insert: "while $0 {}" - } + insert_text: Some( + "while $0 {}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [106; 108), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [106; 108), - insert: "loop {$0}" - } + insert_text: Some( + "loop {$0}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [106; 108), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -79,14 +71,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [106; 108), - insert: "continue" - } + insert_text: Some( + "continue" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [106; 108), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -96,14 +86,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [106; 108), - insert: "break" - } + insert_text: Some( + "break" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [106; 108), + delete_range: None }, CompletionItem { completion_kind: Keyword, @@ -113,13 +101,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [106; 108), - insert: "return" - } + insert_text: Some( + "return" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [106; 108), + delete_range: 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 160da9e31..67a075129 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-19T11:27:14.070727+00:00 +Created: 2019-01-19T16:37:23.629063+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,8 +11,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: Some( "file_id" ), + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [98; 102), + delete_range: 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 baeb01ed9..7f349ea16 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-19T11:29:09.355053+00:00 +Created: 2019-01-19T16:37:23.629062+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,8 +11,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: Some( "file_id" ), + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [98; 102), + delete_range: 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 8193c4f17..8aa07e2bc 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-19T11:29:09.355066+00:00 +Created: 2019-01-19T16:37:23.630980+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,8 +11,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: Some( "file_id" ), + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [269; 273), + delete_range: 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 abd17dcec..1e69b865f 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-19T11:53:16.799765+00:00 +Created: 2019-01-19T16:37:23.664242+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [45; 47), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -23,8 +24,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [45; 47), + delete_range: 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 c00a5ea5d..5d2d01872 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-19T13:42:17.837692+00:00 +Created: 2019-01-19T16:37:23.678426+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [46; 60), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -23,13 +24,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [46; 60), - insert: "x()$0" - } + insert_text: Some( + "x()$0" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [46; 60), + delete_range: 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 263b15156..61ed4d0f2 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-19T11:59:18.394156+00:00 +Created: 2019-01-19T16:37:23.679470+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,8 +11,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [24; 26), + delete_range: 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 82f0a6d8d..10ced4f28 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-19T13:42:17.844708+00:00 +Created: 2019-01-19T16:37:23.681192+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [16; 18), - insert: "eprintln!(\"$0 = {:?}\", $0);" - } + insert_text: Some( + "eprintln!(\"$0 = {:?}\", $0);" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [16; 18), + delete_range: None }, CompletionItem { completion_kind: Snippet, @@ -28,13 +26,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [16; 18), - insert: "eprintln!(\"$0 = {:#?}\", $0);" - } + insert_text: Some( + "eprintln!(\"$0 = {:#?}\", $0);" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [16; 18), + delete_range: 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 e7cc5c410..5a87ae357 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-19T13:42:17.845616+00:00 +Created: 2019-01-19T16:37:23.682017+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,14 +13,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs lookup: Some( "tfn" ), - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [49; 79), - insert: "#[test]\nfn ${1:feature}() {\n $0\n}" - } + insert_text: Some( + "#[test]\nfn ${1:feature}() {\n $0\n}" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [49; 79), + delete_range: None }, CompletionItem { completion_kind: Snippet, @@ -30,13 +28,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [49; 79), - insert: "pub(crate) $0" - } + insert_text: Some( + "pub(crate) $0" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [49; 79), + delete_range: 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 d27ca5f8f..6208d04a4 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-19T11:34:11.702218+00:00 +Created: 2019-01-19T16:37:23.628928+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,8 +13,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "u32" ), lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [84; 85), + delete_range: 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 8e547ad37..6de8ada5a 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-19T13:42:17.817216+00:00 +Created: 2019-01-19T16:37:23.629043+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,9 +13,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "(u32, i32)" ), lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [125; 126), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -25,13 +26,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [125; 126), - insert: "foo($0)" - } + insert_text: Some( + "foo($0)" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [125; 126), + delete_range: 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 4536cee17..3e5c4fca9 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-19T13:42:17.817207+00:00 +Created: 2019-01-19T16:37:23.629041+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -13,9 +13,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs "(u32,)" ), lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [120; 121), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -25,13 +26,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, - insert_text_format: Snippet, - text_edit: Some( - AtomTextEdit { - delete: [120; 121), - insert: "foo($0)" - } + insert_text: Some( + "foo($0)" ), - additional_text_edits: None + insert_text_format: Snippet, + replace_range: [120; 121), + delete_range: 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 4c35be33a..bbec167d5 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-19T11:53:16.799683+00:00 +Created: 2019-01-19T16:37:23.667522+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [11; 13), + delete_range: None }, CompletionItem { completion_kind: Reference, @@ -23,8 +24,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [11; 13), + delete_range: 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 9780d652a..ed571c605 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-19T11:53:16.799788+00:00 +Created: 2019-01-19T16:37:23.669476+00:00 Creator: insta@0.1.4 Source: crates/ra_ide_api/src/completion/completion_item.rs @@ -11,8 +11,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs ), detail: None, lookup: None, + insert_text: None, insert_text_format: PlainText, - text_edit: None, - additional_text_edits: None + replace_range: [24; 26), + delete_range: None } ] -- cgit v1.2.3