diff --git a/tests/cases/fourslash/refactorExtractTypeValidSpans.ts b/tests/cases/fourslash/refactorExtractTypeValidSpans.ts new file mode 100644 index 00000000000..cf0319876be --- /dev/null +++ b/tests/cases/fourslash/refactorExtractTypeValidSpans.ts @@ -0,0 +1,12 @@ +/// + +//// var x: /*1a*/{ a?:/*2a*/ number, b?: string/*2b*//*3a*//*3b*/ }/*1b*/ = { }; + +// Only offer refactor for cursor position if explicitly requested +goTo.select("3a", "3b"); +verify.refactorNotAvailableForTriggerReason("implicit", "Extract type"); + +for (const m of ["1", "2", "3"]) { + goTo.select(m + "a", m + "b"); + verify.refactorAvailableForTriggerReason("invoked", "Extract type"); +}