@@ -16,16 +16,16 @@ type writerAggregator struct {
16
16
strings.Builder
17
17
}
18
18
19
- func (w * writerAggregator ) WriteStringF (format string , args ... any ) {
19
+ func (w * writerAggregator ) WriteStringf (format string , args ... any ) {
20
20
w .WriteString (fmt .Sprintf (format , args ... ))
21
21
}
22
22
23
23
func (w * writerAggregator ) WriteLine (s string ) {
24
24
w .WriteString (s + "\r \n " )
25
25
}
26
26
27
- func (w * writerAggregator ) WriteLineF (format string , args ... any ) {
28
- w .WriteStringF (format + "\r \n " , args ... )
27
+ func (w * writerAggregator ) WriteLinef (format string , args ... any ) {
28
+ w .WriteStringf (format + "\r \n " , args ... )
29
29
}
30
30
31
31
type sourceMapSpanWithDecodeErrors struct {
@@ -103,31 +103,31 @@ func newSourceMapSpanWriter(sourceMapRecorder *writerAggregator, sourceMap *sour
103
103
}
104
104
105
105
sourceMapRecorder .WriteLine ("===================================================================" )
106
- sourceMapRecorder .WriteLineF ("JsFile: %s" , sourceMap .File )
107
- sourceMapRecorder .WriteLineF ("mapUrl: %s" , sourcemap .TryGetSourceMappingURL (sourcemap .CreateECMALineInfo (jsFile .Content , writer .jsLineMap )))
108
- sourceMapRecorder .WriteLineF ("sourceRoot: %s" , sourceMap .SourceRoot )
109
- sourceMapRecorder .WriteLineF ("sources: %s" , strings .Join (sourceMap .Sources , "," ))
106
+ sourceMapRecorder .WriteLinef ("JsFile: %s" , sourceMap .File )
107
+ sourceMapRecorder .WriteLinef ("mapUrl: %s" , sourcemap .TryGetSourceMappingURL (sourcemap .CreateECMALineInfo (jsFile .Content , writer .jsLineMap )))
108
+ sourceMapRecorder .WriteLinef ("sourceRoot: %s" , sourceMap .SourceRoot )
109
+ sourceMapRecorder .WriteLinef ("sources: %s" , strings .Join (sourceMap .Sources , "," ))
110
110
if len (sourceMap .SourcesContent ) > 0 {
111
111
content , err := json .Marshal (sourceMap .SourcesContent )
112
112
if err != nil {
113
113
panic (err )
114
114
}
115
- sourceMapRecorder .WriteLineF ("sourcesContent: %s" , content )
115
+ sourceMapRecorder .WriteLinef ("sourcesContent: %s" , content )
116
116
}
117
117
sourceMapRecorder .WriteLine ("===================================================================" )
118
118
return writer
119
119
}
120
120
121
121
func (w * sourceMapSpanWriter ) getSourceMapSpanString (mapEntry * sourcemap.Mapping , getAbsentNameIndex bool ) string {
122
122
var mapString writerAggregator
123
- mapString .WriteStringF ("Emitted(%d, %d)" , mapEntry .GeneratedLine + 1 , mapEntry .GeneratedCharacter + 1 )
123
+ mapString .WriteStringf ("Emitted(%d, %d)" , mapEntry .GeneratedLine + 1 , mapEntry .GeneratedCharacter + 1 )
124
124
if mapEntry .IsSourceMapping () {
125
- mapString .WriteStringF (" Source(%d, %d) + SourceIndex(%d)" , mapEntry .SourceLine + 1 , mapEntry .SourceCharacter + 1 , mapEntry .SourceIndex )
125
+ mapString .WriteStringf (" Source(%d, %d) + SourceIndex(%d)" , mapEntry .SourceLine + 1 , mapEntry .SourceCharacter + 1 , mapEntry .SourceIndex )
126
126
if mapEntry .NameIndex >= 0 && int (mapEntry .NameIndex ) < len (w .sourceMapNames ) {
127
- mapString .WriteStringF (" name (%s)" , w .sourceMapNames [mapEntry .NameIndex ])
127
+ mapString .WriteStringf (" name (%s)" , w .sourceMapNames [mapEntry .NameIndex ])
128
128
} else {
129
129
if mapEntry .NameIndex != sourcemap .MissingName || getAbsentNameIndex {
130
- mapString .WriteStringF (" nameIndex (%d)" , mapEntry .NameIndex )
130
+ mapString .WriteStringf (" nameIndex (%d)" , mapEntry .NameIndex )
131
131
}
132
132
}
133
133
}
@@ -180,11 +180,11 @@ func (w *sourceMapSpanWriter) recordNewSourceFileSpan(sourceMapSpan *sourcemap.M
180
180
181
181
w .sourceMapRecorder .WriteLine ("-------------------------------------------------------------------" )
182
182
if continuesLine {
183
- w .sourceMapRecorder .WriteLineF ("emittedFile:%s (%d, %d)" , w .jsFile .UnitName , sourceMapSpan .GeneratedLine + 1 , sourceMapSpan .GeneratedCharacter + 1 )
183
+ w .sourceMapRecorder .WriteLinef ("emittedFile:%s (%d, %d)" , w .jsFile .UnitName , sourceMapSpan .GeneratedLine + 1 , sourceMapSpan .GeneratedCharacter + 1 )
184
184
} else {
185
- w .sourceMapRecorder .WriteLineF ("emittedFile:%s" , w .jsFile .UnitName )
185
+ w .sourceMapRecorder .WriteLinef ("emittedFile:%s" , w .jsFile .UnitName )
186
186
}
187
- w .sourceMapRecorder .WriteLineF ("sourceFile:%s" , w .sourceMapSources [w .spansOnSingleLine [0 ].sourceMapSpan .SourceIndex ])
187
+ w .sourceMapRecorder .WriteLinef ("sourceFile:%s" , w .sourceMapSources [w .spansOnSingleLine [0 ].sourceMapSpan .SourceIndex ])
188
188
w .sourceMapRecorder .WriteLine ("-------------------------------------------------------------------" )
189
189
190
190
w .tsLineMap = core .ComputeECMALineStarts (newSourceFileCode )
@@ -198,7 +198,7 @@ func (w *sourceMapSpanWriter) close() {
198
198
199
199
if ! w .sourceMapDecoder .hasCompletedDecoding () {
200
200
w .sourceMapRecorder .WriteLine ("!!!! **** There are more source map entries in the sourceMap's mapping than what was encoded" )
201
- w .sourceMapRecorder .WriteLineF ("!!!! **** Remaining decoded string: %s" , w .sourceMapDecoder .getRemainingDecodeString ())
201
+ w .sourceMapRecorder .WriteLinef ("!!!! **** Remaining decoded string: %s" , w .sourceMapDecoder .getRemainingDecodeString ())
202
202
}
203
203
204
204
// write remaining js lines
@@ -223,7 +223,7 @@ func (w *sourceMapSpanWriter) getTextOfLine(line int, lineMap []core.TextPos, co
223
223
224
224
func (w * sourceMapSpanWriter ) writeJsFileLines (endJsLine int ) {
225
225
for ; w .nextJsLineToWrite < endJsLine ; w .nextJsLineToWrite ++ {
226
- w .sourceMapRecorder .WriteStringF (">>>%s" , w .getTextOfLine (w .nextJsLineToWrite , w .jsLineMap , w .jsFile .Content ))
226
+ w .sourceMapRecorder .WriteStringf (">>>%s" , w .getTextOfLine (w .nextJsLineToWrite , w .jsLineMap , w .jsFile .Content ))
227
227
}
228
228
}
229
229
@@ -319,7 +319,7 @@ func (sw *recordedSpanWriter) writeSourceMapSourceText(currentSpan *sourceMapSpa
319
319
}
320
320
321
321
func (sw * recordedSpanWriter ) writeSpanDetails (currentSpan * sourceMapSpanWithDecodeErrors , index int ) {
322
- sw .w .sourceMapRecorder .WriteLineF ("%s%s" , sw .markerIds [index ], sw .w .getSourceMapSpanString (currentSpan .sourceMapSpan , false /*getAbsentNameIndex*/ ))
322
+ sw .w .sourceMapRecorder .WriteLinef ("%s%s" , sw .markerIds [index ], sw .w .getSourceMapSpanString (currentSpan .sourceMapSpan , false /*getAbsentNameIndex*/ ))
323
323
}
324
324
325
325
func (sw * recordedSpanWriter ) writeRecordedSpans () {
0 commit comments