@ -172,9 +172,9 @@ pub fn dap_start_impl(
let mut args : HashMap < & str , Value > = HashMap ::new ( ) ;
let mut args : HashMap < & str , Value > = HashMap ::new ( ) ;
if let Some ( params ) = params {
for ( k , t ) in & template . args {
for ( k , t ) in & template . args {
let mut value = t . clone ( ) ;
let mut value = t . clone ( ) ;
if let Some ( ref params ) = params {
for ( i , x ) in params . iter ( ) . enumerate ( ) {
for ( i , x ) in params . iter ( ) . enumerate ( ) {
let mut param = x . to_string ( ) ;
let mut param = x . to_string ( ) ;
if let Some ( DebugConfigCompletion ::Advanced ( cfg ) ) = template . completion . get ( i ) {
if let Some ( DebugConfigCompletion ::Advanced ( cfg ) ) = template . completion . get ( i ) {
@ -198,6 +198,7 @@ pub fn dap_start_impl(
DebugArgumentValue ::Boolean ( _ ) = > value ,
DebugArgumentValue ::Boolean ( _ ) = > value ,
} ;
} ;
}
}
}
match value {
match value {
DebugArgumentValue ::String ( string ) = > {
DebugArgumentValue ::String ( string ) = > {
@ -215,7 +216,6 @@ pub fn dap_start_impl(
}
}
}
}
}
}
}
args . insert ( "cwd" , to_value ( helix_stdx ::env ::current_working_dir ( ) ) ? ) ;
args . insert ( "cwd" , to_value ( helix_stdx ::env ::current_working_dir ( ) ) ? ) ;
@ -272,6 +272,11 @@ pub fn dap_launch(cx: &mut Context) {
templates ,
templates ,
( ) ,
( ) ,
| cx , template , _action | {
| cx , template , _action | {
if template . completion . is_empty ( ) {
if let Err ( err ) = dap_start_impl ( cx , Some ( & template . name ) , None , None ) {
cx . editor . set_error ( err . to_string ( ) ) ;
}
} else {
let completions = template . completion . clone ( ) ;
let completions = template . completion . clone ( ) ;
let name = template . name . clone ( ) ;
let name = template . name . clone ( ) ;
let callback = Box ::pin ( async move {
let callback = Box ::pin ( async move {
@ -283,6 +288,7 @@ pub fn dap_launch(cx: &mut Context) {
Ok ( call )
Ok ( call )
} ) ;
} ) ;
cx . jobs . callback ( callback ) ;
cx . jobs . callback ( callback ) ;
}
} ,
} ,
) ) ) ) ;
) ) ) ) ;
}
}