diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-13 07:59:26 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-13 07:59:26 +0000 |
commit | a2659abed8417bfb36fb5a448c52b8af1495ec51 (patch) | |
tree | b1e5326b45b6dc3450b1ccda11268d353b3f95b8 /crates/ra_ide_api | |
parent | 883f1fc78a7cca439a1d276ebb6926427e544680 (diff) | |
parent | 5d273f10cdd4da6f0670b41b2fdad4679d3df877 (diff) |
Merge #513
513: Add bench runnable and code lens r=matklad a=kjeremy
Co-authored-by: Jeremy Kolb <[email protected]>
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/runnables.rs | 5 |
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 { | |||
17 | pub enum RunnableKind { | 17 | pub 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 | }; |