aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api
diff options
context:
space:
mode:
authorJeremy Kolb <[email protected]>2019-01-12 23:40:54 +0000
committerJeremy Kolb <[email protected]>2019-01-12 23:40:54 +0000
commit5d273f10cdd4da6f0670b41b2fdad4679d3df877 (patch)
tree3d2ea73fd897e999eb274223f3cb5cdc17607a4f /crates/ra_ide_api
parenteb931c0d9e0877e573622253ae5b05563841037b (diff)
Add bench runnable and code lens
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r--crates/ra_ide_api/src/runnables.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/runnables.rs b/crates/ra_ide_api/src/runnables.rs
index 98b1d2d55..53e49da5b 100644
--- a/crates/ra_ide_api/src/runnables.rs
+++ b/crates/ra_ide_api/src/runnables.rs
@@ -17,6 +17,7 @@ pub struct Runnable {
17pub enum RunnableKind { 17pub enum RunnableKind {
18 Test { name: String }, 18 Test { name: String },
19 TestMod { path: String }, 19 TestMod { path: String },
20 Bench { name: String },
20 Bin, 21 Bin,
21} 22}
22 23
@@ -48,6 +49,10 @@ fn runnable_fn(fn_def: &ast::FnDef) -> Option<Runnable> {
48 RunnableKind::Test { 49 RunnableKind::Test {
49 name: name.to_string(), 50 name: name.to_string(),
50 } 51 }
52 } else if fn_def.has_atom_attr("bench") {
53 RunnableKind::Bench {
54 name: name.to_string(),
55 }
51 } else { 56 } else {
52 return None; 57 return None;
53 }; 58 };