From 61e1474ab35deb7d54cc2f5d710b901f200b6467 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 28 May 2019 18:46:11 +0300 Subject: fix typos in mbe tests --- crates/ra_ide_api/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_ide_api/src/lib.rs') diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index 452407e8e..2fe46cd13 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs @@ -314,7 +314,7 @@ impl Analysis { /// Gets the syntax tree of the file. pub fn parse(&self, file_id: FileId) -> TreeArc { - self.db.parse(file_id).clone() + self.db.parse(file_id).tree } /// Gets the file's `LineIndex`: data structure to convert between absolute @@ -331,7 +331,7 @@ impl Analysis { /// Returns position of the matching brace (all types of braces are /// supported). pub fn matching_brace(&self, position: FilePosition) -> Option { - let file = self.db.parse(position.file_id); + let file = self.db.parse(position.file_id).tree; matching_brace::matching_brace(&file, position.offset) } @@ -344,7 +344,7 @@ impl Analysis { /// Returns an edit to remove all newlines in the range, cleaning up minor /// stuff like trailing commas. pub fn join_lines(&self, frange: FileRange) -> SourceChange { - let file = self.db.parse(frange.file_id); + let file = self.db.parse(frange.file_id).tree; let file_edit = SourceFileEdit { file_id: frange.file_id, edit: join_lines::join_lines(&file, frange.range), @@ -362,7 +362,7 @@ impl Analysis { /// this works when adding `let =`. // FIXME: use a snippet completion instead of this hack here. pub fn on_eq_typed(&self, position: FilePosition) -> Option { - let file = self.db.parse(position.file_id); + let file = self.db.parse(position.file_id).tree; let edit = typing::on_eq_typed(&file, position.offset)?; Some(SourceChange::source_file_edit( "add semicolon", @@ -378,13 +378,13 @@ impl Analysis { /// Returns a tree representation of symbols in the file. Useful to draw a /// file outline. pub fn file_structure(&self, file_id: FileId) -> Vec { - let file = self.db.parse(file_id); + let file = self.db.parse(file_id).tree; file_structure(&file) } /// Returns the set of folding ranges. pub fn folding_ranges(&self, file_id: FileId) -> Vec { - let file = self.db.parse(file_id); + let file = self.db.parse(file_id).tree; folding_ranges::folding_ranges(&file) } -- cgit v1.2.3