diff options
47 files changed, 619 insertions, 755 deletions
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) | |||
31 | for field in s.fields(ctx.db) { | 31 | for field in s.fields(ctx.db) { |
32 | CompletionItem::new( | 32 | CompletionItem::new( |
33 | CompletionKind::Reference, | 33 | CompletionKind::Reference, |
34 | ctx, | 34 | ctx.leaf_range(), |
35 | field.name().to_string(), | 35 | field.name().to_string(), |
36 | ) | 36 | ) |
37 | .kind(CompletionItemKind::Field) | 37 | .kind(CompletionItemKind::Field) |
@@ -45,7 +45,7 @@ fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) | |||
45 | } | 45 | } |
46 | Ty::Tuple(fields) => { | 46 | Ty::Tuple(fields) => { |
47 | for (i, _ty) in fields.iter().enumerate() { | 47 | for (i, _ty) in fields.iter().enumerate() { |
48 | CompletionItem::new(CompletionKind::Reference, ctx, i.to_string()) | 48 | CompletionItem::new(CompletionKind::Reference, ctx.leaf_range(), i.to_string()) |
49 | .kind(CompletionItemKind::Field) | 49 | .kind(CompletionItemKind::Field) |
50 | .add_to(acc); | 50 | .add_to(acc); |
51 | } | 51 | } |
@@ -59,10 +59,14 @@ fn complete_methods(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty | |||
59 | receiver.iterate_methods(ctx.db, |func| { | 59 | receiver.iterate_methods(ctx.db, |func| { |
60 | let sig = func.signature(ctx.db); | 60 | let sig = func.signature(ctx.db); |
61 | if sig.has_self_param() { | 61 | if sig.has_self_param() { |
62 | CompletionItem::new(CompletionKind::Reference, ctx, sig.name().to_string()) | 62 | CompletionItem::new( |
63 | .from_function(ctx, func) | 63 | CompletionKind::Reference, |
64 | .kind(CompletionItemKind::Method) | 64 | ctx.leaf_range(), |
65 | .add_to(acc); | 65 | sig.name().to_string(), |
66 | ) | ||
67 | .from_function(ctx, func) | ||
68 | .kind(CompletionItemKind::Method) | ||
69 | .add_to(acc); | ||
66 | } | 70 | } |
67 | None::<()> | 71 | None::<()> |
68 | }); | 72 | }); |
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) | |||
34 | } | 34 | } |
35 | }) | 35 | }) |
36 | .for_each(|(label, lookup)| { | 36 | .for_each(|(label, lookup)| { |
37 | CompletionItem::new(CompletionKind::Magic, ctx, label) | 37 | CompletionItem::new(CompletionKind::Magic, ctx.leaf_range(), label) |
38 | .lookup_by(lookup) | 38 | .lookup_by(lookup) |
39 | .add_to(acc) | 39 | .add_to(acc) |
40 | }); | 40 | }); |
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 | |||
9 | 9 | ||
10 | pub(super) fn complete_use_tree_keyword(acc: &mut Completions, ctx: &CompletionContext) { | 10 | pub(super) fn complete_use_tree_keyword(acc: &mut Completions, ctx: &CompletionContext) { |
11 | // complete keyword "crate" in use stmt | 11 | // complete keyword "crate" in use stmt |
12 | let leaf_range = ctx.leaf_range(); | ||
12 | match (ctx.use_item_syntax.as_ref(), ctx.path_prefix.as_ref()) { | 13 | match (ctx.use_item_syntax.as_ref(), ctx.path_prefix.as_ref()) { |
13 | (Some(_), None) => { | 14 | (Some(_), None) => { |
14 | CompletionItem::new(CompletionKind::Keyword, ctx, "crate") | 15 | CompletionItem::new(CompletionKind::Keyword, leaf_range, "crate") |
15 | .kind(CompletionItemKind::Keyword) | 16 | .kind(CompletionItemKind::Keyword) |
16 | .insert_text("crate::") | 17 | .insert_text("crate::") |
17 | .add_to(acc); | 18 | .add_to(acc); |
18 | CompletionItem::new(CompletionKind::Keyword, ctx, "self") | 19 | CompletionItem::new(CompletionKind::Keyword, leaf_range, "self") |
19 | .kind(CompletionItemKind::Keyword) | 20 | .kind(CompletionItemKind::Keyword) |
20 | .add_to(acc); | 21 | .add_to(acc); |
21 | CompletionItem::new(CompletionKind::Keyword, ctx, "super") | 22 | CompletionItem::new(CompletionKind::Keyword, leaf_range, "super") |
22 | .kind(CompletionItemKind::Keyword) | 23 | .kind(CompletionItemKind::Keyword) |
23 | .insert_text("super::") | 24 | .insert_text("super::") |
24 | .add_to(acc); | 25 | .add_to(acc); |
25 | } | 26 | } |
26 | (Some(_), Some(_)) => { | 27 | (Some(_), Some(_)) => { |
27 | CompletionItem::new(CompletionKind::Keyword, ctx, "self") | 28 | CompletionItem::new(CompletionKind::Keyword, leaf_range, "self") |
28 | .kind(CompletionItemKind::Keyword) | 29 | .kind(CompletionItemKind::Keyword) |
29 | .add_to(acc); | 30 | .add_to(acc); |
30 | CompletionItem::new(CompletionKind::Keyword, ctx, "super") | 31 | CompletionItem::new(CompletionKind::Keyword, leaf_range, "super") |
31 | .kind(CompletionItemKind::Keyword) | 32 | .kind(CompletionItemKind::Keyword) |
32 | .insert_text("super::") | 33 | .insert_text("super::") |
33 | .add_to(acc); | 34 | .add_to(acc); |
@@ -37,7 +38,7 @@ pub(super) fn complete_use_tree_keyword(acc: &mut Completions, ctx: &CompletionC | |||
37 | } | 38 | } |
38 | 39 | ||
39 | fn keyword(ctx: &CompletionContext, kw: &str, snippet: &str) -> CompletionItem { | 40 | fn keyword(ctx: &CompletionContext, kw: &str, snippet: &str) -> CompletionItem { |
40 | CompletionItem::new(CompletionKind::Keyword, ctx, kw) | 41 | CompletionItem::new(CompletionKind::Keyword, ctx.leaf_range(), kw) |
41 | .kind(CompletionItemKind::Keyword) | 42 | .kind(CompletionItemKind::Keyword) |
42 | .snippet(snippet) | 43 | .snippet(snippet) |
43 | .build() | 44 | .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) { | |||
15 | hir::Def::Module(module) => { | 15 | hir::Def::Module(module) => { |
16 | let module_scope = module.scope(ctx.db); | 16 | let module_scope = module.scope(ctx.db); |
17 | for (name, res) in module_scope.entries() { | 17 | for (name, res) in module_scope.entries() { |
18 | CompletionItem::new(CompletionKind::Reference, ctx, name.to_string()) | 18 | CompletionItem::new( |
19 | .from_resolution(ctx, res) | 19 | CompletionKind::Reference, |
20 | .add_to(acc); | 20 | ctx.leaf_range(), |
21 | name.to_string(), | ||
22 | ) | ||
23 | .from_resolution(ctx, res) | ||
24 | .add_to(acc); | ||
21 | } | 25 | } |
22 | } | 26 | } |
23 | hir::Def::Enum(e) => { | 27 | hir::Def::Enum(e) => { |
24 | e.variants(ctx.db) | 28 | e.variants(ctx.db) |
25 | .into_iter() | 29 | .into_iter() |
26 | .for_each(|(variant_name, _variant)| { | 30 | .for_each(|(variant_name, _variant)| { |
27 | CompletionItem::new(CompletionKind::Reference, ctx, variant_name.to_string()) | 31 | CompletionItem::new( |
28 | .kind(CompletionItemKind::EnumVariant) | 32 | CompletionKind::Reference, |
29 | .add_to(acc) | 33 | ctx.leaf_range(), |
34 | variant_name.to_string(), | ||
35 | ) | ||
36 | .kind(CompletionItemKind::EnumVariant) | ||
37 | .add_to(acc) | ||
30 | }); | 38 | }); |
31 | } | 39 | } |
32 | _ => return, | 40 | _ => 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) { | |||
29 | } | 29 | } |
30 | }) | 30 | }) |
31 | .for_each(|(name, res)| { | 31 | .for_each(|(name, res)| { |
32 | CompletionItem::new(CompletionKind::Reference, ctx, name.to_string()) | 32 | CompletionItem::new( |
33 | .from_resolution(ctx, res) | 33 | CompletionKind::Reference, |
34 | .add_to(acc) | 34 | ctx.leaf_range(), |
35 | name.to_string(), | ||
36 | ) | ||
37 | .from_resolution(ctx, res) | ||
38 | .add_to(acc) | ||
35 | }); | 39 | }); |
36 | } | 40 | } |
37 | 41 | ||
@@ -46,9 +50,13 @@ fn complete_fn( | |||
46 | .flat_map(|scope| scopes.scopes.entries(scope).iter()) | 50 | .flat_map(|scope| scopes.scopes.entries(scope).iter()) |
47 | .filter(|entry| shadowed.insert(entry.name())) | 51 | .filter(|entry| shadowed.insert(entry.name())) |
48 | .for_each(|entry| { | 52 | .for_each(|entry| { |
49 | CompletionItem::new(CompletionKind::Reference, ctx, entry.name().to_string()) | 53 | CompletionItem::new( |
50 | .kind(CompletionItemKind::Binding) | 54 | CompletionKind::Reference, |
51 | .add_to(acc) | 55 | ctx.leaf_range(), |
56 | entry.name().to_string(), | ||
57 | ) | ||
58 | .kind(CompletionItemKind::Binding) | ||
59 | .add_to(acc) | ||
52 | }); | 60 | }); |
53 | } | 61 | } |
54 | 62 | ||
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 @@ | |||
1 | use crate::completion::{CompletionItem, Completions, CompletionKind, CompletionItemKind, CompletionContext, completion_item::Builder}; | 1 | use crate::completion::{CompletionItem, Completions, CompletionKind, CompletionItemKind, CompletionContext, completion_item::Builder}; |
2 | 2 | ||
3 | fn snippet<'a>(ctx: &'a CompletionContext<'a>, label: &str, snippet: &str) -> Builder<'a> { | 3 | fn snippet(ctx: &CompletionContext, label: &str, snippet: &str) -> Builder { |
4 | CompletionItem::new(CompletionKind::Snippet, ctx, label) | 4 | CompletionItem::new(CompletionKind::Snippet, ctx.leaf_range(), label) |
5 | .snippet(snippet) | 5 | .snippet(snippet) |
6 | .kind(CompletionItemKind::Snippet) | 6 | .kind(CompletionItemKind::Snippet) |
7 | } | 7 | } |
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 @@ | |||
1 | use hir::PerNs; | 1 | use hir::PerNs; |
2 | use ra_text_edit::{ | ||
3 | AtomTextEdit, | ||
4 | TextEdit, | ||
5 | }; | ||
6 | 2 | ||
7 | use crate::completion::completion_context::CompletionContext; | 3 | use crate::completion::completion_context::CompletionContext; |
4 | use ra_syntax::TextRange; | ||
8 | 5 | ||
9 | /// `CompletionItem` describes a single completion variant in the editor pop-up. | 6 | /// `CompletionItem` describes a single completion variant in the editor pop-up. |
10 | /// It is basically a POD with various properties. To construct a | 7 | /// It is basically a POD with various properties. To construct a |
@@ -18,26 +15,10 @@ pub struct CompletionItem { | |||
18 | kind: Option<CompletionItemKind>, | 15 | kind: Option<CompletionItemKind>, |
19 | detail: Option<String>, | 16 | detail: Option<String>, |
20 | lookup: Option<String>, | 17 | lookup: Option<String>, |
21 | /// The format of the insert text. The format applies to both the `insert_text` property | 18 | insert_text: Option<String>, |
22 | /// and the `insert` property of a provided `text_edit`. | ||
23 | insert_text_format: InsertTextFormat, | 19 | insert_text_format: InsertTextFormat, |
24 | /// An edit which is applied to a document when selecting this completion. When an edit is | 20 | replace_range: TextRange, |
25 | /// provided the value of `insert_text` is ignored. | 21 | delete_range: Option<TextRange>, |
26 | /// | ||
27 | /// *Note:* The range of the edit must be a single line range and it must contain the position | ||
28 | /// at which completion has been requested. | ||
29 | /// | ||
30 | /// *Note:* If sending a range that overlaps a string, the string should match the relevant | ||
31 | /// part of the replacement text, or be filtered out. | ||
32 | text_edit: Option<AtomTextEdit>, | ||
33 | /// An optional array of additional text edits that are applied when | ||
34 | /// selecting this completion. Edits must not overlap (including the same insert position) | ||
35 | /// with the main edit nor with themselves. | ||
36 | /// | ||
37 | /// Additional text edits should be used to change text unrelated to the current cursor position | ||
38 | /// (for example adding an import statement at the top of the file if the completion item will | ||
39 | /// insert an unqualified type). | ||
40 | additional_text_edits: Option<TextEdit>, | ||
41 | } | 22 | } |
42 | 23 | ||
43 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] | 24 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
@@ -76,14 +57,14 @@ pub enum InsertTextFormat { | |||
76 | } | 57 | } |
77 | 58 | ||
78 | impl CompletionItem { | 59 | impl CompletionItem { |
79 | pub(crate) fn new<'a>( | 60 | pub(crate) fn new( |
80 | completion_kind: CompletionKind, | 61 | completion_kind: CompletionKind, |
81 | ctx: &'a CompletionContext, | 62 | replace_range: TextRange, |
82 | label: impl Into<String>, | 63 | label: impl Into<String>, |
83 | ) -> Builder<'a> { | 64 | ) -> Builder { |
84 | let label = label.into(); | 65 | let label = label.into(); |
85 | Builder { | 66 | Builder { |
86 | ctx, | 67 | replace_range, |
87 | completion_kind, | 68 | completion_kind, |
88 | label, | 69 | label, |
89 | insert_text: None, | 70 | insert_text: None, |
@@ -91,8 +72,7 @@ impl CompletionItem { | |||
91 | detail: None, | 72 | detail: None, |
92 | lookup: None, | 73 | lookup: None, |
93 | kind: None, | 74 | kind: None, |
94 | text_edit: None, | 75 | delete_range: None, |
95 | additional_text_edits: None, | ||
96 | } | 76 | } |
97 | } | 77 | } |
98 | /// What user sees in pop-up in the UI. | 78 | /// What user sees in pop-up in the UI. |
@@ -114,22 +94,27 @@ impl CompletionItem { | |||
114 | pub fn insert_text_format(&self) -> InsertTextFormat { | 94 | pub fn insert_text_format(&self) -> InsertTextFormat { |
115 | self.insert_text_format.clone() | 95 | self.insert_text_format.clone() |
116 | } | 96 | } |
117 | 97 | pub fn insert_text(&self) -> String { | |
98 | match &self.insert_text { | ||
99 | Some(t) => t.clone(), | ||
100 | None => self.label.clone(), | ||
101 | } | ||
102 | } | ||
118 | pub fn kind(&self) -> Option<CompletionItemKind> { | 103 | pub fn kind(&self) -> Option<CompletionItemKind> { |
119 | self.kind | 104 | self.kind |
120 | } | 105 | } |
121 | pub fn text_edit(&mut self) -> Option<&AtomTextEdit> { | 106 | pub fn delete_range(&self) -> Option<TextRange> { |
122 | self.text_edit.as_ref() | 107 | self.delete_range |
123 | } | 108 | } |
124 | pub fn take_additional_text_edits(&mut self) -> Option<TextEdit> { | 109 | pub fn replace_range(&self) -> TextRange { |
125 | self.additional_text_edits.take() | 110 | self.replace_range |
126 | } | 111 | } |
127 | } | 112 | } |
128 | 113 | ||
129 | /// A helper to make `CompletionItem`s. | 114 | /// A helper to make `CompletionItem`s. |
130 | #[must_use] | 115 | #[must_use] |
131 | pub(crate) struct Builder<'a> { | 116 | pub(crate) struct Builder { |
132 | ctx: &'a CompletionContext<'a>, | 117 | replace_range: TextRange, |
133 | completion_kind: CompletionKind, | 118 | completion_kind: CompletionKind, |
134 | label: String, | 119 | label: String, |
135 | insert_text: Option<String>, | 120 | insert_text: Option<String>, |
@@ -137,76 +122,53 @@ pub(crate) struct Builder<'a> { | |||
137 | detail: Option<String>, | 122 | detail: Option<String>, |
138 | lookup: Option<String>, | 123 | lookup: Option<String>, |
139 | kind: Option<CompletionItemKind>, | 124 | kind: Option<CompletionItemKind>, |
140 | text_edit: Option<AtomTextEdit>, | 125 | delete_range: Option<TextRange>, |
141 | additional_text_edits: Option<TextEdit>, | ||
142 | } | 126 | } |
143 | 127 | ||
144 | impl<'a> Builder<'a> { | 128 | impl Builder { |
145 | pub(crate) fn add_to(self, acc: &mut Completions) { | 129 | pub(crate) fn add_to(self, acc: &mut Completions) { |
146 | acc.add(self.build()) | 130 | acc.add(self.build()) |
147 | } | 131 | } |
148 | 132 | ||
149 | pub(crate) fn build(self) -> CompletionItem { | 133 | pub(crate) fn build(self) -> CompletionItem { |
150 | let self_text_edit = self.text_edit; | ||
151 | let self_insert_text = self.insert_text; | ||
152 | let text_edit = match (self_text_edit, self_insert_text) { | ||
153 | (Some(text_edit), ..) => Some(text_edit), | ||
154 | (None, Some(insert_text)) => { | ||
155 | Some(AtomTextEdit::replace(self.ctx.leaf_range(), insert_text)) | ||
156 | } | ||
157 | _ => None, | ||
158 | }; | ||
159 | |||
160 | CompletionItem { | 134 | CompletionItem { |
135 | replace_range: self.replace_range, | ||
161 | label: self.label, | 136 | label: self.label, |
162 | detail: self.detail, | 137 | detail: self.detail, |
163 | insert_text_format: self.insert_text_format, | 138 | insert_text_format: self.insert_text_format, |
164 | lookup: self.lookup, | 139 | lookup: self.lookup, |
165 | kind: self.kind, | 140 | kind: self.kind, |
166 | completion_kind: self.completion_kind, | 141 | completion_kind: self.completion_kind, |
167 | text_edit, | 142 | delete_range: self.delete_range, |
168 | additional_text_edits: self.additional_text_edits, | 143 | insert_text: self.insert_text, |
169 | } | 144 | } |
170 | } | 145 | } |
171 | pub(crate) fn lookup_by(mut self, lookup: impl Into<String>) -> Builder<'a> { | 146 | pub(crate) fn lookup_by(mut self, lookup: impl Into<String>) -> Builder { |
172 | self.lookup = Some(lookup.into()); | 147 | self.lookup = Some(lookup.into()); |
173 | self | 148 | self |
174 | } | 149 | } |
175 | pub(crate) fn insert_text(mut self, insert_text: impl Into<String>) -> Builder<'a> { | 150 | pub(crate) fn insert_text(mut self, insert_text: impl Into<String>) -> Builder { |
176 | self.insert_text = Some(insert_text.into()); | 151 | self.insert_text = Some(insert_text.into()); |
177 | self | 152 | self |
178 | } | 153 | } |
179 | #[allow(unused)] | 154 | #[allow(unused)] |
180 | pub(crate) fn insert_text_format( | 155 | pub(crate) fn insert_text_format(mut self, insert_text_format: InsertTextFormat) -> Builder { |
181 | mut self, | ||
182 | insert_text_format: InsertTextFormat, | ||
183 | ) -> Builder<'a> { | ||
184 | self.insert_text_format = insert_text_format; | 156 | self.insert_text_format = insert_text_format; |
185 | self | 157 | self |
186 | } | 158 | } |
187 | pub(crate) fn snippet(mut self, snippet: impl Into<String>) -> Builder<'a> { | 159 | pub(crate) fn snippet(mut self, snippet: impl Into<String>) -> Builder { |
188 | self.insert_text_format = InsertTextFormat::Snippet; | 160 | self.insert_text_format = InsertTextFormat::Snippet; |
189 | self.insert_text(snippet) | 161 | self.insert_text(snippet) |
190 | } | 162 | } |
191 | pub(crate) fn kind(mut self, kind: CompletionItemKind) -> Builder<'a> { | 163 | pub(crate) fn kind(mut self, kind: CompletionItemKind) -> Builder { |
192 | self.kind = Some(kind); | 164 | self.kind = Some(kind); |
193 | self | 165 | self |
194 | } | 166 | } |
195 | #[allow(unused)] | 167 | #[allow(unused)] |
196 | pub(crate) fn text_edit(mut self, text_edit: AtomTextEdit) -> Builder<'a> { | 168 | pub(crate) fn detail(self, detail: impl Into<String>) -> Builder { |
197 | self.text_edit = Some(text_edit); | ||
198 | self | ||
199 | } | ||
200 | #[allow(unused)] | ||
201 | pub(crate) fn additional_text_edits(mut self, additional_text_edits: TextEdit) -> Builder<'a> { | ||
202 | self.additional_text_edits = Some(additional_text_edits); | ||
203 | self | ||
204 | } | ||
205 | #[allow(unused)] | ||
206 | pub(crate) fn detail(self, detail: impl Into<String>) -> Builder<'a> { | ||
207 | self.set_detail(Some(detail)) | 169 | self.set_detail(Some(detail)) |
208 | } | 170 | } |
209 | pub(crate) fn set_detail(mut self, detail: Option<impl Into<String>>) -> Builder<'a> { | 171 | pub(crate) fn set_detail(mut self, detail: Option<impl Into<String>>) -> Builder { |
210 | self.detail = detail.map(Into::into); | 172 | self.detail = detail.map(Into::into); |
211 | self | 173 | self |
212 | } | 174 | } |
@@ -214,7 +176,7 @@ impl<'a> Builder<'a> { | |||
214 | mut self, | 176 | mut self, |
215 | ctx: &CompletionContext, | 177 | ctx: &CompletionContext, |
216 | resolution: &hir::Resolution, | 178 | resolution: &hir::Resolution, |
217 | ) -> Builder<'a> { | 179 | ) -> Builder { |
218 | let resolved = resolution.def_id.map(|d| d.resolve(ctx.db)); | 180 | let resolved = resolution.def_id.map(|d| d.resolve(ctx.db)); |
219 | let kind = match resolved { | 181 | let kind = match resolved { |
220 | PerNs { | 182 | PerNs { |
@@ -259,7 +221,7 @@ impl<'a> Builder<'a> { | |||
259 | mut self, | 221 | mut self, |
260 | ctx: &CompletionContext, | 222 | ctx: &CompletionContext, |
261 | function: hir::Function, | 223 | function: hir::Function, |
262 | ) -> Builder<'a> { | 224 | ) -> Builder { |
263 | // If not an import, add parenthesis automatically. | 225 | // If not an import, add parenthesis automatically. |
264 | if ctx.use_item_syntax.is_none() && !ctx.is_call { | 226 | if ctx.use_item_syntax.is_none() && !ctx.is_call { |
265 | if function.signature(ctx.db).params().is_empty() { | 227 | if function.signature(ctx.db).params().is_empty() { |
@@ -274,7 +236,7 @@ impl<'a> Builder<'a> { | |||
274 | } | 236 | } |
275 | } | 237 | } |
276 | 238 | ||
277 | impl<'a> Into<CompletionItem> for Builder<'a> { | 239 | impl<'a> Into<CompletionItem> for Builder { |
278 | fn into(self) -> CompletionItem { | 240 | fn into(self) -> CompletionItem { |
279 | self.build() | 241 | self.build() |
280 | } | 242 | } |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.835266+00:00 | 1 | Created: 2019-01-19T16:37:23.674785+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [62; 100), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | }, | 18 | }, |
18 | CompletionItem { | 19 | CompletionItem { |
19 | completion_kind: Reference, | 20 | completion_kind: Reference, |
@@ -23,13 +24,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
23 | ), | 24 | ), |
24 | detail: None, | 25 | detail: None, |
25 | lookup: None, | 26 | lookup: None, |
26 | insert_text_format: Snippet, | 27 | insert_text: Some( |
27 | text_edit: Some( | 28 | "quux()$0" |
28 | AtomTextEdit { | ||
29 | delete: [62; 100), | ||
30 | insert: "quux()$0" | ||
31 | } | ||
32 | ), | 29 | ), |
33 | additional_text_edits: None | 30 | insert_text_format: Snippet, |
31 | replace_range: [62; 100), | ||
32 | delete_range: None | ||
34 | } | 33 | } |
35 | ] | 34 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.835796+00:00 | 1 | Created: 2019-01-19T16:37:23.676585+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [213; 231), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | }, | 18 | }, |
18 | CompletionItem { | 19 | CompletionItem { |
19 | completion_kind: Reference, | 20 | completion_kind: Reference, |
@@ -23,9 +24,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
23 | ), | 24 | ), |
24 | detail: None, | 25 | detail: None, |
25 | lookup: None, | 26 | lookup: None, |
27 | insert_text: None, | ||
26 | insert_text_format: PlainText, | 28 | insert_text_format: PlainText, |
27 | text_edit: None, | 29 | replace_range: [213; 231), |
28 | additional_text_edits: None | 30 | delete_range: None |
29 | }, | 31 | }, |
30 | CompletionItem { | 32 | CompletionItem { |
31 | completion_kind: Reference, | 33 | completion_kind: Reference, |
@@ -35,13 +37,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
35 | ), | 37 | ), |
36 | detail: None, | 38 | detail: None, |
37 | lookup: None, | 39 | lookup: None, |
38 | insert_text_format: Snippet, | 40 | insert_text: Some( |
39 | text_edit: Some( | 41 | "quux()$0" |
40 | AtomTextEdit { | ||
41 | delete: [213; 231), | ||
42 | insert: "quux()$0" | ||
43 | } | ||
44 | ), | 42 | ), |
45 | additional_text_edits: None | 43 | insert_text_format: Snippet, |
44 | replace_range: [213; 231), | ||
45 | delete_range: None | ||
46 | } | 46 | } |
47 | ] | 47 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.835351+00:00 | 1 | Created: 2019-01-19T16:37:23.676674+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [78; 79), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | }, | 18 | }, |
18 | CompletionItem { | 19 | CompletionItem { |
19 | completion_kind: Reference, | 20 | completion_kind: Reference, |
@@ -23,9 +24,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
23 | ), | 24 | ), |
24 | detail: None, | 25 | detail: None, |
25 | lookup: None, | 26 | lookup: None, |
27 | insert_text: None, | ||
26 | insert_text_format: PlainText, | 28 | insert_text_format: PlainText, |
27 | text_edit: None, | 29 | replace_range: [78; 79), |
28 | additional_text_edits: None | 30 | delete_range: None |
29 | }, | 31 | }, |
30 | CompletionItem { | 32 | CompletionItem { |
31 | completion_kind: Reference, | 33 | completion_kind: Reference, |
@@ -35,13 +37,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
35 | ), | 37 | ), |
36 | detail: None, | 38 | detail: None, |
37 | lookup: None, | 39 | lookup: None, |
38 | insert_text_format: Snippet, | 40 | insert_text: Some( |
39 | text_edit: Some( | 41 | "quux($0)" |
40 | AtomTextEdit { | ||
41 | delete: [78; 79), | ||
42 | insert: "quux($0)" | ||
43 | } | ||
44 | ), | 42 | ), |
45 | additional_text_edits: None | 43 | insert_text_format: Snippet, |
44 | replace_range: [78; 79), | ||
45 | delete_range: None | ||
46 | } | 46 | } |
47 | ] | 47 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.819543+00:00 | 1 | Created: 2019-01-19T16:37:23.630898+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "if $0 {}" |
16 | AtomTextEdit { | ||
17 | delete: [54; 56), | ||
18 | insert: "if $0 {}" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [54; 56), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Keyword, | 22 | completion_kind: Keyword, |
@@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
31 | insert_text_format: Snippet, | 29 | insert_text: Some( |
32 | text_edit: Some( | 30 | "match $0 {}" |
33 | AtomTextEdit { | ||
34 | delete: [54; 56), | ||
35 | insert: "match $0 {}" | ||
36 | } | ||
37 | ), | 31 | ), |
38 | additional_text_edits: None | 32 | insert_text_format: Snippet, |
33 | replace_range: [54; 56), | ||
34 | delete_range: None | ||
39 | }, | 35 | }, |
40 | CompletionItem { | 36 | CompletionItem { |
41 | completion_kind: Keyword, | 37 | completion_kind: Keyword, |
@@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
45 | ), | 41 | ), |
46 | detail: None, | 42 | detail: None, |
47 | lookup: None, | 43 | lookup: None, |
48 | insert_text_format: Snippet, | 44 | insert_text: Some( |
49 | text_edit: Some( | 45 | "while $0 {}" |
50 | AtomTextEdit { | ||
51 | delete: [54; 56), | ||
52 | insert: "while $0 {}" | ||
53 | } | ||
54 | ), | 46 | ), |
55 | additional_text_edits: None | 47 | insert_text_format: Snippet, |
48 | replace_range: [54; 56), | ||
49 | delete_range: None | ||
56 | }, | 50 | }, |
57 | CompletionItem { | 51 | CompletionItem { |
58 | completion_kind: Keyword, | 52 | completion_kind: Keyword, |
@@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
62 | ), | 56 | ), |
63 | detail: None, | 57 | detail: None, |
64 | lookup: None, | 58 | lookup: None, |
65 | insert_text_format: Snippet, | 59 | insert_text: Some( |
66 | text_edit: Some( | 60 | "loop {$0}" |
67 | AtomTextEdit { | ||
68 | delete: [54; 56), | ||
69 | insert: "loop {$0}" | ||
70 | } | ||
71 | ), | 61 | ), |
72 | additional_text_edits: None | 62 | insert_text_format: Snippet, |
63 | replace_range: [54; 56), | ||
64 | delete_range: None | ||
73 | }, | 65 | }, |
74 | CompletionItem { | 66 | CompletionItem { |
75 | completion_kind: Keyword, | 67 | completion_kind: Keyword, |
@@ -79,14 +71,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
79 | ), | 71 | ), |
80 | detail: None, | 72 | detail: None, |
81 | lookup: None, | 73 | lookup: None, |
82 | insert_text_format: Snippet, | 74 | insert_text: Some( |
83 | text_edit: Some( | 75 | "continue;" |
84 | AtomTextEdit { | ||
85 | delete: [54; 56), | ||
86 | insert: "continue;" | ||
87 | } | ||
88 | ), | 76 | ), |
89 | additional_text_edits: None | 77 | insert_text_format: Snippet, |
78 | replace_range: [54; 56), | ||
79 | delete_range: None | ||
90 | }, | 80 | }, |
91 | CompletionItem { | 81 | CompletionItem { |
92 | completion_kind: Keyword, | 82 | completion_kind: Keyword, |
@@ -96,14 +86,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
96 | ), | 86 | ), |
97 | detail: None, | 87 | detail: None, |
98 | lookup: None, | 88 | lookup: None, |
99 | insert_text_format: Snippet, | 89 | insert_text: Some( |
100 | text_edit: Some( | 90 | "break;" |
101 | AtomTextEdit { | ||
102 | delete: [54; 56), | ||
103 | insert: "break;" | ||
104 | } | ||
105 | ), | 91 | ), |
106 | additional_text_edits: None | 92 | insert_text_format: Snippet, |
93 | replace_range: [54; 56), | ||
94 | delete_range: None | ||
107 | }, | 95 | }, |
108 | CompletionItem { | 96 | CompletionItem { |
109 | completion_kind: Keyword, | 97 | completion_kind: Keyword, |
@@ -113,13 +101,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
113 | ), | 101 | ), |
114 | detail: None, | 102 | detail: None, |
115 | lookup: None, | 103 | lookup: None, |
116 | insert_text_format: Snippet, | 104 | insert_text: Some( |
117 | text_edit: Some( | 105 | "return $0;" |
118 | AtomTextEdit { | ||
119 | delete: [54; 56), | ||
120 | insert: "return $0;" | ||
121 | } | ||
122 | ), | 106 | ), |
123 | additional_text_edits: None | 107 | insert_text_format: Snippet, |
108 | replace_range: [54; 56), | ||
109 | delete_range: None | ||
124 | } | 110 | } |
125 | ] | 111 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.830288+00:00 | 1 | Created: 2019-01-19T16:37:23.647435+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "if $0 {}" |
16 | AtomTextEdit { | ||
17 | delete: [59; 61), | ||
18 | insert: "if $0 {}" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [59; 61), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Keyword, | 22 | completion_kind: Keyword, |
@@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
31 | insert_text_format: Snippet, | 29 | insert_text: Some( |
32 | text_edit: Some( | 30 | "match $0 {}" |
33 | AtomTextEdit { | ||
34 | delete: [59; 61), | ||
35 | insert: "match $0 {}" | ||
36 | } | ||
37 | ), | 31 | ), |
38 | additional_text_edits: None | 32 | insert_text_format: Snippet, |
33 | replace_range: [59; 61), | ||
34 | delete_range: None | ||
39 | }, | 35 | }, |
40 | CompletionItem { | 36 | CompletionItem { |
41 | completion_kind: Keyword, | 37 | completion_kind: Keyword, |
@@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
45 | ), | 41 | ), |
46 | detail: None, | 42 | detail: None, |
47 | lookup: None, | 43 | lookup: None, |
48 | insert_text_format: Snippet, | 44 | insert_text: Some( |
49 | text_edit: Some( | 45 | "while $0 {}" |
50 | AtomTextEdit { | ||
51 | delete: [59; 61), | ||
52 | insert: "while $0 {}" | ||
53 | } | ||
54 | ), | 46 | ), |
55 | additional_text_edits: None | 47 | insert_text_format: Snippet, |
48 | replace_range: [59; 61), | ||
49 | delete_range: None | ||
56 | }, | 50 | }, |
57 | CompletionItem { | 51 | CompletionItem { |
58 | completion_kind: Keyword, | 52 | completion_kind: Keyword, |
@@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
62 | ), | 56 | ), |
63 | detail: None, | 57 | detail: None, |
64 | lookup: None, | 58 | lookup: None, |
65 | insert_text_format: Snippet, | 59 | insert_text: Some( |
66 | text_edit: Some( | 60 | "loop {$0}" |
67 | AtomTextEdit { | ||
68 | delete: [59; 61), | ||
69 | insert: "loop {$0}" | ||
70 | } | ||
71 | ), | 61 | ), |
72 | additional_text_edits: None | 62 | insert_text_format: Snippet, |
63 | replace_range: [59; 61), | ||
64 | delete_range: None | ||
73 | }, | 65 | }, |
74 | CompletionItem { | 66 | CompletionItem { |
75 | completion_kind: Keyword, | 67 | completion_kind: Keyword, |
@@ -79,13 +71,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
79 | ), | 71 | ), |
80 | detail: None, | 72 | detail: None, |
81 | lookup: None, | 73 | lookup: None, |
82 | insert_text_format: Snippet, | 74 | insert_text: Some( |
83 | text_edit: Some( | 75 | "return $0;" |
84 | AtomTextEdit { | ||
85 | delete: [59; 61), | ||
86 | insert: "return $0;" | ||
87 | } | ||
88 | ), | 76 | ), |
89 | additional_text_edits: None | 77 | insert_text_format: Snippet, |
78 | replace_range: [59; 61), | ||
79 | delete_range: None | ||
90 | } | 80 | } |
91 | ] | 81 | ] |
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 @@ | |||
1 | Created: 2019-01-19T11:53:16.799862+00:00 | 1 | Created: 2019-01-19T16:37:23.649286+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,8 +11,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [23; 25), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | } | 18 | } |
18 | ] | 19 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.821375+00:00 | 1 | Created: 2019-01-19T16:37:23.640573+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "if $0 {}" |
16 | AtomTextEdit { | ||
17 | delete: [84; 102), | ||
18 | insert: "if $0 {}" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [84; 102), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Keyword, | 22 | completion_kind: Keyword, |
@@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
31 | insert_text_format: Snippet, | 29 | insert_text: Some( |
32 | text_edit: Some( | 30 | "match $0 {}" |
33 | AtomTextEdit { | ||
34 | delete: [84; 102), | ||
35 | insert: "match $0 {}" | ||
36 | } | ||
37 | ), | 31 | ), |
38 | additional_text_edits: None | 32 | insert_text_format: Snippet, |
33 | replace_range: [84; 102), | ||
34 | delete_range: None | ||
39 | }, | 35 | }, |
40 | CompletionItem { | 36 | CompletionItem { |
41 | completion_kind: Keyword, | 37 | completion_kind: Keyword, |
@@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
45 | ), | 41 | ), |
46 | detail: None, | 42 | detail: None, |
47 | lookup: None, | 43 | lookup: None, |
48 | insert_text_format: Snippet, | 44 | insert_text: Some( |
49 | text_edit: Some( | 45 | "while $0 {}" |
50 | AtomTextEdit { | ||
51 | delete: [84; 102), | ||
52 | insert: "while $0 {}" | ||
53 | } | ||
54 | ), | 46 | ), |
55 | additional_text_edits: None | 47 | insert_text_format: Snippet, |
48 | replace_range: [84; 102), | ||
49 | delete_range: None | ||
56 | }, | 50 | }, |
57 | CompletionItem { | 51 | CompletionItem { |
58 | completion_kind: Keyword, | 52 | completion_kind: Keyword, |
@@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
62 | ), | 56 | ), |
63 | detail: None, | 57 | detail: None, |
64 | lookup: None, | 58 | lookup: None, |
65 | insert_text_format: Snippet, | 59 | insert_text: Some( |
66 | text_edit: Some( | 60 | "loop {$0}" |
67 | AtomTextEdit { | ||
68 | delete: [84; 102), | ||
69 | insert: "loop {$0}" | ||
70 | } | ||
71 | ), | 61 | ), |
72 | additional_text_edits: None | 62 | insert_text_format: Snippet, |
63 | replace_range: [84; 102), | ||
64 | delete_range: None | ||
73 | }, | 65 | }, |
74 | CompletionItem { | 66 | CompletionItem { |
75 | completion_kind: Keyword, | 67 | completion_kind: Keyword, |
@@ -79,13 +71,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
79 | ), | 71 | ), |
80 | detail: None, | 72 | detail: None, |
81 | lookup: None, | 73 | lookup: None, |
82 | insert_text_format: Snippet, | 74 | insert_text: Some( |
83 | text_edit: Some( | 75 | "return $0" |
84 | AtomTextEdit { | ||
85 | delete: [84; 102), | ||
86 | insert: "return $0" | ||
87 | } | ||
88 | ), | 76 | ), |
89 | additional_text_edits: None | 77 | insert_text_format: Snippet, |
78 | replace_range: [84; 102), | ||
79 | delete_range: None | ||
90 | } | 80 | } |
91 | ] | 81 | ] |
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 @@ | |||
1 | Created: 2019-01-19T11:53:16.799845+00:00 | 1 | Created: 2019-01-19T16:37:23.670539+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [35; 39), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | }, | 18 | }, |
18 | CompletionItem { | 19 | CompletionItem { |
19 | completion_kind: Reference, | 20 | completion_kind: Reference, |
@@ -23,8 +24,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
23 | ), | 24 | ), |
24 | detail: None, | 25 | detail: None, |
25 | lookup: None, | 26 | lookup: None, |
27 | insert_text: None, | ||
26 | insert_text_format: PlainText, | 28 | insert_text_format: PlainText, |
27 | text_edit: None, | 29 | replace_range: [35; 39), |
28 | additional_text_edits: None | 30 | delete_range: None |
29 | } | 31 | } |
30 | ] | 32 | ] |
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 @@ | |||
1 | Created: 2019-01-19T11:53:16.799820+00:00 | 1 | Created: 2019-01-19T16:37:23.671764+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,8 +11,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [40; 41), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | } | 18 | } |
18 | ] | 19 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.841643+00:00 | 1 | Created: 2019-01-19T16:37:23.680378+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [108; 146), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | }, | 18 | }, |
18 | CompletionItem { | 19 | CompletionItem { |
19 | completion_kind: Reference, | 20 | completion_kind: Reference, |
@@ -23,13 +24,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
23 | ), | 24 | ), |
24 | detail: None, | 25 | detail: None, |
25 | lookup: None, | 26 | lookup: None, |
26 | insert_text_format: Snippet, | 27 | insert_text: Some( |
27 | text_edit: Some( | 28 | "foo()$0" |
28 | AtomTextEdit { | ||
29 | delete: [108; 146), | ||
30 | insert: "foo()$0" | ||
31 | } | ||
32 | ), | 29 | ), |
33 | additional_text_edits: None | 30 | insert_text_format: Snippet, |
31 | replace_range: [108; 146), | ||
32 | delete_range: None | ||
34 | } | 33 | } |
35 | ] | 34 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.844671+00:00 | 1 | Created: 2019-01-19T16:37:23.681170+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "no_args()$0" |
16 | AtomTextEdit { | ||
17 | delete: [53; 56), | ||
18 | insert: "no_args()$0" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [53; 56), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Reference, | 22 | completion_kind: Reference, |
@@ -28,13 +26,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
31 | insert_text_format: Snippet, | 29 | insert_text: Some( |
32 | text_edit: Some( | 30 | "main()$0" |
33 | AtomTextEdit { | ||
34 | delete: [53; 56), | ||
35 | insert: "main()$0" | ||
36 | } | ||
37 | ), | 31 | ), |
38 | additional_text_edits: None | 32 | insert_text_format: Snippet, |
33 | replace_range: [53; 56), | ||
34 | delete_range: None | ||
39 | } | 35 | } |
40 | ] | 36 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.849139+00:00 | 1 | Created: 2019-01-19T16:37:23.686781+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "main()$0" |
16 | AtomTextEdit { | ||
17 | delete: [72; 77), | ||
18 | insert: "main()$0" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [72; 77), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Reference, | 22 | completion_kind: Reference, |
@@ -28,13 +26,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
31 | insert_text_format: Snippet, | 29 | insert_text: Some( |
32 | text_edit: Some( | 30 | "with_args($0)" |
33 | AtomTextEdit { | ||
34 | delete: [72; 77), | ||
35 | insert: "with_args($0)" | ||
36 | } | ||
37 | ), | 31 | ), |
38 | additional_text_edits: None | 32 | insert_text_format: Snippet, |
33 | replace_range: [72; 77), | ||
34 | delete_range: None | ||
39 | } | 35 | } |
40 | ] | 36 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.819926+00:00 | 1 | Created: 2019-01-19T16:37:23.640068+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "if $0 {}" |
16 | AtomTextEdit { | ||
17 | delete: [24; 54), | ||
18 | insert: "if $0 {}" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [24; 54), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Keyword, | 22 | completion_kind: Keyword, |
@@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
31 | insert_text_format: Snippet, | 29 | insert_text: Some( |
32 | text_edit: Some( | 30 | "match $0 {}" |
33 | AtomTextEdit { | ||
34 | delete: [24; 54), | ||
35 | insert: "match $0 {}" | ||
36 | } | ||
37 | ), | 31 | ), |
38 | additional_text_edits: None | 32 | insert_text_format: Snippet, |
33 | replace_range: [24; 54), | ||
34 | delete_range: None | ||
39 | }, | 35 | }, |
40 | CompletionItem { | 36 | CompletionItem { |
41 | completion_kind: Keyword, | 37 | completion_kind: Keyword, |
@@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
45 | ), | 41 | ), |
46 | detail: None, | 42 | detail: None, |
47 | lookup: None, | 43 | lookup: None, |
48 | insert_text_format: Snippet, | 44 | insert_text: Some( |
49 | text_edit: Some( | 45 | "while $0 {}" |
50 | AtomTextEdit { | ||
51 | delete: [24; 54), | ||
52 | insert: "while $0 {}" | ||
53 | } | ||
54 | ), | 46 | ), |
55 | additional_text_edits: None | 47 | insert_text_format: Snippet, |
48 | replace_range: [24; 54), | ||
49 | delete_range: None | ||
56 | }, | 50 | }, |
57 | CompletionItem { | 51 | CompletionItem { |
58 | completion_kind: Keyword, | 52 | completion_kind: Keyword, |
@@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
62 | ), | 56 | ), |
63 | detail: None, | 57 | detail: None, |
64 | lookup: None, | 58 | lookup: None, |
65 | insert_text_format: Snippet, | 59 | insert_text: Some( |
66 | text_edit: Some( | 60 | "loop {$0}" |
67 | AtomTextEdit { | ||
68 | delete: [24; 54), | ||
69 | insert: "loop {$0}" | ||
70 | } | ||
71 | ), | 61 | ), |
72 | additional_text_edits: None | 62 | insert_text_format: Snippet, |
63 | replace_range: [24; 54), | ||
64 | delete_range: None | ||
73 | }, | 65 | }, |
74 | CompletionItem { | 66 | CompletionItem { |
75 | completion_kind: Keyword, | 67 | completion_kind: Keyword, |
@@ -79,13 +71,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
79 | ), | 71 | ), |
80 | detail: None, | 72 | detail: None, |
81 | lookup: None, | 73 | lookup: None, |
82 | insert_text_format: Snippet, | 74 | insert_text: Some( |
83 | text_edit: Some( | 75 | "return;" |
84 | AtomTextEdit { | ||
85 | delete: [24; 54), | ||
86 | insert: "return;" | ||
87 | } | ||
88 | ), | 76 | ), |
89 | additional_text_edits: None | 77 | insert_text_format: Snippet, |
78 | replace_range: [24; 54), | ||
79 | delete_range: None | ||
90 | } | 80 | } |
91 | ] | 81 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.819839+00:00 | 1 | Created: 2019-01-19T16:37:23.640134+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "if $0 {}" |
16 | AtomTextEdit { | ||
17 | delete: [91; 105), | ||
18 | insert: "if $0 {}" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [91; 105), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Keyword, | 22 | completion_kind: Keyword, |
@@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
31 | insert_text_format: Snippet, | 29 | insert_text: Some( |
32 | text_edit: Some( | 30 | "match $0 {}" |
33 | AtomTextEdit { | ||
34 | delete: [91; 105), | ||
35 | insert: "match $0 {}" | ||
36 | } | ||
37 | ), | 31 | ), |
38 | additional_text_edits: None | 32 | insert_text_format: Snippet, |
33 | replace_range: [91; 105), | ||
34 | delete_range: None | ||
39 | }, | 35 | }, |
40 | CompletionItem { | 36 | CompletionItem { |
41 | completion_kind: Keyword, | 37 | completion_kind: Keyword, |
@@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
45 | ), | 41 | ), |
46 | detail: None, | 42 | detail: None, |
47 | lookup: None, | 43 | lookup: None, |
48 | insert_text_format: Snippet, | 44 | insert_text: Some( |
49 | text_edit: Some( | 45 | "while $0 {}" |
50 | AtomTextEdit { | ||
51 | delete: [91; 105), | ||
52 | insert: "while $0 {}" | ||
53 | } | ||
54 | ), | 46 | ), |
55 | additional_text_edits: None | 47 | insert_text_format: Snippet, |
48 | replace_range: [91; 105), | ||
49 | delete_range: None | ||
56 | }, | 50 | }, |
57 | CompletionItem { | 51 | CompletionItem { |
58 | completion_kind: Keyword, | 52 | completion_kind: Keyword, |
@@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
62 | ), | 56 | ), |
63 | detail: None, | 57 | detail: None, |
64 | lookup: None, | 58 | lookup: None, |
65 | insert_text_format: Snippet, | 59 | insert_text: Some( |
66 | text_edit: Some( | 60 | "loop {$0}" |
67 | AtomTextEdit { | ||
68 | delete: [91; 105), | ||
69 | insert: "loop {$0}" | ||
70 | } | ||
71 | ), | 61 | ), |
72 | additional_text_edits: None | 62 | insert_text_format: Snippet, |
63 | replace_range: [91; 105), | ||
64 | delete_range: None | ||
73 | }, | 65 | }, |
74 | CompletionItem { | 66 | CompletionItem { |
75 | completion_kind: Keyword, | 67 | completion_kind: Keyword, |
@@ -79,14 +71,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
79 | ), | 71 | ), |
80 | detail: None, | 72 | detail: None, |
81 | lookup: None, | 73 | lookup: None, |
82 | insert_text_format: Snippet, | 74 | insert_text: Some( |
83 | text_edit: Some( | 75 | "else {$0}" |
84 | AtomTextEdit { | ||
85 | delete: [91; 105), | ||
86 | insert: "else {$0}" | ||
87 | } | ||
88 | ), | 76 | ), |
89 | additional_text_edits: None | 77 | insert_text_format: Snippet, |
78 | replace_range: [91; 105), | ||
79 | delete_range: None | ||
90 | }, | 80 | }, |
91 | CompletionItem { | 81 | CompletionItem { |
92 | completion_kind: Keyword, | 82 | completion_kind: Keyword, |
@@ -96,14 +86,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
96 | ), | 86 | ), |
97 | detail: None, | 87 | detail: None, |
98 | lookup: None, | 88 | lookup: None, |
99 | insert_text_format: Snippet, | 89 | insert_text: Some( |
100 | text_edit: Some( | 90 | "else if $0 {}" |
101 | AtomTextEdit { | ||
102 | delete: [91; 105), | ||
103 | insert: "else if $0 {}" | ||
104 | } | ||
105 | ), | 91 | ), |
106 | additional_text_edits: None | 92 | insert_text_format: Snippet, |
93 | replace_range: [91; 105), | ||
94 | delete_range: None | ||
107 | }, | 95 | }, |
108 | CompletionItem { | 96 | CompletionItem { |
109 | completion_kind: Keyword, | 97 | completion_kind: Keyword, |
@@ -113,13 +101,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
113 | ), | 101 | ), |
114 | detail: None, | 102 | detail: None, |
115 | lookup: None, | 103 | lookup: None, |
116 | insert_text_format: Snippet, | 104 | insert_text: Some( |
117 | text_edit: Some( | 105 | "return;" |
118 | AtomTextEdit { | ||
119 | delete: [91; 105), | ||
120 | insert: "return;" | ||
121 | } | ||
122 | ), | 106 | ), |
123 | additional_text_edits: None | 107 | insert_text_format: Snippet, |
108 | replace_range: [91; 105), | ||
109 | delete_range: None | ||
124 | } | 110 | } |
125 | ] | 111 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.822255+00:00 | 1 | Created: 2019-01-19T16:37:23.640767+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "if $0 {}" |
16 | AtomTextEdit { | ||
17 | delete: [31; 65), | ||
18 | insert: "if $0 {}" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [31; 65), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Keyword, | 22 | completion_kind: Keyword, |
@@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
31 | insert_text_format: Snippet, | 29 | insert_text: Some( |
32 | text_edit: Some( | 30 | "match $0 {}" |
33 | AtomTextEdit { | ||
34 | delete: [31; 65), | ||
35 | insert: "match $0 {}" | ||
36 | } | ||
37 | ), | 31 | ), |
38 | additional_text_edits: None | 32 | insert_text_format: Snippet, |
33 | replace_range: [31; 65), | ||
34 | delete_range: None | ||
39 | }, | 35 | }, |
40 | CompletionItem { | 36 | CompletionItem { |
41 | completion_kind: Keyword, | 37 | completion_kind: Keyword, |
@@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
45 | ), | 41 | ), |
46 | detail: None, | 42 | detail: None, |
47 | lookup: None, | 43 | lookup: None, |
48 | insert_text_format: Snippet, | 44 | insert_text: Some( |
49 | text_edit: Some( | 45 | "while $0 {}" |
50 | AtomTextEdit { | ||
51 | delete: [31; 65), | ||
52 | insert: "while $0 {}" | ||
53 | } | ||
54 | ), | 46 | ), |
55 | additional_text_edits: None | 47 | insert_text_format: Snippet, |
48 | replace_range: [31; 65), | ||
49 | delete_range: None | ||
56 | }, | 50 | }, |
57 | CompletionItem { | 51 | CompletionItem { |
58 | completion_kind: Keyword, | 52 | completion_kind: Keyword, |
@@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
62 | ), | 56 | ), |
63 | detail: None, | 57 | detail: None, |
64 | lookup: None, | 58 | lookup: None, |
65 | insert_text_format: Snippet, | 59 | insert_text: Some( |
66 | text_edit: Some( | 60 | "loop {$0}" |
67 | AtomTextEdit { | ||
68 | delete: [31; 65), | ||
69 | insert: "loop {$0}" | ||
70 | } | ||
71 | ), | 61 | ), |
72 | additional_text_edits: None | 62 | insert_text_format: Snippet, |
63 | replace_range: [31; 65), | ||
64 | delete_range: None | ||
73 | }, | 65 | }, |
74 | CompletionItem { | 66 | CompletionItem { |
75 | completion_kind: Keyword, | 67 | completion_kind: Keyword, |
@@ -79,13 +71,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
79 | ), | 71 | ), |
80 | detail: None, | 72 | detail: None, |
81 | lookup: None, | 73 | lookup: None, |
82 | insert_text_format: Snippet, | 74 | insert_text: Some( |
83 | text_edit: Some( | 75 | "return $0;" |
84 | AtomTextEdit { | ||
85 | delete: [31; 65), | ||
86 | insert: "return $0;" | ||
87 | } | ||
88 | ), | 76 | ), |
89 | additional_text_edits: None | 77 | insert_text_format: Snippet, |
78 | replace_range: [31; 65), | ||
79 | delete_range: None | ||
90 | } | 80 | } |
91 | ] | 81 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.830680+00:00 | 1 | Created: 2019-01-19T16:37:23.664707+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "if $0 {}" |
16 | AtomTextEdit { | ||
17 | delete: [24; 58), | ||
18 | insert: "if $0 {}" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [24; 58), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Keyword, | 22 | completion_kind: Keyword, |
@@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
31 | insert_text_format: Snippet, | 29 | insert_text: Some( |
32 | text_edit: Some( | 30 | "match $0 {}" |
33 | AtomTextEdit { | ||
34 | delete: [24; 58), | ||
35 | insert: "match $0 {}" | ||
36 | } | ||
37 | ), | 31 | ), |
38 | additional_text_edits: None | 32 | insert_text_format: Snippet, |
33 | replace_range: [24; 58), | ||
34 | delete_range: None | ||
39 | }, | 35 | }, |
40 | CompletionItem { | 36 | CompletionItem { |
41 | completion_kind: Keyword, | 37 | completion_kind: Keyword, |
@@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
45 | ), | 41 | ), |
46 | detail: None, | 42 | detail: None, |
47 | lookup: None, | 43 | lookup: None, |
48 | insert_text_format: Snippet, | 44 | insert_text: Some( |
49 | text_edit: Some( | 45 | "while $0 {}" |
50 | AtomTextEdit { | ||
51 | delete: [24; 58), | ||
52 | insert: "while $0 {}" | ||
53 | } | ||
54 | ), | 46 | ), |
55 | additional_text_edits: None | 47 | insert_text_format: Snippet, |
48 | replace_range: [24; 58), | ||
49 | delete_range: None | ||
56 | }, | 50 | }, |
57 | CompletionItem { | 51 | CompletionItem { |
58 | completion_kind: Keyword, | 52 | completion_kind: Keyword, |
@@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
62 | ), | 56 | ), |
63 | detail: None, | 57 | detail: None, |
64 | lookup: None, | 58 | lookup: None, |
65 | insert_text_format: Snippet, | 59 | insert_text: Some( |
66 | text_edit: Some( | 60 | "loop {$0}" |
67 | AtomTextEdit { | ||
68 | delete: [24; 58), | ||
69 | insert: "loop {$0}" | ||
70 | } | ||
71 | ), | 61 | ), |
72 | additional_text_edits: None | 62 | insert_text_format: Snippet, |
63 | replace_range: [24; 58), | ||
64 | delete_range: None | ||
73 | }, | 65 | }, |
74 | CompletionItem { | 66 | CompletionItem { |
75 | completion_kind: Keyword, | 67 | completion_kind: Keyword, |
@@ -79,13 +71,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
79 | ), | 71 | ), |
80 | detail: None, | 72 | detail: None, |
81 | lookup: None, | 73 | lookup: None, |
82 | insert_text_format: Snippet, | 74 | insert_text: Some( |
83 | text_edit: Some( | 75 | "return;" |
84 | AtomTextEdit { | ||
85 | delete: [24; 58), | ||
86 | insert: "return;" | ||
87 | } | ||
88 | ), | 76 | ), |
89 | additional_text_edits: None | 77 | insert_text_format: Snippet, |
78 | replace_range: [24; 58), | ||
79 | delete_range: None | ||
90 | } | 80 | } |
91 | ] | 81 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.819227+00:00 | 1 | Created: 2019-01-19T16:37:23.639067+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: PlainText, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "crate::" |
16 | AtomTextEdit { | ||
17 | delete: [16; 30), | ||
18 | insert: "crate::" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: PlainText, |
18 | replace_range: [16; 30), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Keyword, | 22 | completion_kind: Keyword, |
@@ -28,9 +26,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
29 | insert_text: None, | ||
31 | insert_text_format: PlainText, | 30 | insert_text_format: PlainText, |
32 | text_edit: None, | 31 | replace_range: [16; 30), |
33 | additional_text_edits: None | 32 | delete_range: None |
34 | }, | 33 | }, |
35 | CompletionItem { | 34 | CompletionItem { |
36 | completion_kind: Keyword, | 35 | completion_kind: Keyword, |
@@ -40,13 +39,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
40 | ), | 39 | ), |
41 | detail: None, | 40 | detail: None, |
42 | lookup: None, | 41 | lookup: None, |
43 | insert_text_format: PlainText, | 42 | insert_text: Some( |
44 | text_edit: Some( | 43 | "super::" |
45 | AtomTextEdit { | ||
46 | delete: [16; 30), | ||
47 | insert: "super::" | ||
48 | } | ||
49 | ), | 44 | ), |
50 | additional_text_edits: None | 45 | insert_text_format: PlainText, |
46 | replace_range: [16; 30), | ||
47 | delete_range: None | ||
51 | } | 48 | } |
52 | ] | 49 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.822990+00:00 | 1 | Created: 2019-01-19T16:37:23.643595+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [18; 20), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | }, | 18 | }, |
18 | CompletionItem { | 19 | CompletionItem { |
19 | completion_kind: Keyword, | 20 | completion_kind: Keyword, |
@@ -23,13 +24,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
23 | ), | 24 | ), |
24 | detail: None, | 25 | detail: None, |
25 | lookup: None, | 26 | lookup: None, |
26 | insert_text_format: PlainText, | 27 | insert_text: Some( |
27 | text_edit: Some( | 28 | "super::" |
28 | AtomTextEdit { | ||
29 | delete: [18; 20), | ||
30 | insert: "super::" | ||
31 | } | ||
32 | ), | 29 | ), |
33 | additional_text_edits: None | 30 | insert_text_format: PlainText, |
31 | replace_range: [18; 20), | ||
32 | delete_range: None | ||
34 | } | 33 | } |
35 | ] | 34 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.826915+00:00 | 1 | Created: 2019-01-19T16:37:23.648502+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [23; 24), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | }, | 18 | }, |
18 | CompletionItem { | 19 | CompletionItem { |
19 | completion_kind: Keyword, | 20 | completion_kind: Keyword, |
@@ -23,13 +24,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
23 | ), | 24 | ), |
24 | detail: None, | 25 | detail: None, |
25 | lookup: None, | 26 | lookup: None, |
26 | insert_text_format: PlainText, | 27 | insert_text: Some( |
27 | text_edit: Some( | 28 | "super::" |
28 | AtomTextEdit { | ||
29 | delete: [23; 24), | ||
30 | insert: "super::" | ||
31 | } | ||
32 | ), | 29 | ), |
33 | additional_text_edits: None | 30 | insert_text_format: PlainText, |
31 | replace_range: [23; 24), | ||
32 | delete_range: None | ||
34 | } | 33 | } |
35 | ] | 34 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.821139+00:00 | 1 | Created: 2019-01-19T16:37:23.640449+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "if $0 {}" |
16 | AtomTextEdit { | ||
17 | delete: [62; 100), | ||
18 | insert: "if $0 {}" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [62; 100), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Keyword, | 22 | completion_kind: Keyword, |
@@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
31 | insert_text_format: Snippet, | 29 | insert_text: Some( |
32 | text_edit: Some( | 30 | "match $0 {}" |
33 | AtomTextEdit { | ||
34 | delete: [62; 100), | ||
35 | insert: "match $0 {}" | ||
36 | } | ||
37 | ), | 31 | ), |
38 | additional_text_edits: None | 32 | insert_text_format: Snippet, |
33 | replace_range: [62; 100), | ||
34 | delete_range: None | ||
39 | }, | 35 | }, |
40 | CompletionItem { | 36 | CompletionItem { |
41 | completion_kind: Keyword, | 37 | completion_kind: Keyword, |
@@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
45 | ), | 41 | ), |
46 | detail: None, | 42 | detail: None, |
47 | lookup: None, | 43 | lookup: None, |
48 | insert_text_format: Snippet, | 44 | insert_text: Some( |
49 | text_edit: Some( | 45 | "while $0 {}" |
50 | AtomTextEdit { | ||
51 | delete: [62; 100), | ||
52 | insert: "while $0 {}" | ||
53 | } | ||
54 | ), | 46 | ), |
55 | additional_text_edits: None | 47 | insert_text_format: Snippet, |
48 | replace_range: [62; 100), | ||
49 | delete_range: None | ||
56 | }, | 50 | }, |
57 | CompletionItem { | 51 | CompletionItem { |
58 | completion_kind: Keyword, | 52 | completion_kind: Keyword, |
@@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
62 | ), | 56 | ), |
63 | detail: None, | 57 | detail: None, |
64 | lookup: None, | 58 | lookup: None, |
65 | insert_text_format: Snippet, | 59 | insert_text: Some( |
66 | text_edit: Some( | 60 | "loop {$0}" |
67 | AtomTextEdit { | ||
68 | delete: [62; 100), | ||
69 | insert: "loop {$0}" | ||
70 | } | ||
71 | ), | 61 | ), |
72 | additional_text_edits: None | 62 | insert_text_format: Snippet, |
63 | replace_range: [62; 100), | ||
64 | delete_range: None | ||
73 | }, | 65 | }, |
74 | CompletionItem { | 66 | CompletionItem { |
75 | completion_kind: Keyword, | 67 | completion_kind: Keyword, |
@@ -79,13 +71,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
79 | ), | 71 | ), |
80 | detail: None, | 72 | detail: None, |
81 | lookup: None, | 73 | lookup: None, |
82 | insert_text_format: Snippet, | 74 | insert_text: Some( |
83 | text_edit: Some( | 75 | "return $0;" |
84 | AtomTextEdit { | ||
85 | delete: [62; 100), | ||
86 | insert: "return $0;" | ||
87 | } | ||
88 | ), | 76 | ), |
89 | additional_text_edits: None | 77 | insert_text_format: Snippet, |
78 | replace_range: [62; 100), | ||
79 | delete_range: None | ||
90 | } | 80 | } |
91 | ] | 81 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.829078+00:00 | 1 | Created: 2019-01-19T16:37:23.649440+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "if $0 {}" |
16 | AtomTextEdit { | ||
17 | delete: [62; 100), | ||
18 | insert: "if $0 {}" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [62; 100), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Keyword, | 22 | completion_kind: Keyword, |
@@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
31 | insert_text_format: Snippet, | 29 | insert_text: Some( |
32 | text_edit: Some( | 30 | "match $0 {}" |
33 | AtomTextEdit { | ||
34 | delete: [62; 100), | ||
35 | insert: "match $0 {}" | ||
36 | } | ||
37 | ), | 31 | ), |
38 | additional_text_edits: None | 32 | insert_text_format: Snippet, |
33 | replace_range: [62; 100), | ||
34 | delete_range: None | ||
39 | }, | 35 | }, |
40 | CompletionItem { | 36 | CompletionItem { |
41 | completion_kind: Keyword, | 37 | completion_kind: Keyword, |
@@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
45 | ), | 41 | ), |
46 | detail: None, | 42 | detail: None, |
47 | lookup: None, | 43 | lookup: None, |
48 | insert_text_format: Snippet, | 44 | insert_text: Some( |
49 | text_edit: Some( | 45 | "while $0 {}" |
50 | AtomTextEdit { | ||
51 | delete: [62; 100), | ||
52 | insert: "while $0 {}" | ||
53 | } | ||
54 | ), | 46 | ), |
55 | additional_text_edits: None | 47 | insert_text_format: Snippet, |
48 | replace_range: [62; 100), | ||
49 | delete_range: None | ||
56 | }, | 50 | }, |
57 | CompletionItem { | 51 | CompletionItem { |
58 | completion_kind: Keyword, | 52 | completion_kind: Keyword, |
@@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
62 | ), | 56 | ), |
63 | detail: None, | 57 | detail: None, |
64 | lookup: None, | 58 | lookup: None, |
65 | insert_text_format: Snippet, | 59 | insert_text: Some( |
66 | text_edit: Some( | 60 | "loop {$0}" |
67 | AtomTextEdit { | ||
68 | delete: [62; 100), | ||
69 | insert: "loop {$0}" | ||
70 | } | ||
71 | ), | 61 | ), |
72 | additional_text_edits: None | 62 | insert_text_format: Snippet, |
63 | replace_range: [62; 100), | ||
64 | delete_range: None | ||
73 | }, | 65 | }, |
74 | CompletionItem { | 66 | CompletionItem { |
75 | completion_kind: Keyword, | 67 | completion_kind: Keyword, |
@@ -79,13 +71,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
79 | ), | 71 | ), |
80 | detail: None, | 72 | detail: None, |
81 | lookup: None, | 73 | lookup: None, |
82 | insert_text_format: Snippet, | 74 | insert_text: Some( |
83 | text_edit: Some( | 75 | "return $0;" |
84 | AtomTextEdit { | ||
85 | delete: [62; 100), | ||
86 | insert: "return $0;" | ||
87 | } | ||
88 | ), | 76 | ), |
89 | additional_text_edits: None | 77 | insert_text_format: Snippet, |
78 | replace_range: [62; 100), | ||
79 | delete_range: None | ||
90 | } | 80 | } |
91 | ] | 81 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.817204+00:00 | 1 | Created: 2019-01-19T16:37:23.629020+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,13 +11,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "the_method($0)" |
16 | AtomTextEdit { | ||
17 | delete: [143; 144), | ||
18 | insert: "the_method($0)" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [143; 144), | ||
19 | delete_range: None | ||
22 | } | 20 | } |
23 | ] | 21 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.835687+00:00 | 1 | Created: 2019-01-19T16:37:23.676740+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "quux()$0" |
16 | AtomTextEdit { | ||
17 | delete: [72; 102), | ||
18 | insert: "quux()$0" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [72; 102), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Reference, | 22 | completion_kind: Reference, |
@@ -28,9 +26,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
29 | insert_text: None, | ||
31 | insert_text_format: PlainText, | 30 | insert_text_format: PlainText, |
32 | text_edit: None, | 31 | replace_range: [72; 102), |
33 | additional_text_edits: None | 32 | delete_range: None |
34 | }, | 33 | }, |
35 | CompletionItem { | 34 | CompletionItem { |
36 | completion_kind: Reference, | 35 | completion_kind: Reference, |
@@ -40,8 +39,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
40 | ), | 39 | ), |
41 | detail: None, | 40 | detail: None, |
42 | lookup: None, | 41 | lookup: None, |
42 | insert_text: None, | ||
43 | insert_text_format: PlainText, | 43 | insert_text_format: PlainText, |
44 | text_edit: None, | 44 | replace_range: [72; 102), |
45 | additional_text_edits: None | 45 | delete_range: None |
46 | } | 46 | } |
47 | ] | 47 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.836102+00:00 | 1 | Created: 2019-01-19T16:37:23.677905+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "quux()$0" |
16 | AtomTextEdit { | ||
17 | delete: [100; 102), | ||
18 | insert: "quux()$0" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [100; 102), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Reference, | 22 | completion_kind: Reference, |
@@ -28,8 +26,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
29 | insert_text: None, | ||
31 | insert_text_format: PlainText, | 30 | insert_text_format: PlainText, |
32 | text_edit: None, | 31 | replace_range: [100; 102), |
33 | additional_text_edits: None | 32 | delete_range: None |
34 | } | 33 | } |
35 | ] | 34 | ] |
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 @@ | |||
1 | Created: 2019-01-19T11:53:16.799743+00:00 | 1 | Created: 2019-01-19T16:37:23.666350+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [12; 14), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | }, | 18 | }, |
18 | CompletionItem { | 19 | CompletionItem { |
19 | completion_kind: Reference, | 20 | completion_kind: Reference, |
@@ -23,8 +24,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
23 | ), | 24 | ), |
24 | detail: None, | 25 | detail: None, |
25 | lookup: None, | 26 | lookup: None, |
27 | insert_text: None, | ||
26 | insert_text_format: PlainText, | 28 | insert_text_format: PlainText, |
27 | text_edit: None, | 29 | replace_range: [12; 14), |
28 | additional_text_edits: None | 30 | delete_range: None |
29 | } | 31 | } |
30 | ] | 32 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.821881+00:00 | 1 | Created: 2019-01-19T16:37:23.640842+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "if $0 {}" |
16 | AtomTextEdit { | ||
17 | delete: [106; 108), | ||
18 | insert: "if $0 {}" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [106; 108), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Keyword, | 22 | completion_kind: Keyword, |
@@ -28,14 +26,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
31 | insert_text_format: Snippet, | 29 | insert_text: Some( |
32 | text_edit: Some( | 30 | "match $0 {}" |
33 | AtomTextEdit { | ||
34 | delete: [106; 108), | ||
35 | insert: "match $0 {}" | ||
36 | } | ||
37 | ), | 31 | ), |
38 | additional_text_edits: None | 32 | insert_text_format: Snippet, |
33 | replace_range: [106; 108), | ||
34 | delete_range: None | ||
39 | }, | 35 | }, |
40 | CompletionItem { | 36 | CompletionItem { |
41 | completion_kind: Keyword, | 37 | completion_kind: Keyword, |
@@ -45,14 +41,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
45 | ), | 41 | ), |
46 | detail: None, | 42 | detail: None, |
47 | lookup: None, | 43 | lookup: None, |
48 | insert_text_format: Snippet, | 44 | insert_text: Some( |
49 | text_edit: Some( | 45 | "while $0 {}" |
50 | AtomTextEdit { | ||
51 | delete: [106; 108), | ||
52 | insert: "while $0 {}" | ||
53 | } | ||
54 | ), | 46 | ), |
55 | additional_text_edits: None | 47 | insert_text_format: Snippet, |
48 | replace_range: [106; 108), | ||
49 | delete_range: None | ||
56 | }, | 50 | }, |
57 | CompletionItem { | 51 | CompletionItem { |
58 | completion_kind: Keyword, | 52 | completion_kind: Keyword, |
@@ -62,14 +56,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
62 | ), | 56 | ), |
63 | detail: None, | 57 | detail: None, |
64 | lookup: None, | 58 | lookup: None, |
65 | insert_text_format: Snippet, | 59 | insert_text: Some( |
66 | text_edit: Some( | 60 | "loop {$0}" |
67 | AtomTextEdit { | ||
68 | delete: [106; 108), | ||
69 | insert: "loop {$0}" | ||
70 | } | ||
71 | ), | 61 | ), |
72 | additional_text_edits: None | 62 | insert_text_format: Snippet, |
63 | replace_range: [106; 108), | ||
64 | delete_range: None | ||
73 | }, | 65 | }, |
74 | CompletionItem { | 66 | CompletionItem { |
75 | completion_kind: Keyword, | 67 | completion_kind: Keyword, |
@@ -79,14 +71,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
79 | ), | 71 | ), |
80 | detail: None, | 72 | detail: None, |
81 | lookup: None, | 73 | lookup: None, |
82 | insert_text_format: Snippet, | 74 | insert_text: Some( |
83 | text_edit: Some( | 75 | "continue" |
84 | AtomTextEdit { | ||
85 | delete: [106; 108), | ||
86 | insert: "continue" | ||
87 | } | ||
88 | ), | 76 | ), |
89 | additional_text_edits: None | 77 | insert_text_format: Snippet, |
78 | replace_range: [106; 108), | ||
79 | delete_range: None | ||
90 | }, | 80 | }, |
91 | CompletionItem { | 81 | CompletionItem { |
92 | completion_kind: Keyword, | 82 | completion_kind: Keyword, |
@@ -96,14 +86,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
96 | ), | 86 | ), |
97 | detail: None, | 87 | detail: None, |
98 | lookup: None, | 88 | lookup: None, |
99 | insert_text_format: Snippet, | 89 | insert_text: Some( |
100 | text_edit: Some( | 90 | "break" |
101 | AtomTextEdit { | ||
102 | delete: [106; 108), | ||
103 | insert: "break" | ||
104 | } | ||
105 | ), | 91 | ), |
106 | additional_text_edits: None | 92 | insert_text_format: Snippet, |
93 | replace_range: [106; 108), | ||
94 | delete_range: None | ||
107 | }, | 95 | }, |
108 | CompletionItem { | 96 | CompletionItem { |
109 | completion_kind: Keyword, | 97 | completion_kind: Keyword, |
@@ -113,13 +101,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
113 | ), | 101 | ), |
114 | detail: None, | 102 | detail: None, |
115 | lookup: None, | 103 | lookup: None, |
116 | insert_text_format: Snippet, | 104 | insert_text: Some( |
117 | text_edit: Some( | 105 | "return" |
118 | AtomTextEdit { | ||
119 | delete: [106; 108), | ||
120 | insert: "return" | ||
121 | } | ||
122 | ), | 106 | ), |
123 | additional_text_edits: None | 107 | insert_text_format: Snippet, |
108 | replace_range: [106; 108), | ||
109 | delete_range: None | ||
124 | } | 110 | } |
125 | ] | 111 | ] |
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 @@ | |||
1 | Created: 2019-01-19T11:27:14.070727+00:00 | 1 | Created: 2019-01-19T16:37:23.629063+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,8 +11,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | lookup: Some( | 11 | lookup: Some( |
12 | "file_id" | 12 | "file_id" |
13 | ), | 13 | ), |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [98; 102), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | } | 18 | } |
18 | ] | 19 | ] |
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 @@ | |||
1 | Created: 2019-01-19T11:29:09.355053+00:00 | 1 | Created: 2019-01-19T16:37:23.629062+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,8 +11,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | lookup: Some( | 11 | lookup: Some( |
12 | "file_id" | 12 | "file_id" |
13 | ), | 13 | ), |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [98; 102), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | } | 18 | } |
18 | ] | 19 | ] |
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 @@ | |||
1 | Created: 2019-01-19T11:29:09.355066+00:00 | 1 | Created: 2019-01-19T16:37:23.630980+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,8 +11,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | lookup: Some( | 11 | lookup: Some( |
12 | "file_id" | 12 | "file_id" |
13 | ), | 13 | ), |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [269; 273), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | } | 18 | } |
18 | ] | 19 | ] |
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 @@ | |||
1 | Created: 2019-01-19T11:53:16.799765+00:00 | 1 | Created: 2019-01-19T16:37:23.664242+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [45; 47), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | }, | 18 | }, |
18 | CompletionItem { | 19 | CompletionItem { |
19 | completion_kind: Reference, | 20 | completion_kind: Reference, |
@@ -23,8 +24,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
23 | ), | 24 | ), |
24 | detail: None, | 25 | detail: None, |
25 | lookup: None, | 26 | lookup: None, |
27 | insert_text: None, | ||
26 | insert_text_format: PlainText, | 28 | insert_text_format: PlainText, |
27 | text_edit: None, | 29 | replace_range: [45; 47), |
28 | additional_text_edits: None | 30 | delete_range: None |
29 | } | 31 | } |
30 | ] | 32 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.837692+00:00 | 1 | Created: 2019-01-19T16:37:23.678426+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [46; 60), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | }, | 18 | }, |
18 | CompletionItem { | 19 | CompletionItem { |
19 | completion_kind: Reference, | 20 | completion_kind: Reference, |
@@ -23,13 +24,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
23 | ), | 24 | ), |
24 | detail: None, | 25 | detail: None, |
25 | lookup: None, | 26 | lookup: None, |
26 | insert_text_format: Snippet, | 27 | insert_text: Some( |
27 | text_edit: Some( | 28 | "x()$0" |
28 | AtomTextEdit { | ||
29 | delete: [46; 60), | ||
30 | insert: "x()$0" | ||
31 | } | ||
32 | ), | 29 | ), |
33 | additional_text_edits: None | 30 | insert_text_format: Snippet, |
31 | replace_range: [46; 60), | ||
32 | delete_range: None | ||
34 | } | 33 | } |
35 | ] | 34 | ] |
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 @@ | |||
1 | Created: 2019-01-19T11:59:18.394156+00:00 | 1 | Created: 2019-01-19T16:37:23.679470+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,8 +11,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [24; 26), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | } | 18 | } |
18 | ] | 19 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.844708+00:00 | 1 | Created: 2019-01-19T16:37:23.681192+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,14 +11,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text_format: Snippet, | 14 | insert_text: Some( |
15 | text_edit: Some( | 15 | "eprintln!(\"$0 = {:?}\", $0);" |
16 | AtomTextEdit { | ||
17 | delete: [16; 18), | ||
18 | insert: "eprintln!(\"$0 = {:?}\", $0);" | ||
19 | } | ||
20 | ), | 16 | ), |
21 | additional_text_edits: None | 17 | insert_text_format: Snippet, |
18 | replace_range: [16; 18), | ||
19 | delete_range: None | ||
22 | }, | 20 | }, |
23 | CompletionItem { | 21 | CompletionItem { |
24 | completion_kind: Snippet, | 22 | completion_kind: Snippet, |
@@ -28,13 +26,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
28 | ), | 26 | ), |
29 | detail: None, | 27 | detail: None, |
30 | lookup: None, | 28 | lookup: None, |
31 | insert_text_format: Snippet, | 29 | insert_text: Some( |
32 | text_edit: Some( | 30 | "eprintln!(\"$0 = {:#?}\", $0);" |
33 | AtomTextEdit { | ||
34 | delete: [16; 18), | ||
35 | insert: "eprintln!(\"$0 = {:#?}\", $0);" | ||
36 | } | ||
37 | ), | 31 | ), |
38 | additional_text_edits: None | 32 | insert_text_format: Snippet, |
33 | replace_range: [16; 18), | ||
34 | delete_range: None | ||
39 | } | 35 | } |
40 | ] | 36 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.845616+00:00 | 1 | Created: 2019-01-19T16:37:23.682017+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -13,14 +13,12 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
13 | lookup: Some( | 13 | lookup: Some( |
14 | "tfn" | 14 | "tfn" |
15 | ), | 15 | ), |
16 | insert_text_format: Snippet, | 16 | insert_text: Some( |
17 | text_edit: Some( | 17 | "#[test]\nfn ${1:feature}() {\n $0\n}" |
18 | AtomTextEdit { | ||
19 | delete: [49; 79), | ||
20 | insert: "#[test]\nfn ${1:feature}() {\n $0\n}" | ||
21 | } | ||
22 | ), | 18 | ), |
23 | additional_text_edits: None | 19 | insert_text_format: Snippet, |
20 | replace_range: [49; 79), | ||
21 | delete_range: None | ||
24 | }, | 22 | }, |
25 | CompletionItem { | 23 | CompletionItem { |
26 | completion_kind: Snippet, | 24 | completion_kind: Snippet, |
@@ -30,13 +28,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
30 | ), | 28 | ), |
31 | detail: None, | 29 | detail: None, |
32 | lookup: None, | 30 | lookup: None, |
33 | insert_text_format: Snippet, | 31 | insert_text: Some( |
34 | text_edit: Some( | 32 | "pub(crate) $0" |
35 | AtomTextEdit { | ||
36 | delete: [49; 79), | ||
37 | insert: "pub(crate) $0" | ||
38 | } | ||
39 | ), | 33 | ), |
40 | additional_text_edits: None | 34 | insert_text_format: Snippet, |
35 | replace_range: [49; 79), | ||
36 | delete_range: None | ||
41 | } | 37 | } |
42 | ] | 38 | ] |
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 @@ | |||
1 | Created: 2019-01-19T11:34:11.702218+00:00 | 1 | Created: 2019-01-19T16:37:23.628928+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -13,8 +13,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
13 | "u32" | 13 | "u32" |
14 | ), | 14 | ), |
15 | lookup: None, | 15 | lookup: None, |
16 | insert_text: None, | ||
16 | insert_text_format: PlainText, | 17 | insert_text_format: PlainText, |
17 | text_edit: None, | 18 | replace_range: [84; 85), |
18 | additional_text_edits: None | 19 | delete_range: None |
19 | } | 20 | } |
20 | ] | 21 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.817216+00:00 | 1 | Created: 2019-01-19T16:37:23.629043+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -13,9 +13,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
13 | "(u32, i32)" | 13 | "(u32, i32)" |
14 | ), | 14 | ), |
15 | lookup: None, | 15 | lookup: None, |
16 | insert_text: None, | ||
16 | insert_text_format: PlainText, | 17 | insert_text_format: PlainText, |
17 | text_edit: None, | 18 | replace_range: [125; 126), |
18 | additional_text_edits: None | 19 | delete_range: None |
19 | }, | 20 | }, |
20 | CompletionItem { | 21 | CompletionItem { |
21 | completion_kind: Reference, | 22 | completion_kind: Reference, |
@@ -25,13 +26,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
25 | ), | 26 | ), |
26 | detail: None, | 27 | detail: None, |
27 | lookup: None, | 28 | lookup: None, |
28 | insert_text_format: Snippet, | 29 | insert_text: Some( |
29 | text_edit: Some( | 30 | "foo($0)" |
30 | AtomTextEdit { | ||
31 | delete: [125; 126), | ||
32 | insert: "foo($0)" | ||
33 | } | ||
34 | ), | 31 | ), |
35 | additional_text_edits: None | 32 | insert_text_format: Snippet, |
33 | replace_range: [125; 126), | ||
34 | delete_range: None | ||
36 | } | 35 | } |
37 | ] | 36 | ] |
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 @@ | |||
1 | Created: 2019-01-19T13:42:17.817207+00:00 | 1 | Created: 2019-01-19T16:37:23.629041+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -13,9 +13,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
13 | "(u32,)" | 13 | "(u32,)" |
14 | ), | 14 | ), |
15 | lookup: None, | 15 | lookup: None, |
16 | insert_text: None, | ||
16 | insert_text_format: PlainText, | 17 | insert_text_format: PlainText, |
17 | text_edit: None, | 18 | replace_range: [120; 121), |
18 | additional_text_edits: None | 19 | delete_range: None |
19 | }, | 20 | }, |
20 | CompletionItem { | 21 | CompletionItem { |
21 | completion_kind: Reference, | 22 | completion_kind: Reference, |
@@ -25,13 +26,11 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
25 | ), | 26 | ), |
26 | detail: None, | 27 | detail: None, |
27 | lookup: None, | 28 | lookup: None, |
28 | insert_text_format: Snippet, | 29 | insert_text: Some( |
29 | text_edit: Some( | 30 | "foo($0)" |
30 | AtomTextEdit { | ||
31 | delete: [120; 121), | ||
32 | insert: "foo($0)" | ||
33 | } | ||
34 | ), | 31 | ), |
35 | additional_text_edits: None | 32 | insert_text_format: Snippet, |
33 | replace_range: [120; 121), | ||
34 | delete_range: None | ||
36 | } | 35 | } |
37 | ] | 36 | ] |
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 @@ | |||
1 | Created: 2019-01-19T11:53:16.799683+00:00 | 1 | Created: 2019-01-19T16:37:23.667522+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,9 +11,10 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [11; 13), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | }, | 18 | }, |
18 | CompletionItem { | 19 | CompletionItem { |
19 | completion_kind: Reference, | 20 | completion_kind: Reference, |
@@ -23,8 +24,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
23 | ), | 24 | ), |
24 | detail: None, | 25 | detail: None, |
25 | lookup: None, | 26 | lookup: None, |
27 | insert_text: None, | ||
26 | insert_text_format: PlainText, | 28 | insert_text_format: PlainText, |
27 | text_edit: None, | 29 | replace_range: [11; 13), |
28 | additional_text_edits: None | 30 | delete_range: None |
29 | } | 31 | } |
30 | ] | 32 | ] |
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 @@ | |||
1 | Created: 2019-01-19T11:53:16.799788+00:00 | 1 | Created: 2019-01-19T16:37:23.669476+00:00 |
2 | Creator: [email protected] | 2 | Creator: [email protected] |
3 | Source: crates/ra_ide_api/src/completion/completion_item.rs | 3 | Source: crates/ra_ide_api/src/completion/completion_item.rs |
4 | 4 | ||
@@ -11,8 +11,9 @@ Source: crates/ra_ide_api/src/completion/completion_item.rs | |||
11 | ), | 11 | ), |
12 | detail: None, | 12 | detail: None, |
13 | lookup: None, | 13 | lookup: None, |
14 | insert_text: None, | ||
14 | insert_text_format: PlainText, | 15 | insert_text_format: PlainText, |
15 | text_edit: None, | 16 | replace_range: [24; 26), |
16 | additional_text_edits: None | 17 | delete_range: None |
17 | } | 18 | } |
18 | ] | 19 | ] |
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index 76215a975..54a977b7a 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs | |||
@@ -13,6 +13,7 @@ use ra_syntax::{SyntaxKind, TextRange, TextUnit}; | |||
13 | use ra_text_edit::{AtomTextEdit, TextEdit}; | 13 | use ra_text_edit::{AtomTextEdit, TextEdit}; |
14 | 14 | ||
15 | use crate::{req, server_world::ServerWorld, Result}; | 15 | use crate::{req, server_world::ServerWorld, Result}; |
16 | use ra_text_edit::TextEditBuilder; | ||
16 | 17 | ||
17 | pub trait Conv { | 18 | pub trait Conv { |
18 | type Output; | 19 | type Output; |
@@ -78,19 +79,24 @@ impl ConvWith for CompletionItem { | |||
78 | type Ctx = LineIndex; | 79 | type Ctx = LineIndex; |
79 | type Output = ::lsp_types::CompletionItem; | 80 | type Output = ::lsp_types::CompletionItem; |
80 | 81 | ||
81 | fn conv_with(mut self, ctx: &LineIndex) -> ::lsp_types::CompletionItem { | 82 | fn conv_with(self, ctx: &LineIndex) -> ::lsp_types::CompletionItem { |
82 | let text_edit = self.text_edit().map(|t| t.conv_with(ctx)); | 83 | let atom_text_edit = AtomTextEdit::replace(self.replace_range(), self.insert_text()); |
83 | let additonal_text_edit = self | 84 | let text_edit = (&atom_text_edit).conv_with(ctx); |
84 | .take_additional_text_edits() | 85 | let additional_text_edits = if let Some(delete_range) = self.delete_range() { |
85 | .map(|it| it.conv_with(ctx)); | 86 | let mut builder = TextEditBuilder::default(); |
87 | builder.delete(delete_range); | ||
88 | Some(builder.finish().conv_with(ctx)) | ||
89 | } else { | ||
90 | None | ||
91 | }; | ||
86 | 92 | ||
87 | let mut res = lsp_types::CompletionItem { | 93 | let mut res = lsp_types::CompletionItem { |
88 | label: self.label().to_string(), | 94 | label: self.label().to_string(), |
89 | detail: self.detail().map(|it| it.to_string()), | 95 | detail: self.detail().map(|it| it.to_string()), |
90 | filter_text: Some(self.lookup().to_string()), | 96 | filter_text: Some(self.lookup().to_string()), |
91 | kind: self.kind().map(|it| it.conv()), | 97 | kind: self.kind().map(|it| it.conv()), |
92 | text_edit, | 98 | text_edit: Some(text_edit), |
93 | additional_text_edits: additonal_text_edit, | 99 | additional_text_edits, |
94 | ..Default::default() | 100 | ..Default::default() |
95 | }; | 101 | }; |
96 | res.insert_text_format = Some(match self.insert_text_format() { | 102 | res.insert_text_format = Some(match self.insert_text_format() { |