diff options
Diffstat (limited to 'crates/ra_analysis')
-rw-r--r-- | crates/ra_analysis/Cargo.toml | 1 | ||||
-rw-r--r-- | crates/ra_analysis/src/completion.rs | 5 | ||||
-rw-r--r-- | crates/ra_analysis/src/lib.rs | 5 |
3 files changed, 7 insertions, 4 deletions
diff --git a/crates/ra_analysis/Cargo.toml b/crates/ra_analysis/Cargo.toml index fe9765a66..4a7b99947 100644 --- a/crates/ra_analysis/Cargo.toml +++ b/crates/ra_analysis/Cargo.toml | |||
@@ -14,6 +14,7 @@ rustc-hash = "1.0" | |||
14 | parking_lot = "0.6.4" | 14 | parking_lot = "0.6.4" |
15 | ra_syntax = { path = "../ra_syntax" } | 15 | ra_syntax = { path = "../ra_syntax" } |
16 | ra_editor = { path = "../ra_editor" } | 16 | ra_editor = { path = "../ra_editor" } |
17 | ra_text_edit = { path = "../ra_text_edit" } | ||
17 | ra_db = { path = "../ra_db" } | 18 | ra_db = { path = "../ra_db" } |
18 | hir = { path = "../ra_hir", package = "ra_hir" } | 19 | hir = { path = "../ra_hir", package = "ra_hir" } |
19 | test_utils = { path = "../test_utils" } | 20 | test_utils = { path = "../test_utils" } |
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 @@ | |||
1 | mod reference_completion; | 1 | mod reference_completion; |
2 | 2 | ||
3 | use ra_editor::find_node_at_offset; | 3 | use ra_editor::find_node_at_offset; |
4 | use ra_text_edit::AtomTextEdit; | ||
4 | use ra_syntax::{ | 5 | use 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 | }; |
10 | use ra_db::SyntaxDatabase; | 11 | use 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 | ||
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index eaf24cb36..22fff71ab 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs | |||
@@ -18,7 +18,8 @@ pub mod mock_analysis; | |||
18 | 18 | ||
19 | use std::{fmt, sync::Arc}; | 19 | use std::{fmt, sync::Arc}; |
20 | 20 | ||
21 | use ra_syntax::{AtomEdit, SourceFileNode, TextRange, TextUnit}; | 21 | use ra_syntax::{SourceFileNode, TextRange, TextUnit}; |
22 | use ra_text_edit::AtomTextEdit; | ||
22 | use ra_db::FileResolverImp; | 23 | use ra_db::FileResolverImp; |
23 | use rayon::prelude::*; | 24 | use rayon::prelude::*; |
24 | use relative_path::RelativePathBuf; | 25 | use relative_path::RelativePathBuf; |
@@ -120,7 +121,7 @@ pub struct SourceChange { | |||
120 | #[derive(Debug)] | 121 | #[derive(Debug)] |
121 | pub struct SourceFileNodeEdit { | 122 | pub struct SourceFileNodeEdit { |
122 | pub file_id: FileId, | 123 | pub file_id: FileId, |
123 | pub edits: Vec<AtomEdit>, | 124 | pub edits: Vec<AtomTextEdit>, |
124 | } | 125 | } |
125 | 126 | ||
126 | #[derive(Debug)] | 127 | #[derive(Debug)] |