|
|
@ -170,11 +170,11 @@ pub fn dap_start_impl(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
let config = editor
|
|
|
|
let language_config = editor.syn_loader.language_config_for_file_name(&path);
|
|
|
|
.syn_loader
|
|
|
|
let config = match language_config
|
|
|
|
.language_config_for_file_name(&path)
|
|
|
|
.as_deref()
|
|
|
|
.and_then(|x| x.debugger.clone());
|
|
|
|
.and_then(|config| config.debugger.as_ref())
|
|
|
|
let config = match config {
|
|
|
|
{
|
|
|
|
Some(c) => c,
|
|
|
|
Some(c) => c,
|
|
|
|
None => {
|
|
|
|
None => {
|
|
|
|
editor.set_error(
|
|
|
|
editor.set_error(
|
|
|
@ -187,10 +187,10 @@ pub fn dap_start_impl(
|
|
|
|
let result = match socket {
|
|
|
|
let result = match socket {
|
|
|
|
Some(socket) => block_on(Client::tcp(socket, 0)),
|
|
|
|
Some(socket) => block_on(Client::tcp(socket, 0)),
|
|
|
|
None => block_on(Client::process(
|
|
|
|
None => block_on(Client::process(
|
|
|
|
config.transport.clone(),
|
|
|
|
&config.transport,
|
|
|
|
config.command.clone(),
|
|
|
|
&config.command,
|
|
|
|
config.args.clone(),
|
|
|
|
config.args.iter().map(|arg| arg.as_str()).collect(),
|
|
|
|
config.port_arg.clone(),
|
|
|
|
config.port_arg.as_deref(),
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -209,7 +209,7 @@ pub fn dap_start_impl(
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
debugger.quirks = config.quirks;
|
|
|
|
debugger.quirks = config.quirks.clone();
|
|
|
|
|
|
|
|
|
|
|
|
let start_config = match name {
|
|
|
|
let start_config = match name {
|
|
|
|
Some(name) => config.templates.iter().find(|t| t.name == name),
|
|
|
|
Some(name) => config.templates.iter().find(|t| t.name == name),
|
|
|
@ -296,7 +296,7 @@ pub fn dap_launch(cx: &mut Context) {
|
|
|
|
|
|
|
|
|
|
|
|
let (_, doc) = current!(cx.editor);
|
|
|
|
let (_, doc) = current!(cx.editor);
|
|
|
|
let path = match doc.path() {
|
|
|
|
let path = match doc.path() {
|
|
|
|
Some(path) => path.to_path_buf(),
|
|
|
|
Some(path) => path,
|
|
|
|
None => {
|
|
|
|
None => {
|
|
|
|
cx.editor
|
|
|
|
cx.editor
|
|
|
|
.set_error("Can't start debug: document has no path".to_string());
|
|
|
|
.set_error("Can't start debug: document has no path".to_string());
|
|
|
@ -304,12 +304,11 @@ pub fn dap_launch(cx: &mut Context) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
let config = cx
|
|
|
|
let language_config = cx.editor.syn_loader.language_config_for_file_name(path);
|
|
|
|
.editor
|
|
|
|
let config = match language_config
|
|
|
|
.syn_loader
|
|
|
|
.as_deref()
|
|
|
|
.language_config_for_file_name(&path)
|
|
|
|
.and_then(|config| config.debugger.as_ref())
|
|
|
|
.and_then(|x| x.debugger.clone());
|
|
|
|
{
|
|
|
|
let config = match config {
|
|
|
|
|
|
|
|
Some(c) => c,
|
|
|
|
Some(c) => c,
|
|
|
|
None => {
|
|
|
|
None => {
|
|
|
|
cx.editor.set_error(
|
|
|
|
cx.editor.set_error(
|
|
|
@ -321,7 +320,7 @@ pub fn dap_launch(cx: &mut Context) {
|
|
|
|
|
|
|
|
|
|
|
|
cx.push_layer(Box::new(Picker::new(
|
|
|
|
cx.push_layer(Box::new(Picker::new(
|
|
|
|
true,
|
|
|
|
true,
|
|
|
|
config.templates,
|
|
|
|
config.templates.clone(),
|
|
|
|
|template| template.name.as_str().into(),
|
|
|
|
|template| template.name.as_str().into(),
|
|
|
|
|cx, template, _action| {
|
|
|
|
|cx, template, _action| {
|
|
|
|
let completions = template.completion.clone();
|
|
|
|
let completions = template.completion.clone();
|
|
|
|