Add file support to expect

This commit is contained in:
Aleksey Kladov 2020-07-01 11:19:40 +02:00
parent 82838f5eda
commit adf624b433
3 changed files with 63 additions and 21 deletions

View file

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