insertNodeInListAfter(sourceFile, after, newNode, containingList = ts_formatting_exports.SmartIndenter.getContainingList(after, sourceFile)) {
          if (!containingList) {
            Debug.fail("node is not a list element");
            return;
          }
          const index = indexOfNode(containingList, after);
          if (index < 0) {
            return;
          }
          const end = after.getEnd();
          if (index !== containingList.length - 1) {
            const nextToken = getTokenAtPosition(sourceFile, after.end);
            if (nextToken && isSeparator(after, nextToken)) {
              const nextNode = containingList[index + 1];
              const startPos = skipWhitespacesAndLineBreaks(sourceFile.text, nextNode.getFullStart());
              const suffix = `${tokenToString(nextToken.kind)}${sourceFile.text.substring(nextToken.end, startPos)}`;
              this.insertNodesAt(sourceFile, startPos, [newNode], { suffix });
            }
          } else {
            const afterStart = after.getStart(sourceFile);
            const afterStartLinePosition = getLineStartPositionForPosition(afterStart, sourceFile);
            let separator;
            let multilineList = false;
            if (containingList.length === 1) {
              separator = 28 /* CommaToken */;
            } else {
              const tokenBeforeInsertPosition = findPrecedingToken(after.pos, sourceFile);
              separator = isSeparator(after, tokenBeforeInsertPosition) ? tokenBeforeInsertPosition.kind : 28 /* CommaToken */;
              const afterMinusOneStartLinePosition = getLineStartPositionForPosition(containingList[index - 1].getStart(sourceFile), sourceFile);
              multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition;
            }
            if (hasCommentsBeforeLineBreak(sourceFile.text, after.end)) {
              multilineList = true;
            }
            if (multilineList) {
              this.replaceRange(sourceFile, createRange(end), factory.createToken(separator));
              const indentation = ts_formatting_exports.SmartIndenter.findFirstNonWhitespaceColumn(afterStartLinePosition, afterStart, sourceFile, this.formatContext.options);
              let insertPos = skipTrivia(
                sourceFile.text,
                end,
                /*stopAfterLineBreak*/
                true,
                /*stopAtComments*/
                false
              );
              while (insertPos !== end && isLineBreak(sourceFile.text.charCodeAt(insertPos - 1))) {
                insertPos--;
              }
              this.replaceRange(sourceFile, createRange(insertPos), newNode, { indentation, prefix: this.newLineCharacter });
            } else {
              this.replaceRange(sourceFile, createRange(end), newNode, { prefix: `${tokenToString(separator)} ` });
            }
          }
        }
This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range,
i.e. arguments in arguments lists, parameters in parameter lists etc.
Note that separators are part of the node in statements and class elements.