diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts
index 62d3aaf19c6af..e06b0e6b8b1dc 100644
--- a/src/compiler/emitter.ts
+++ b/src/compiler/emitter.ts
@@ -2370,6 +2370,7 @@ namespace ts {
writeLine();
decreaseIndent();
}
+ emitList(node, node.members, ListFormat.PreserveLines);
writePunctuation("}");
}
diff --git a/tests/cases/fourslash/refactorExtractType76.ts b/tests/cases/fourslash/refactorExtractType76.ts
new file mode 100644
index 0000000000000..7dc67bf84cb91
--- /dev/null
+++ b/tests/cases/fourslash/refactorExtractType76.ts
@@ -0,0 +1,17 @@
+///
+
+// @Filename: a.ts
+////type Deep = /*a*/{ [K in keyof T]: Deep }/*b*/
+
+goTo.select("a", "b");
+edit.applyRefactor({
+ refactorName: "Extract type",
+ actionName: "Extract to type alias",
+ actionDescription: "Extract to type alias",
+ newContent:
+`type /*RENAME*/NewType = {
+ [K in keyof T]: Deep;
+};
+
+type Deep = NewType`,
+});
diff --git a/tests/cases/fourslash/refactorExtractType77.ts b/tests/cases/fourslash/refactorExtractType77.ts
new file mode 100644
index 0000000000000..df449726cb17e
--- /dev/null
+++ b/tests/cases/fourslash/refactorExtractType77.ts
@@ -0,0 +1,21 @@
+///
+
+// @Filename: a.ts
+////type Expand = T extends any
+//// ? /*a*/{ [K in keyof T]: Expand }/*b*/
+//// : never;
+
+goTo.select("a", "b");
+edit.applyRefactor({
+ refactorName: "Extract type",
+ actionName: "Extract to type alias",
+ actionDescription: "Extract to type alias",
+ newContent:
+`type /*RENAME*/NewType = {
+ [K in keyof T]: Expand;
+};
+
+type Expand = T extends any
+ ? NewType
+ : never;`,
+});