@ -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 ) = param s {
for ( k , t ) in & template . arg s {
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,22 +198,22 @@ pub fn dap_start_impl(
DebugArgumentValue ::Boolean ( _ ) = > value ,
DebugArgumentValue ::Boolean ( _ ) = > value ,
} ;
} ;
}
}
}
match value {
match value {
DebugArgumentValue ::String ( string ) = > {
DebugArgumentValue ::String ( string ) = > {
if let Ok ( integer ) = string . parse ::< usize > ( ) {
if let Ok ( integer ) = string . parse ::< usize > ( ) {
args . insert ( k , to_value ( integer ) . unwrap ( ) ) ;
args . insert ( k , to_value ( integer ) . unwrap ( ) ) ;
} else {
} else {
args . insert ( k , to_value ( string ) . unwrap ( ) ) ;
args . insert ( k , to_value ( string ) . unwrap ( ) ) ;
}
}
DebugArgumentValue ::Array ( arr ) = > {
args . insert ( k , to_value ( arr ) . unwrap ( ) ) ;
}
DebugArgumentValue ::Boolean ( bool ) = > {
args . insert ( k , to_value ( bool ) . unwrap ( ) ) ;
}
}
}
}
DebugArgumentValue ::Array ( arr ) = > {
args . insert ( k , to_value ( arr ) . unwrap ( ) ) ;
}
DebugArgumentValue ::Boolean ( bool ) = > {
args . insert ( k , to_value ( bool ) . unwrap ( ) ) ;
}
}
}
}
}
@ -272,17 +272,23 @@ pub fn dap_launch(cx: &mut Context) {
templates ,
templates ,
( ) ,
( ) ,
| cx , template , _action | {
| cx , template , _action | {
let completions = template . completion . clone ( ) ;
if template . completion . is_empty ( ) {
let name = template . name . clone ( ) ;
if let Err ( err ) = dap_start_impl ( cx , Some ( & template . name ) , None , None ) {
let callback = Box ::pin ( async move {
cx . editor . set_error ( err . to_string ( ) ) ;
let call : Callback =
}
Callback ::EditorCompositor ( Box ::new ( move | _editor , compositor | {
} else {
let prompt = debug_parameter_prompt ( completions , name , Vec ::new ( ) ) ;
let completions = template . completion . clone ( ) ;
compositor . push ( Box ::new ( prompt ) ) ;
let name = template . name . clone ( ) ;
} ) ) ;
let callback = Box ::pin ( async move {
Ok ( call )
let call : Callback =
} ) ;
Callback ::EditorCompositor ( Box ::new ( move | _editor , compositor | {
cx . jobs . callback ( callback ) ;
let prompt = debug_parameter_prompt ( completions , name , Vec ::new ( ) ) ;
compositor . push ( Box ::new ( prompt ) ) ;
} ) ) ;
Ok ( call )
} ) ;
cx . jobs . callback ( callback ) ;
}
} ,
} ,
) ) ) ) ;
) ) ) ) ;
}
}