11import { NonterminalKind } from '@nomicfoundation/slang/kinds/index.js' ;
22import { util } from 'prettier' ;
33import { getNextNonSpaceNonCommentCharacter } from '../../slang-utils/backward-compatibility.js' ;
4- import addHubNodeFirstComment from './add-hub -node-first-comment.js' ;
4+ import addCollectionNodeFirstComment from './add-collection -node-first-comment.js' ;
55
66import type { HandlerParams } from './types' ;
77
@@ -42,7 +42,10 @@ export default function handleIfStatementComments({
4242
4343 if ( followingNode . kind === NonterminalKind . IfStatement ) {
4444 if ( followingNode . body . variant . kind === NonterminalKind . Block ) {
45- addHubNodeFirstComment ( followingNode . body . variant . statements , comment ) ;
45+ addCollectionNodeFirstComment (
46+ followingNode . body . variant . statements ,
47+ comment
48+ ) ;
4649 } else {
4750 addLeadingComment ( followingNode . body . variant , comment ) ;
4851 }
@@ -54,7 +57,7 @@ export default function handleIfStatementComments({
5457 // if (a) /* comment */ true
5558 if ( enclosingNode . body === followingNode ) {
5659 if ( followingNode . variant . kind === NonterminalKind . Block ) {
57- addHubNodeFirstComment ( followingNode . variant . statements , comment ) ;
60+ addCollectionNodeFirstComment ( followingNode . variant . statements , comment ) ;
5861 } else {
5962 addLeadingComment ( followingNode , comment ) ;
6063 }
0 commit comments