11import { NonterminalKind } from '@nomicfoundation/slang/cst' ;
22import { util } from 'prettier' ;
33import { locEnd } from '../../slang-utils/loc.js' ;
4- import addCollectionNodeFirstComment from './add-collection-node -first-comment.js' ;
4+ import addCollectionFirstComment from './add-collection-first-comment.js' ;
55
66import type { HandlerParams } from './types.d.ts' ;
77
@@ -45,10 +45,7 @@ export default function handleIfStatementComments({
4545
4646 if ( followingNode . kind === NonterminalKind . IfStatement ) {
4747 if ( followingNode . body . variant . kind === NonterminalKind . Block ) {
48- addCollectionNodeFirstComment (
49- followingNode . body . variant . statements ,
50- comment
51- ) ;
48+ addCollectionFirstComment ( followingNode . body . variant . statements , comment ) ;
5249 } else {
5350 addLeadingComment ( followingNode . body . variant , comment ) ;
5451 }
@@ -60,7 +57,7 @@ export default function handleIfStatementComments({
6057 // if (a) /* comment */ true
6158 if ( enclosingNode . body === followingNode ) {
6259 if ( followingNode . variant . kind === NonterminalKind . Block ) {
63- addCollectionNodeFirstComment ( followingNode . variant . statements , comment ) ;
60+ addCollectionFirstComment ( followingNode . variant . statements , comment ) ;
6461 } else {
6562 addLeadingComment ( followingNode , comment ) ;
6663 }
0 commit comments