Remove vscode_lldb setting

This commit is contained in:
Aleksey Kladov 2020-04-02 12:56:14 +02:00
parent e21bf1b2b9
commit 7a4ebd2c8d
3 changed files with 18 additions and 20 deletions

View file

@ -19,8 +19,6 @@ pub struct Config {
pub with_sysroot: bool,
pub publish_diagnostics: bool,
// TODO: move to experimental capabilities
pub vscode_lldb: bool,
pub lru_capacity: Option<usize>,
pub proc_macro_srv: Option<String>,
pub files: FilesConfig,
@ -78,7 +76,6 @@ impl Default for Config {
with_sysroot: true,
publish_diagnostics: true,
vscode_lldb: false,
lru_capacity: None,
proc_macro_srv: None,
files: FilesConfig { watcher: FilesWatcher::Notify, exclude: Vec::new() },
@ -122,7 +119,6 @@ impl Config {
set(value, "/withSysroot", &mut self.with_sysroot);
set(value, "/featureFlags/lsp.diagnostics", &mut self.publish_diagnostics);
set(value, "/vscodeLldb", &mut self.vscode_lldb);
set(value, "/lruCapacity", &mut self.lru_capacity);
if let Some(watcher) = get::<String>(value, "/files/watcher") {
self.files.watcher = match watcher.as_str() {

View file

@ -810,23 +810,21 @@ pub fn handle_code_lens(
};
lenses.push(lens);
if world.config.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);
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

View file

@ -66,6 +66,10 @@ export function debugSingle(ctx: Ctx): Cmd {
return async (config: ra.Runnable) => {
const editor = ctx.activeRustEditor;
if (!editor) return;
if (!vscode.extensions.getExtension("vadimcn.vscode-lldb")) {
vscode.window.showErrorMessage("Install `vadimcn.vscode-lldb` extension for debugging");
return;
}
const debugConfig = {
type: "lldb",