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/display/navigation_target.rs | 4 ++-- crates/ra_ide_api/src/display/structure.rs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'crates/ra_ide_api/src/display') diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs index 7f81483f7..ae729614f 100644 --- a/crates/ra_ide_api/src/display/navigation_target.rs +++ b/crates/ra_ide_api/src/display/navigation_target.rs @@ -79,7 +79,7 @@ impl NavigationTarget { file_id: FileId, pat: AstPtr, ) -> NavigationTarget { - let file = db.parse(file_id); + let file = db.parse(file_id).tree; let (name, full_range) = match pat.to_node(file.syntax()).kind() { ast::PatKind::BindPat(pat) => return NavigationTarget::from_bind_pat(file_id, &pat), _ => ("_".into(), pat.syntax_node_ptr().range()), @@ -290,7 +290,7 @@ impl NavigationTarget { } pub(crate) fn node(&self, db: &RootDatabase) -> Option> { - let source_file = db.parse(self.file_id()); + let source_file = db.parse(self.file_id()).tree; let source_file = source_file.syntax(); let node = source_file .descendants() diff --git a/crates/ra_ide_api/src/display/structure.rs b/crates/ra_ide_api/src/display/structure.rs index ec2c9bbc6..24ab7b59c 100644 --- a/crates/ra_ide_api/src/display/structure.rs +++ b/crates/ra_ide_api/src/display/structure.rs @@ -183,7 +183,9 @@ fn obsolete() {} #[deprecated(note = "for awhile")] fn very_obsolete() {} "#, - ); + ) + .ok() + .unwrap(); let structure = file_structure(&file); assert_debug_snapshot_matches!("file_structure", structure); } -- cgit v1.2.3