Add bench runnable and code lens

This commit is contained in:
Jeremy Kolb 2019-01-12 18:40:54 -05:00
parent eb931c0d9e
commit 5d273f10cd
3 changed files with 54 additions and 36 deletions

View file

@ -17,6 +17,7 @@ pub struct Runnable {
pub enum RunnableKind {
Test { name: String },
TestMod { path: String },
Bench { name: String },
Bin,
}
@ -48,6 +49,10 @@ fn runnable_fn(fn_def: &ast::FnDef) -> Option<Runnable> {
RunnableKind::Test {
name: name.to_string(),
}
} else if fn_def.has_atom_attr("bench") {
RunnableKind::Bench {
name: name.to_string(),
}
} else {
return None;
};