4
4
5
5
import * as path from 'path' ;
6
6
import * as fs from 'fs' ;
7
- import { DebugAdapterServices as Services } from '../../../services/debugAdapterServices' ;
7
+ import { Services } from '../../../services/debugAdapterServices' ;
8
8
import { DebugProtocol } from 'vscode-debugprotocol' ;
9
9
import { ISourceMaps , SourceMaps } from './sourceMaps' ;
10
10
import * as utils from '../../../common/utilities' ;
@@ -60,7 +60,7 @@ export class SourceMapTransformer implements DebugProtocol.IDebugTransformer {
60
60
const argsPath = args . source . path ;
61
61
const mappedPath = this . _sourceMaps . MapPathFromSource ( argsPath ) ;
62
62
if ( mappedPath ) {
63
- Services . logger . log ( `SourceMaps.setBP: Mapped ${ argsPath } to ${ mappedPath } ` ) ;
63
+ Services . logger ( ) . log ( `SourceMaps.setBP: Mapped ${ argsPath } to ${ mappedPath } ` ) ;
64
64
args . authoredPath = argsPath ;
65
65
args . source . path = mappedPath ;
66
66
@@ -69,11 +69,11 @@ export class SourceMapTransformer implements DebugProtocol.IDebugTransformer {
69
69
const mappedLines = args . lines . map ( ( line , i ) => {
70
70
const mapped = this . _sourceMaps . MapFromSource ( argsPath , line , /*column=*/ 0 ) ;
71
71
if ( mapped ) {
72
- Services . 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 } ` ) ;
73
73
mappedCols [ i ] = mapped . column ;
74
74
return mapped . line ;
75
75
} else {
76
- Services . 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` ) ;
77
77
mappedCols [ i ] = 0 ;
78
78
return line ;
79
79
}
@@ -101,10 +101,10 @@ export class SourceMapTransformer implements DebugProtocol.IDebugTransformer {
101
101
} ) ;
102
102
} else if ( this . _allRuntimeScriptPaths . has ( argsPath ) ) {
103
103
// It's a generated file which is loaded
104
- Services . 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` ) ;
105
105
} else {
106
106
// Source (or generated) file which is not loaded, need to wait
107
- Services . 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.` ) ;
108
108
this . _pendingBreakpointsByPath . set ( argsPath , { resolve, reject, args, requestSeq } ) ;
109
109
return ;
110
110
}
@@ -132,10 +132,10 @@ export class SourceMapTransformer implements DebugProtocol.IDebugTransformer {
132
132
response . breakpoints . forEach ( ( bp , i ) => {
133
133
const mapped = this . _sourceMaps . MapToSource ( args . source . path , args . lines [ i ] , args . cols [ i ] ) ;
134
134
if ( mapped ) {
135
- Services . 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 } ` ) ;
136
136
bp . line = mapped . line ;
137
137
} else {
138
- Services . 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.` ) ;
139
139
}
140
140
141
141
this . _requestSeqToSetBreakpointsArgs . delete ( requestSeq ) ;
@@ -201,7 +201,7 @@ export class SourceMapTransformer implements DebugProtocol.IDebugTransformer {
201
201
this . _sourceMaps . ProcessNewSourceMap ( event . body . scriptUrl , sourceMapUrlValue ) . then ( ( ) => {
202
202
const sources = this . _sourceMaps . AllMappedSources ( event . body . scriptUrl ) ;
203
203
if ( sources ) {
204
- Services . 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 ) } ` ) ;
205
205
sources . forEach ( this . resolvePendingBreakpoints , this ) ;
206
206
}
207
207
} ) ;
@@ -241,7 +241,7 @@ export class SourceMapTransformer implements DebugProtocol.IDebugTransformer {
241
241
private resolvePendingBreakpoints ( sourcePath : string ) : void {
242
242
// If there's a setBreakpoints request waiting on this script, go through setBreakpoints again
243
243
if ( this . _pendingBreakpointsByPath . has ( sourcePath ) ) {
244
- Services . logger . log ( `SourceMaps.scriptParsed: Resolving pending breakpoints for ${ sourcePath } ` ) ;
244
+ Services . logger ( ) . log ( `SourceMaps.scriptParsed: Resolving pending breakpoints for ${ sourcePath } ` ) ;
245
245
const pendingBreakpoint = this . _pendingBreakpointsByPath . get ( sourcePath ) ;
246
246
this . _pendingBreakpointsByPath . delete ( sourcePath ) ;
247
247
0 commit comments