@@ -5171,7 +5171,7 @@ func (p *Printer) emitLeadingComments(pos int, elided bool) bool {
5171
5171
}
5172
5172
5173
5173
var comments []ast.CommentRange
5174
- for comment := range scanner .GetLeadingCommentRanges (p .emitContext .Factory , p .currentSourceFile .Text (), pos ) {
5174
+ for comment := range scanner .GetLeadingCommentRanges (p .emitContext .Factory . AsNodeFactory () , p .currentSourceFile .Text (), pos ) {
5175
5175
if p .shouldWriteComment (comment ) && p .shouldEmitCommentIfTripleSlash (comment , tripleSlash ) {
5176
5176
comments = append (comments , comment )
5177
5177
}
@@ -5210,7 +5210,7 @@ func (p *Printer) emitTrailingComments(pos int, commentSeparator commentSeparato
5210
5210
}
5211
5211
5212
5212
var comments []ast.CommentRange
5213
- for comment := range scanner .GetTrailingCommentRanges (p .emitContext .Factory , p .currentSourceFile .Text (), pos ) {
5213
+ for comment := range scanner .GetTrailingCommentRanges (p .emitContext .Factory . AsNodeFactory () , p .currentSourceFile .Text (), pos ) {
5214
5214
if p .shouldWriteComment (comment ) {
5215
5215
comments = append (comments , comment )
5216
5216
}
@@ -5245,15 +5245,15 @@ func (p *Printer) emitDetachedComments(textRange core.TextRange) (result detache
5245
5245
//
5246
5246
// var x = 10;
5247
5247
if textRange .Pos () == 0 {
5248
- for comment := range scanner .GetLeadingCommentRanges (p .emitContext .Factory , text , textRange .Pos ()) {
5248
+ for comment := range scanner .GetLeadingCommentRanges (p .emitContext .Factory . AsNodeFactory () , text , textRange .Pos ()) {
5249
5249
if isPinnedComment (text , comment ) {
5250
5250
leadingComments = append (leadingComments , comment )
5251
5251
}
5252
5252
}
5253
5253
}
5254
5254
} else {
5255
5255
// removeComments is false, just get detached as normal and bypass the process to filter comment
5256
- leadingComments = slices .Collect (scanner .GetLeadingCommentRanges (p .emitContext .Factory , text , textRange .Pos ()))
5256
+ leadingComments = slices .Collect (scanner .GetLeadingCommentRanges (p .emitContext .Factory . AsNodeFactory () , text , textRange .Pos ()))
5257
5257
}
5258
5258
5259
5259
if len (leadingComments ) > 0 {
0 commit comments