mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
fix typos in mbe tests
This commit is contained in:
parent
c8bcfe6a05
commit
61e1474ab3
29 changed files with 92 additions and 91 deletions
|
@ -10,7 +10,7 @@ use ra_db::{FilePosition, SourceDatabase};
|
|||
use crate::{db::RootDatabase, SourceChange, SourceFileEdit};
|
||||
|
||||
pub(crate) fn on_enter(db: &RootDatabase, position: FilePosition) -> Option<SourceChange> {
|
||||
let file = db.parse(position.file_id);
|
||||
let file = db.parse(position.file_id).tree;
|
||||
let comment = find_token_at_offset(file.syntax(), position.offset)
|
||||
.left_biased()
|
||||
.and_then(ast::Comment::cast)?;
|
||||
|
@ -85,7 +85,7 @@ pub fn on_eq_typed(file: &SourceFile, eq_offset: TextUnit) -> Option<TextEdit> {
|
|||
}
|
||||
|
||||
pub(crate) fn on_dot_typed(db: &RootDatabase, position: FilePosition) -> Option<SourceChange> {
|
||||
let file = db.parse(position.file_id);
|
||||
let file = db.parse(position.file_id).tree;
|
||||
assert_eq!(file.syntax().text().char_at(position.offset), Some('.'));
|
||||
|
||||
let whitespace = find_token_at_offset(file.syntax(), position.offset)
|
||||
|
@ -138,7 +138,7 @@ mod tests {
|
|||
let mut edit = TextEditBuilder::default();
|
||||
edit.insert(offset, "=".to_string());
|
||||
let before = edit.finish().apply(&before);
|
||||
let file = SourceFile::parse(&before);
|
||||
let file = SourceFile::parse(&before).tree;
|
||||
if let Some(result) = on_eq_typed(&file, offset) {
|
||||
let actual = result.apply(&before);
|
||||
assert_eq_text!(after, &actual);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue