fixup! feat: add debug code lens

autodetect vscode-lldb
This commit is contained in:
Hannes De Valkeneer
2020-03-12 22:31:47 +01:00
parent e9d025b618
commit 39c92b3872
7 changed files with 26 additions and 19 deletions

View File

@@ -805,23 +805,25 @@ pub fn handle_code_lens(
}),
data: None,
};
if r.args[0] == "run" {
r.args[0] = "build".into();
} else {
r.args.push("--no-run".into());
}
let debug_lens = CodeLens {
range: r.range,
command: Some(Command {
title: "Debug".into(),
command: "rust-analyzer.debugSingle".into(),
arguments: Some(vec![to_value(r).unwrap()]),
}),
data: None,
};
lenses.push(lens);
lenses.push(debug_lens);
if world.options.vscode_lldb {
if r.args[0] == "run" {
r.args[0] = "build".into();
} else {
r.args.push("--no-run".into());
}
let debug_lens = CodeLens {
range: r.range,
command: Some(Command {
title: "Debug".into(),
command: "rust-analyzer.debugSingle".into(),
arguments: Some(vec![to_value(r).unwrap()]),
}),
data: None,
};
lenses.push(debug_lens);
}
}
// Handle impls