@@ -253,6 +253,12 @@ export class PythonDebugger extends DebugSession {
253
253
this . launchArgs . debugOptions . indexOf ( DebugOptions . DjangoDebugging ) >= 0 ) {
254
254
isDjangoFile = filePath . toUpperCase ( ) . endsWith ( ".HTML" ) ;
255
255
}
256
+ // Todo: Remote DJango debugging
257
+ // if (this.attachArgs != null &&
258
+ // Array.isArray(this.attachArgs.debugOptions) &&
259
+ // this.attachArgs.debugOptions.indexOf(DebugOptions.DjangoDebugging) >= 0) {
260
+ // isDjangoFile = filePath.toUpperCase().endsWith(".HTML");
261
+ // }
256
262
257
263
condition = typeof condition === "string" ? condition : "" ;
258
264
@@ -358,11 +364,14 @@ export class PythonDebugger extends DebugSession {
358
364
let pathRelativeToSourceRoot = '' ;
359
365
// It is possible we're dealing with cross platform debugging
360
366
// If so, then path.relative won't work :(
361
- if ( remotePath . toUpperCase ( ) . startsWith ( this . attachArgs . remoteRoot . toUpperCase ( ) ) ) {
362
- pathRelativeToSourceRoot = remotePath . substring ( this . attachArgs . remoteRoot . length ) ;
367
+ if ( remotePath . toUpperCase ( ) . startsWith ( this . attachArgs . remoteRoot . toUpperCase ( ) ) ) {
368
+ pathRelativeToSourceRoot = remotePath . substring ( this . attachArgs . remoteRoot . length ) . trim ( ) ;
363
369
} else {
364
370
// get the part of the path that is relative to the source root
365
- pathRelativeToSourceRoot = path . relative ( this . attachArgs . remoteRoot , remotePath ) ;
371
+ pathRelativeToSourceRoot = path . relative ( this . attachArgs . remoteRoot , remotePath ) . trim ( ) ;
372
+ }
373
+ if ( pathRelativeToSourceRoot . startsWith ( path . sep ) ) {
374
+ pathRelativeToSourceRoot = pathRelativeToSourceRoot . substring ( 1 ) ;
366
375
}
367
376
// resolve from the local source root
368
377
return path . resolve ( this . attachArgs . localRoot , pathRelativeToSourceRoot ) ;
@@ -584,7 +593,9 @@ export class PythonDebugger extends DebugSession {
584
593
mode = enum_EXCEPTION_STATE . BREAK_MODE_ALWAYS ;
585
594
}
586
595
let exToIgnore = null ;
587
- let exceptionHandling = this . launchArgs . exceptionHandling ;
596
+ let exceptionHandling = this . launchArgs ? this . launchArgs . exceptionHandling : null ;
597
+ // Todo: exception handling for remote debugging
598
+ // let exceptionHandling = this.launchArgs ? this.launchArgs.exceptionHandling : this.attachArgs.exceptionHandling;
588
599
if ( exceptionHandling ) {
589
600
exToIgnore = new Map < string , enum_EXCEPTION_STATE > ( ) ;
590
601
if ( Array . isArray ( exceptionHandling . ignore ) ) {
0 commit comments