fix typos in mbe tests

This commit is contained in:
Aleksey Kladov 2019-05-28 18:46:11 +03:00
parent c8bcfe6a05
commit 61e1474ab3
29 changed files with 92 additions and 91 deletions

View file

@ -314,7 +314,7 @@ impl Analysis {
/// Gets the syntax tree of the file.
pub fn parse(&self, file_id: FileId) -> TreeArc<SourceFile> {
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<TextUnit> {
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<SourceChange> {
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<StructureNode> {
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<Fold> {
let file = self.db.parse(file_id);
let file = self.db.parse(file_id).tree;
folding_ranges::folding_ranges(&file)
}