code formatting

This commit is contained in:
vsrs 2020-05-17 20:38:50 +03:00
parent dec2f3fa65
commit 3d445256fe
3 changed files with 22 additions and 20 deletions

View file

@ -826,8 +826,10 @@ pub fn handle_code_lens(
if world.config.lens.runnable() { if world.config.lens.runnable() {
// Gather runnables // Gather runnables
for runnable in world.analysis().runnables(file_id)? { for runnable in world.analysis().runnables(file_id)? {
let (run_title, debugee ) = match &runnable.kind { let (run_title, debugee) = match &runnable.kind {
RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => ("▶️\u{fe0e}Run Test", true), RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => {
("▶️\u{fe0e}Run Test", true)
}
RunnableKind::DocTest { .. } => { RunnableKind::DocTest { .. } => {
// cargo does not support -no-run for doctests // cargo does not support -no-run for doctests
("▶️\u{fe0e}Run Doctest", false) ("▶️\u{fe0e}Run Doctest", false)
@ -835,7 +837,7 @@ pub fn handle_code_lens(
RunnableKind::Bench { .. } => { RunnableKind::Bench { .. } => {
// Nothing wrong with bench debugging // Nothing wrong with bench debugging
("Run Bench", true) ("Run Bench", true)
}, }
RunnableKind::Bin => { RunnableKind::Bin => {
// Do not suggest binary run on other target than binary // Do not suggest binary run on other target than binary
match &cargo_spec { match &cargo_spec {

View file

@ -40,7 +40,7 @@ async function selectRunnable(ctx: Ctx, prevRunnable?: RunnableQuickPick, debugg
items.push(new RunnableQuickPick(r)); items.push(new RunnableQuickPick(r));
} }
if( items.length === 0 ) { if (items.length === 0) {
// it is the debug case, run always has at least 'cargo check ...' // it is the debug case, run always has at least 'cargo check ...'
// see crates\rust-analyzer\src\main_loop\handlers.rs, handle_runnables // see crates\rust-analyzer\src\main_loop\handlers.rs, handle_runnables
vscode.window.showErrorMessage("There's no debug target!"); vscode.window.showErrorMessage("There's no debug target!");