aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion/complete_trait_impl.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-04-24 22:40:41 +0100
committerAleksey Kladov <[email protected]>2020-04-25 10:59:18 +0100
commitb1d5817dd18b7b5fc102a63b084b1ee7ff4f9996 (patch)
treee5d136c5ba4a6ba96aeeb423e6e3f64ca7cea3f9 /crates/ra_ide/src/completion/complete_trait_impl.rs
parent27a7718880d93f55f905da606d108d3b3c682ab4 (diff)
Convert code to text-size
Diffstat (limited to 'crates/ra_ide/src/completion/complete_trait_impl.rs')
-rw-r--r--crates/ra_ide/src/completion/complete_trait_impl.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide/src/completion/complete_trait_impl.rs b/crates/ra_ide/src/completion/complete_trait_impl.rs
index c39943252..e2a8c59cd 100644
--- a/crates/ra_ide/src/completion/complete_trait_impl.rs
+++ b/crates/ra_ide/src/completion/complete_trait_impl.rs
@@ -141,7 +141,7 @@ fn add_function_impl(
141 } else { 141 } else {
142 CompletionItemKind::Function 142 CompletionItemKind::Function
143 }; 143 };
144 let range = TextRange::from_to(fn_def_node.text_range().start(), ctx.source_range().end()); 144 let range = TextRange::new(fn_def_node.text_range().start(), ctx.source_range().end());
145 145
146 match ctx.config.snippet_cap { 146 match ctx.config.snippet_cap {
147 Some(cap) => { 147 Some(cap) => {
@@ -167,7 +167,7 @@ fn add_type_alias_impl(
167 167
168 let snippet = format!("type {} = ", alias_name); 168 let snippet = format!("type {} = ", alias_name);
169 169
170 let range = TextRange::from_to(type_def_node.text_range().start(), ctx.source_range().end()); 170 let range = TextRange::new(type_def_node.text_range().start(), ctx.source_range().end());
171 171
172 CompletionItem::new(CompletionKind::Magic, ctx.source_range(), snippet.clone()) 172 CompletionItem::new(CompletionKind::Magic, ctx.source_range(), snippet.clone())
173 .text_edit(TextEdit::replace(range, snippet)) 173 .text_edit(TextEdit::replace(range, snippet))
@@ -189,7 +189,7 @@ fn add_const_impl(
189 let snippet = make_const_compl_syntax(&const_.source(ctx.db).value); 189 let snippet = make_const_compl_syntax(&const_.source(ctx.db).value);
190 190
191 let range = 191 let range =
192 TextRange::from_to(const_def_node.text_range().start(), ctx.source_range().end()); 192 TextRange::new(const_def_node.text_range().start(), ctx.source_range().end());
193 193
194 CompletionItem::new(CompletionKind::Magic, ctx.source_range(), snippet.clone()) 194 CompletionItem::new(CompletionKind::Magic, ctx.source_range(), snippet.clone())
195 .text_edit(TextEdit::replace(range, snippet)) 195 .text_edit(TextEdit::replace(range, snippet))
@@ -216,7 +216,7 @@ fn make_const_compl_syntax(const_: &ast::ConstDef) -> String {
216 .map_or(const_end, |f| f.text_range().start()); 216 .map_or(const_end, |f| f.text_range().start());
217 217
218 let len = end - start; 218 let len = end - start;
219 let range = TextRange::from_to(0.into(), len); 219 let range = TextRange::new(0.into(), len);
220 220
221 let syntax = const_.syntax().text().slice(range).to_string(); 221 let syntax = const_.syntax().text().slice(range).to_string();
222 222