diff options
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 9ac52b5c3..248b77f5a 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs | |||
@@ -9,7 +9,7 @@ use hir::{ | |||
9 | self, FnSignatureInfo, Problem, source_binder, | 9 | self, FnSignatureInfo, Problem, source_binder, |
10 | }; | 10 | }; |
11 | use ra_db::{FilesDatabase, SourceRoot, SourceRootId, SyntaxDatabase}; | 11 | use ra_db::{FilesDatabase, SourceRoot, SourceRootId, SyntaxDatabase}; |
12 | use ra_editor::{self, find_node_at_offset, LineIndex, LocalEdit, Severity}; | 12 | use ra_editor::{self, find_node_at_offset, LocalEdit, Severity}; |
13 | use ra_syntax::{ | 13 | use ra_syntax::{ |
14 | algo::find_covering_node, | 14 | algo::find_covering_node, |
15 | ast::{self, ArgListOwner, Expr, FnDef, NameOwner}, | 15 | ast::{self, ArgListOwner, Expr, FnDef, NameOwner}, |
@@ -139,15 +139,6 @@ impl fmt::Debug for AnalysisImpl { | |||
139 | } | 139 | } |
140 | 140 | ||
141 | impl AnalysisImpl { | 141 | impl AnalysisImpl { |
142 | pub fn file_text(&self, file_id: FileId) -> Arc<String> { | ||
143 | self.db.file_text(file_id) | ||
144 | } | ||
145 | pub fn file_syntax(&self, file_id: FileId) -> SourceFileNode { | ||
146 | self.db.source_file(file_id) | ||
147 | } | ||
148 | pub fn file_line_index(&self, file_id: FileId) -> Arc<LineIndex> { | ||
149 | self.db.file_lines(file_id) | ||
150 | } | ||
151 | pub(crate) fn module_path(&self, position: FilePosition) -> Cancelable<Option<String>> { | 142 | pub(crate) fn module_path(&self, position: FilePosition) -> Cancelable<Option<String>> { |
152 | let descr = match source_binder::module_from_position(&*self.db, position)? { | 143 | let descr = match source_binder::module_from_position(&*self.db, position)? { |
153 | None => return Ok(None), | 144 | None => return Ok(None), |
@@ -400,7 +391,7 @@ impl AnalysisImpl { | |||
400 | } | 391 | } |
401 | 392 | ||
402 | pub fn assists(&self, frange: FileRange) -> Vec<SourceChange> { | 393 | pub fn assists(&self, frange: FileRange) -> Vec<SourceChange> { |
403 | let file = self.file_syntax(frange.file_id); | 394 | let file = self.db.source_file(frange.file_id); |
404 | let offset = frange.range.start(); | 395 | let offset = frange.range.start(); |
405 | let actions = vec![ | 396 | let actions = vec![ |
406 | ra_editor::flip_comma(&file, offset).map(|f| f()), | 397 | ra_editor::flip_comma(&file, offset).map(|f| f()), |