aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/completion.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-12-12 07:52:38 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-12-12 07:52:38 +0000
commit0156a538089828340a823ed02da8970bf4f1175b (patch)
tree07c4eacaad717ea802ab26972f45223281f2c9c1 /crates/ra_analysis/src/completion.rs
parentf655f993fe6d9faa81b0e776b9b24308d2ea1c68 (diff)
parent0527e3b283af0153cf13fa64fe73862a5b7655c8 (diff)
Merge #276
276: Extract and rename AtomEdit and Edit into ra_text_edit r=matklad a=vemoo As discused in #105 Co-authored-by: Bernardo <[email protected]>
Diffstat (limited to 'crates/ra_analysis/src/completion.rs')
-rw-r--r--crates/ra_analysis/src/completion.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_analysis/src/completion.rs b/crates/ra_analysis/src/completion.rs
index 0f154112a..f480af611 100644
--- a/crates/ra_analysis/src/completion.rs
+++ b/crates/ra_analysis/src/completion.rs
@@ -1,10 +1,11 @@
1mod reference_completion; 1mod reference_completion;
2 2
3use ra_editor::find_node_at_offset; 3use ra_editor::find_node_at_offset;
4use ra_text_edit::AtomTextEdit;
4use ra_syntax::{ 5use ra_syntax::{
5 algo::visit::{visitor_ctx, VisitorCtx}, 6 algo::visit::{visitor_ctx, VisitorCtx},
6 ast, 7 ast,
7 AstNode, AtomEdit, 8 AstNode,
8 SyntaxNodeRef, 9 SyntaxNodeRef,
9}; 10};
10use ra_db::SyntaxDatabase; 11use ra_db::SyntaxDatabase;
@@ -33,7 +34,7 @@ pub(crate) fn completions(
33 let original_file = db.source_file(position.file_id); 34 let original_file = db.source_file(position.file_id);
34 // Insert a fake ident to get a valid parse tree 35 // Insert a fake ident to get a valid parse tree
35 let file = { 36 let file = {
36 let edit = AtomEdit::insert(position.offset, "intellijRulezz".to_string()); 37 let edit = AtomTextEdit::insert(position.offset, "intellijRulezz".to_string());
37 original_file.reparse(&edit) 38 original_file.reparse(&edit)
38 }; 39 };
39 40