44
55import * as path from 'path' ;
66import * as fs from 'fs' ;
7- import { Logger } from '../../../services/Logger ' ;
7+ import { DebugAdapterServices as Services } from '../../../services/services/debugAdapterServices ' ;
88import { DebugProtocol } from 'vscode-debugprotocol' ;
99import { ISourceMaps , SourceMaps } from './sourceMaps' ;
1010import * as utils from '../../utilities' ;
@@ -60,7 +60,7 @@ export class SourceMapTransformer implements DebugProtocol.IDebugTransformer {
6060 const argsPath = args . source . path ;
6161 const mappedPath = this . _sourceMaps . MapPathFromSource ( argsPath ) ;
6262 if ( mappedPath ) {
63- Logger . log ( `SourceMaps.setBP: Mapped ${ argsPath } to ${ mappedPath } ` ) ;
63+ Services . logger . log ( `SourceMaps.setBP: Mapped ${ argsPath } to ${ mappedPath } ` ) ;
6464 args . authoredPath = argsPath ;
6565 args . source . path = mappedPath ;
6666
@@ -69,11 +69,11 @@ export class SourceMapTransformer implements DebugProtocol.IDebugTransformer {
6969 const mappedLines = args . lines . map ( ( line , i ) => {
7070 const mapped = this . _sourceMaps . MapFromSource ( argsPath , line , /*column=*/ 0 ) ;
7171 if ( mapped ) {
72- Logger . log ( `SourceMaps.setBP: Mapped ${ argsPath } :${ line } :0 to ${ mappedPath } :${ mapped . line } :${ mapped . column } ` ) ;
72+ Services . logger . log ( `SourceMaps.setBP: Mapped ${ argsPath } :${ line } :0 to ${ mappedPath } :${ mapped . line } :${ mapped . column } ` ) ;
7373 mappedCols [ i ] = mapped . column ;
7474 return mapped . line ;
7575 } else {
76- Logger . log ( `SourceMaps.setBP: Mapped ${ argsPath } but not line ${ line } , column 0` ) ;
76+ Services . logger . log ( `SourceMaps.setBP: Mapped ${ argsPath } but not line ${ line } , column 0` ) ;
7777 mappedCols [ i ] = 0 ;
7878 return line ;
7979 }
@@ -101,10 +101,10 @@ export class SourceMapTransformer implements DebugProtocol.IDebugTransformer {
101101 } ) ;
102102 } else if ( this . _allRuntimeScriptPaths . has ( argsPath ) ) {
103103 // It's a generated file which is loaded
104- Logger . log ( `SourceMaps.setBP: SourceMaps are enabled but ${ argsPath } is a runtime script` ) ;
104+ Services . logger . log ( `SourceMaps.setBP: SourceMaps are enabled but ${ argsPath } is a runtime script` ) ;
105105 } else {
106106 // Source (or generated) file which is not loaded, need to wait
107- Logger . log ( `SourceMaps.setBP: ${ argsPath } can't be resolved to a loaded script.` ) ;
107+ Services . logger . log ( `SourceMaps.setBP: ${ argsPath } can't be resolved to a loaded script.` ) ;
108108 this . _pendingBreakpointsByPath . set ( argsPath , { resolve, reject, args, requestSeq } ) ;
109109 return ;
110110 }
@@ -132,10 +132,10 @@ export class SourceMapTransformer implements DebugProtocol.IDebugTransformer {
132132 response . breakpoints . forEach ( ( bp , i ) => {
133133 const mapped = this . _sourceMaps . MapToSource ( args . source . path , args . lines [ i ] , args . cols [ i ] ) ;
134134 if ( mapped ) {
135- Logger . log ( `SourceMaps.setBP: Mapped ${ args . source . path } :${ bp . line } :${ bp . column } to ${ mapped . path } :${ mapped . line } ` ) ;
135+ Services . logger . log ( `SourceMaps.setBP: Mapped ${ args . source . path } :${ bp . line } :${ bp . column } to ${ mapped . path } :${ mapped . line } ` ) ;
136136 bp . line = mapped . line ;
137137 } else {
138- Logger . log ( `SourceMaps.setBP: Can't map ${ args . source . path } :${ bp . line } :${ bp . column } , keeping the line number as-is.` ) ;
138+ Services . logger . log ( `SourceMaps.setBP: Can't map ${ args . source . path } :${ bp . line } :${ bp . column } , keeping the line number as-is.` ) ;
139139 }
140140
141141 this . _requestSeqToSetBreakpointsArgs . delete ( requestSeq ) ;
@@ -201,7 +201,7 @@ export class SourceMapTransformer implements DebugProtocol.IDebugTransformer {
201201 this . _sourceMaps . ProcessNewSourceMap ( event . body . scriptUrl , sourceMapUrlValue ) . then ( ( ) => {
202202 const sources = this . _sourceMaps . AllMappedSources ( event . body . scriptUrl ) ;
203203 if ( sources ) {
204- Logger . log ( `SourceMaps.scriptParsed: ${ event . body . scriptUrl } was just loaded and has mapped sources: ${ JSON . stringify ( sources ) } ` ) ;
204+ Services . logger . log ( `SourceMaps.scriptParsed: ${ event . body . scriptUrl } was just loaded and has mapped sources: ${ JSON . stringify ( sources ) } ` ) ;
205205 sources . forEach ( this . resolvePendingBreakpoints , this ) ;
206206 }
207207 } ) ;
@@ -241,7 +241,7 @@ export class SourceMapTransformer implements DebugProtocol.IDebugTransformer {
241241 private resolvePendingBreakpoints ( sourcePath : string ) : void {
242242 // If there's a setBreakpoints request waiting on this script, go through setBreakpoints again
243243 if ( this . _pendingBreakpointsByPath . has ( sourcePath ) ) {
244- Logger . log ( `SourceMaps.scriptParsed: Resolving pending breakpoints for ${ sourcePath } ` ) ;
244+ Services . logger . log ( `SourceMaps.scriptParsed: Resolving pending breakpoints for ${ sourcePath } ` ) ;
245245 const pendingBreakpoint = this . _pendingBreakpointsByPath . get ( sourcePath ) ;
246246 this . _pendingBreakpointsByPath . delete ( sourcePath ) ;
247247
0 commit comments