463
edits.push({ offset: node.endOffset, length: 0, content: ',' + newProperty });
464
}
466
>
/* Insert after a comment */
467
>
else {
468
>
469
>
const nextSettingNode = findNextSettingNode(location.index, tree);
470
>
const previousSettingNode = findPreviousSettingNode(location.index, tree);
471
>
const previousSettingCommaOffset = previousSettingNode?.setting?.commaOffset;
472
>
473
>
/* If there is a previous setting and it does not has comma then add it */
474
>
if (previousSettingNode && previousSettingCommaOffset === undefined) {
475
edits.push({ offset: previousSettingNode.endOffset, length: 0, content: ',' });
476
}
478
>
const isPreviouisSettingIncludesComment = previousSettingCommaOffset !== undefined && previousSettingCommaOffset > node.endOffset;
479
>
edits.push({
480
>
offset: isPreviouisSettingIncludesComment ? previousSettingCommaOffset + 1 : node.endOffset,
481
>
length: 0,
482
>
content: nextSettingNode ? eol + newProperty + ',' : eol + newProperty
483
>
});
484
>
}
485
486