@@ -2264,38 +2264,37 @@ private Task<string> ResetConsole()
2264
2264
2265
2265
public bool MapCurrentSrcToCompileTimeSrc ( string currentSrc , out string compilerSrc )
2266
2266
{
2267
- if ( _launchOptions . SourceMap ! = null )
2267
+ if ( _launchOptions . SourceMap = = null )
2268
2268
{
2269
- StringComparison comp = PlatformUtilities . IsWindows ( ) ? StringComparison . OrdinalIgnoreCase : StringComparison . Ordinal ;
2270
- foreach ( var e in _launchOptions . SourceMap )
2269
+ compilerSrc = currentSrc ;
2270
+ return false ;
2271
+ }
2272
+
2273
+ StringComparison comp = PlatformUtilities . IsWindows ( ) ? StringComparison . OrdinalIgnoreCase : StringComparison . Ordinal ;
2274
+ foreach ( var e in _launchOptions . SourceMap )
2275
+ {
2276
+ if ( ! e . UseForBreakpoints || ! currentSrc . StartsWith ( e . EditorPath , comp ) )
2277
+ continue ;
2278
+
2279
+ var file = currentSrc . Substring ( e . EditorPath . Length ) ;
2280
+ if ( string . IsNullOrEmpty ( file ) ) // matched the whole string
2271
2281
{
2272
- if ( e . UseForBreakpoints && currentSrc . StartsWith ( e . EditorPath , comp ) )
2273
- {
2274
- var file = currentSrc . Substring ( e . EditorPath . Length ) ;
2275
- if ( string . IsNullOrEmpty ( file ) ) // matched the whole string
2276
- {
2277
- compilerSrc = e . CompileTimePath ; // return the matches compile time path
2278
- return true ;
2279
- }
2280
- // must do the path break at a directory boundry, i.e. at a '\' or '/' char
2281
- char firstFilechar = file [ 0 ] ;
2282
- char lastDirectoryChar = e . EditorPath [ e . EditorPath . Length - 1 ] ;
2283
- if ( firstFilechar == Path . DirectorySeparatorChar || firstFilechar == Path . AltDirectorySeparatorChar )
2284
- {
2285
- file = file . Trim ( new char [ ] { Path . DirectorySeparatorChar , Path . AltDirectorySeparatorChar } ) ; // Trim the directory separator(s)
2286
- }
2287
- else if ( lastDirectoryChar != Path . DirectorySeparatorChar && lastDirectoryChar != Path . AltDirectorySeparatorChar )
2288
- {
2289
- continue ; // match didn't end at a directory separator, not actually a match
2290
- }
2291
- compilerSrc = Path . Combine ( e . CompileTimePath , file ) ; // map to the compiled location
2292
- if ( compilerSrc . IndexOf ( '\\ ' ) > 0 )
2293
- {
2294
- compilerSrc = compilerSrc . Replace ( '\\ ' , '/' ) ; // use Unix notation for the compiled path
2295
- }
2296
- return true ;
2297
- }
2282
+ compilerSrc = e . CompileTimePath ; // return the matches compile time path
2283
+ return true ;
2298
2284
}
2285
+ // must do the path break at a directory boundry, i.e. at a '\' or '/' char
2286
+ char firstFilechar = file [ 0 ] ;
2287
+ char lastDirectoryChar = e . EditorPath [ e . EditorPath . Length - 1 ] ;
2288
+ if ( firstFilechar == Path . DirectorySeparatorChar || firstFilechar == Path . AltDirectorySeparatorChar )
2289
+ file = file . Trim ( new char [ ] { Path . DirectorySeparatorChar , Path . AltDirectorySeparatorChar } ) ; // Trim the directory separator(s)
2290
+ else if ( lastDirectoryChar != Path . DirectorySeparatorChar && lastDirectoryChar != Path . AltDirectorySeparatorChar )
2291
+ continue ; // match didn't end at a directory separator, not actually a match
2292
+
2293
+ compilerSrc = Path . Combine ( e . CompileTimePath , file ) ; // map to the compiled location
2294
+ if ( compilerSrc . IndexOf ( '\\ ' ) > 0 )
2295
+ compilerSrc = compilerSrc . Replace ( '\\ ' , '/' ) ; // use Unix notation for the compiled path
2296
+
2297
+ return true ;
2299
2298
}
2300
2299
compilerSrc = currentSrc ;
2301
2300
return false ;
0 commit comments