Update crates/rust-analyzer/src/handlers.rs

Co-authored-by: Veetaha <veetaha2@gmail.com>
This commit is contained in:
Aleksey Kladov 2020-06-28 01:23:32 +02:00 committed by GitHub
parent 3c1714d76d
commit a4f934efa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -413,9 +413,7 @@ pub(crate) fn handle_runnables(
Some(offset) => {
let source_file = snap.analysis.parse(file_id)?;
algo::find_node_at_offset::<ast::MacroCall>(source_file.syntax(), offset)
.and_then(|it| it.path())
.and_then(|it| it.segment())
.and_then(|it| it.name_ref())
.and_then(|it| it.path()?.segment()?.name_ref())
.map_or(false, |it| it.text() == "expect")
}
None => false,