@@ -181,7 +181,7 @@ public override void Disconnect(Response response, dynamic arguments)
181
181
182
182
public override void SetBreakpoints ( Response response , dynamic arguments )
183
183
{
184
- SessionLog . WriteLine ( "Set breakpoints command accepted" ) ;
184
+ SessionLog . WriteLine ( $ "Set breakpoints command accepted { arguments } ") ;
185
185
186
186
if ( ( bool ) arguments . sourceModified )
187
187
{
@@ -196,7 +196,12 @@ public override void SetBreakpoints(Response response, dynamic arguments)
196
196
197
197
var path = ( string ) arguments . source . path ;
198
198
path = ConvertClientPathToDebugger ( path ) ;
199
-
199
+ if ( Environment . OSVersion . Platform == PlatformID . Win32NT )
200
+ {
201
+ // vscode иногда передает путь, где диск - маленькая буква
202
+ path = NormalizeDriveLetter ( path ) ;
203
+ }
204
+
200
205
var breaks = new List < OneScript . DebugProtocol . Breakpoint > ( ) ;
201
206
202
207
foreach ( var srcBreakpoint in arguments . breakpoints )
@@ -206,19 +211,26 @@ public override void SetBreakpoints(Response response, dynamic arguments)
206
211
bpt . Source = path ;
207
212
breaks . Add ( bpt ) ;
208
213
}
209
-
210
- SessionLog . WriteLine ( "process exited: " + _process . HasExited ) ;
214
+
211
215
var confirmedBreaks = _process . SetBreakpoints ( breaks ) ;
212
216
var confirmedBreaksVSCode = new List < VSCodeDebug . Breakpoint > ( confirmedBreaks . Length ) ;
213
217
for ( int i = 0 ; i < confirmedBreaks . Length ; i ++ )
214
218
{
215
219
confirmedBreaksVSCode . Add ( new VSCodeDebug . Breakpoint ( true , confirmedBreaks [ i ] . Line ) ) ;
216
220
}
217
-
221
+
218
222
SendResponse ( response , new SetBreakpointsResponseBody ( confirmedBreaksVSCode ) ) ;
219
223
220
224
}
221
225
226
+ private string NormalizeDriveLetter ( string path )
227
+ {
228
+ if ( Path . IsPathRooted ( path ) )
229
+ return path [ 0 ] . ToString ( ) . ToUpperInvariant ( ) + path . Substring ( 1 ) ;
230
+ else
231
+ return path ;
232
+
233
+ }
222
234
223
235
public void ThreadStopped ( int threadId , ThreadStopReason reason )
224
236
{
@@ -236,6 +248,13 @@ public void ProcessExited(int exitCode)
236
248
237
249
public override void ConfigurationDone ( Response response , dynamic args )
238
250
{
251
+ if ( _process == null )
252
+ {
253
+ SessionLog . WriteLine ( "Config Done. Process is not started" ) ;
254
+ SendResponse ( response ) ;
255
+ return ;
256
+ }
257
+ SessionLog . WriteLine ( "Config Done. Process is started" ) ;
239
258
_process . BeginExecution ( ) ;
240
259
_startupPerformed = true ;
241
260
SendResponse ( response ) ;
0 commit comments