@@ -8,6 +8,7 @@ use std::{
8
8
} ;
9
9
10
10
use eyre:: WrapErr ;
11
+ use launch_configuration:: LaunchConfiguration ;
11
12
use retry:: { delay:: Exponential , retry} ;
12
13
use server:: Implementation ;
13
14
use transport:: {
@@ -21,7 +22,7 @@ use crate::{
21
22
internals:: DebuggerInternals ,
22
23
state:: { self , DebuggerState } ,
23
24
types:: { self , EvaluateResult } ,
24
- Event ,
25
+ Event , LaunchArguments ,
25
26
} ;
26
27
27
28
/// How to launch a debugging session
@@ -46,6 +47,21 @@ impl From<state::AttachArguments> for InitialiseArguments {
46
47
}
47
48
}
48
49
50
+ impl From < LaunchConfiguration > for InitialiseArguments {
51
+ fn from ( value : LaunchConfiguration ) -> Self {
52
+ match value {
53
+ LaunchConfiguration :: Debugpy ( debugpy) => match debugpy. request . as_str ( ) {
54
+ "launch" => InitialiseArguments :: Launch ( LaunchArguments {
55
+ program : debugpy. program . expect ( "program must be specified" ) ,
56
+ working_directory : None ,
57
+ language : crate :: Language :: DebugPy ,
58
+ } ) ,
59
+ other => todo ! ( "{other}" ) ,
60
+ } ,
61
+ }
62
+ }
63
+ }
64
+
49
65
fn retry_scale ( ) -> impl Iterator < Item = Duration > {
50
66
Exponential :: from_millis ( 200 ) . take ( 5 )
51
67
}
@@ -163,9 +179,7 @@ impl Debugger {
163
179
let config = launch_configuration:: load_from_path ( Some ( & name) , configuration_path)
164
180
. context ( "loading launch configuration" ) ?;
165
181
match config {
166
- ChosenLaunchConfiguration :: Specific ( config) => {
167
- todo ! ( )
168
- }
182
+ ChosenLaunchConfiguration :: Specific ( config) => Debugger :: new ( config) ,
169
183
_ => Err ( eyre:: eyre!( "specified configuration {name} not found" ) ) ,
170
184
}
171
185
}
0 commit comments