mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Add bench runnable and code lens
This commit is contained in:
parent
eb931c0d9e
commit
5d273f10cd
3 changed files with 54 additions and 36 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue