diff --git a/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_Availability_Arrow.ts b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_Availability_Arrow.ts
new file mode 100644
index 00000000000..673b49ef703
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_Availability_Arrow.ts
@@ -0,0 +1,33 @@
+///
+
+//// /*z*/c/*y*/onst /*x*/f/*w*/oo = /*v*/(/*u*//*t*/a/*s*/, b) /*r*/=/*q*/> /*p*/4/*o*/2;
+
+goTo.select("z", "y");
+verify.refactorAvailable("Convert arrow function or function expression", "Convert to named function");
+verify.not.refactorAvailable("Convert arrow function or function expression", "Convert to anonymous function");
+verify.not.refactorAvailable("Convert arrow function or function expression", "Convert to arrow function");
+
+goTo.select("x", "w");
+verify.refactorAvailable("Convert arrow function or function expression", "Convert to named function");
+verify.not.refactorAvailable("Convert arrow function or function expression", "Convert to anonymous function");
+verify.not.refactorAvailable("Convert arrow function or function expression", "Convert to arrow function");
+
+goTo.select("v", "u");
+verify.refactorAvailable("Convert arrow function or function expression", "Convert to named function");
+verify.refactorAvailable("Convert arrow function or function expression", "Convert to anonymous function");
+verify.not.refactorAvailable("Convert arrow function or function expression", "Convert to arrow function");
+
+goTo.select("t", "s");
+verify.refactorAvailable("Convert arrow function or function expression", "Convert to named function");
+verify.refactorAvailable("Convert arrow function or function expression", "Convert to anonymous function");
+verify.not.refactorAvailable("Convert arrow function or function expression", "Convert to arrow function");
+
+goTo.select("r", "q");
+verify.refactorAvailable("Convert arrow function or function expression", "Convert to named function");
+verify.refactorAvailable("Convert arrow function or function expression", "Convert to anonymous function");
+verify.not.refactorAvailable("Convert arrow function or function expression", "Convert to arrow function");
+
+goTo.select("p", "o");
+verify.not.refactorAvailable("Convert arrow function or function expression", "Convert to named function");
+verify.not.refactorAvailable("Convert arrow function or function expression", "Convert to anonymous function");
+verify.not.refactorAvailable("Convert arrow function or function expression", "Convert to arrow function");
\ No newline at end of file
diff --git a/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToAnon_Comment.ts b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToAnon_Comment.ts
new file mode 100644
index 00000000000..c3a65cbf055
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToAnon_Comment.ts
@@ -0,0 +1,23 @@
+///
+
+//// const foo = /*x*/a/*y*/ => {
+//// // secret word
+//// return a + 1;
+//// /*
+//// hidden msg
+//// */
+//// };
+
+goTo.select("x", "y");
+edit.applyRefactor({
+ refactorName: "Convert arrow function or function expression",
+ actionName: "Convert to anonymous function",
+ actionDescription: "Convert to anonymous function",
+ newContent: `const foo = function(a) {
+ // secret word
+ return a + 1;
+ /*
+ hidden msg
+ */
+};`,
+});
diff --git a/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToAnon_MultiLine.ts b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToAnon_MultiLine.ts
new file mode 100644
index 00000000000..cbaadbf6a85
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToAnon_MultiLine.ts
@@ -0,0 +1,17 @@
+///
+
+//// const foo = /*x*/a/*y*/ => {
+//// let b = 1;
+//// return a + b;
+//// };
+
+goTo.select("x", "y");
+edit.applyRefactor({
+ refactorName: "Convert arrow function or function expression",
+ actionName: "Convert to anonymous function",
+ actionDescription: "Convert to anonymous function",
+ newContent: `const foo = function(a) {
+ let b = 1;
+ return a + b;
+};`,
+});
diff --git a/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToAnon_MultiParam.ts b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToAnon_MultiParam.ts
new file mode 100644
index 00000000000..38953dbf248
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToAnon_MultiParam.ts
@@ -0,0 +1,13 @@
+///
+
+//// const foo = /*x*/(/*y*/a,b,c) => a + 1;
+
+goTo.select("x", "y");
+edit.applyRefactor({
+ refactorName: "Convert arrow function or function expression",
+ actionName: "Convert to anonymous function",
+ actionDescription: "Convert to anonymous function",
+ newContent: `const foo = function(a, b, c) {
+ return a + 1;
+};`,
+});
diff --git a/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToAnon_SingleLine.ts b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToAnon_SingleLine.ts
new file mode 100644
index 00000000000..9870104eb16
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToAnon_SingleLine.ts
@@ -0,0 +1,13 @@
+///
+
+//// const foo = /*x*/(/*y*/) => 1 + 1;
+
+goTo.select("x", "y");
+edit.applyRefactor({
+ refactorName: "Convert arrow function or function expression",
+ actionName: "Convert to anonymous function",
+ actionDescription: "Convert to anonymous function",
+ newContent: `const foo = function() {
+ return 1 + 1;
+};`,
+});
diff --git a/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_MultiLine.ts b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_MultiLine.ts
new file mode 100644
index 00000000000..71855947b36
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_MultiLine.ts
@@ -0,0 +1,17 @@
+///
+
+//// const foo = /*x*/f/*y*/unction() {
+//// let a = 41;
+//// return a + 1;
+//// };
+
+goTo.select("x", "y");
+edit.applyRefactor({
+ refactorName: "Convert arrow function or function expression",
+ actionName: "Convert to arrow function",
+ actionDescription: "Convert to arrow function",
+ newContent: `const foo = () => {
+ let a = 41;
+ return a + 1;
+};`,
+});
diff --git a/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_MultiLine_Comment.ts b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_MultiLine_Comment.ts
new file mode 100644
index 00000000000..470cae1c446
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_MultiLine_Comment.ts
@@ -0,0 +1,25 @@
+///
+
+//// const foo = /*x*/f/*y*/unction() {
+//// // secret
+//// let a = 41;
+//// /*
+//// msg
+//// */
+//// return a + 1;
+//// };
+
+goTo.select("x", "y");
+edit.applyRefactor({
+ refactorName: "Convert arrow function or function expression",
+ actionName: "Convert to arrow function",
+ actionDescription: "Convert to arrow function",
+ newContent: `const foo = () => {
+ // secret
+ let a = 41;
+ /*
+ msg
+ */
+ return a + 1;
+};`,
+});
diff --git a/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Param.ts b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Param.ts
new file mode 100644
index 00000000000..a7659080998
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Param.ts
@@ -0,0 +1,13 @@
+///
+
+//// const foo = /*x*/f/*y*/unction(a, b, c) {
+//// return a + b + c;
+//// };
+
+goTo.select("x", "y");
+edit.applyRefactor({
+ refactorName: "Convert arrow function or function expression",
+ actionName: "Convert to arrow function",
+ actionDescription: "Convert to arrow function",
+ newContent: `const foo = (a, b, c) => a + b + c;`,
+});
diff --git a/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_Assign.ts b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_Assign.ts
new file mode 100644
index 00000000000..453a3f701bc
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_Assign.ts
@@ -0,0 +1,15 @@
+///
+
+//// let bar;
+//// const foo = /*x*/f/*y*/unction() {
+//// bar = 42;
+//// };
+
+goTo.select("x", "y");
+edit.applyRefactor({
+ refactorName: "Convert arrow function or function expression",
+ actionName: "Convert to arrow function",
+ actionDescription: "Convert to arrow function",
+ newContent: `let bar;
+const foo = () => bar = 42;`,
+});
diff --git a/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_Decl.ts b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_Decl.ts
new file mode 100644
index 00000000000..e1f15b78f3d
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_Decl.ts
@@ -0,0 +1,15 @@
+///
+
+//// const foo = /*x*/f/*y*/unction() {
+//// let bar;
+//// };
+
+goTo.select("x", "y");
+edit.applyRefactor({
+ refactorName: "Convert arrow function or function expression",
+ actionName: "Convert to arrow function",
+ actionDescription: "Convert to arrow function",
+ newContent: `const foo = () => {
+ let bar;
+};`,
+});
diff --git a/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_FnCall.ts b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_FnCall.ts
new file mode 100644
index 00000000000..e9cced11640
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_FnCall.ts
@@ -0,0 +1,15 @@
+///
+
+//// function s(){}
+//// const foo = /*x*/f/*y*/unction() {
+//// s();
+//// };
+
+goTo.select("x", "y");
+edit.applyRefactor({
+ refactorName: "Convert arrow function or function expression",
+ actionName: "Convert to arrow function",
+ actionDescription: "Convert to arrow function",
+ newContent: `function s(){}
+const foo = () => s();`,
+});
diff --git a/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_For.ts b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_For.ts
new file mode 100644
index 00000000000..a0da4868b0e
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_For.ts
@@ -0,0 +1,15 @@
+///
+
+//// const foo = /*x*/f/*y*/unction() {
+//// for (let i = 0; i < 5; i++) { }
+//// };
+
+goTo.select("x", "y");
+edit.applyRefactor({
+ refactorName: "Convert arrow function or function expression",
+ actionName: "Convert to arrow function",
+ actionDescription: "Convert to arrow function",
+ newContent: `const foo = () => {
+ for (let i = 0; i < 5; i++) { }
+};`,
+});
diff --git a/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_If.ts b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_If.ts
new file mode 100644
index 00000000000..65084f0f3a9
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_If.ts
@@ -0,0 +1,15 @@
+///
+
+//// const foo = /*x*/f/*y*/unction() {
+//// if (true) { }
+//// };
+
+goTo.select("x", "y");
+edit.applyRefactor({
+ refactorName: "Convert arrow function or function expression",
+ actionName: "Convert to arrow function",
+ actionDescription: "Convert to arrow function",
+ newContent: `const foo = () => {
+ if (true) { }
+};`,
+});
diff --git a/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_Return.ts b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_Return.ts
new file mode 100644
index 00000000000..c901046de3e
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_Return.ts
@@ -0,0 +1,13 @@
+///
+
+//// const foo = /*x*/f/*y*/unction() {
+//// return 42;
+//// };
+
+goTo.select("x", "y");
+edit.applyRefactor({
+ refactorName: "Convert arrow function or function expression",
+ actionName: "Convert to arrow function",
+ actionDescription: "Convert to arrow function",
+ newContent: `const foo = () => 42;`,
+});
diff --git a/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_While.ts b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_While.ts
new file mode 100644
index 00000000000..830a9b4933b
--- /dev/null
+++ b/tests/cases/fourslash/refactorConvertArrowFunctionOrFunctionExpression_ToArrow_Single_While.ts
@@ -0,0 +1,15 @@
+///
+
+//// const foo = /*x*/f/*y*/unction() {
+//// while (true) { }
+//// };
+
+goTo.select("x", "y");
+edit.applyRefactor({
+ refactorName: "Convert arrow function or function expression",
+ actionName: "Convert to arrow function",
+ actionDescription: "Convert to arrow function",
+ newContent: `const foo = () => {
+ while (true) { }
+};`,
+});