RFC: indentIfBreak (#10221)

This commit is contained in:
Georgii Dolzhykov authored and GitHub committed 2021-02-05 01:03:40 +02:00
1 parent 575be32c05
commit 5a33fec904
14 files changed
+221 -31

No files matched your search

+17
View File
@@ -121,6 +121,23 @@ function printDocToDebug(doc) {
);
}
if (doc.type === "indent-if-break") {
const optionsParts = [];
if (doc.negate) {
optionsParts.push("negate: true");
}
if (doc.groupId) {
optionsParts.push(`groupId: ${printGroupId(doc.groupId)}`);
}
const options =
optionsParts.length > 0 ? `, { ${optionsParts.join(", ")} }` : "";
return `indentIfBreak(${printDoc(doc.contents)}${options})`;
}
if (doc.type === "group") {
const optionsParts = [];