@@ -918,7 +918,8 @@ function genericPrint(path, options, print) {
918918 path . map ( ( childPath , index ) => {
919919 const child = childPath . getValue ( ) ;
920920 const isLast = index === node . groups . length - 1 ;
921- const printed = [ print ( ) , isLast ? "" : "," ] ;
921+
922+ let printed = [ print ( ) , isLast ? "" : "," ] ;
922923
923924 // Key/Value pair in open paren already indented
924925 if (
@@ -931,17 +932,22 @@ function genericPrint(path, options, print) {
931932 ) {
932933 const parts = getDocParts ( printed [ 0 ] . contents . contents ) ;
933934 parts [ 1 ] = group ( parts [ 1 ] ) ;
934- return group ( dedent ( printed ) ) ;
935+ printed = [ group ( dedent ( printed ) ) ] ;
935936 }
936937
937938 if (
938939 ! isLast &&
939940 child . type === "value-comma_group" &&
940941 isNonEmptyArray ( child . groups )
941942 ) {
942- const last = getLast ( child . groups ) ;
943+ let last = getLast ( child . groups ) ;
944+
945+ // `value-paren_group` does not have location info, but its closing parenthesis does.
946+ if ( ! last . source && last . close ) {
947+ last = last . close ;
948+ }
949+
943950 if (
944- // `value-paren_group` missing location info
945951 last . source &&
946952 isNextLineEmpty ( options . originalText , last , locEnd )
947953 ) {
0 commit comments