From 3825d193f6a41b60e559757e5794eba772156f4c Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Tue, 26 May 2020 17:41:23 -0700 Subject: [PATCH] extract symbol test --- tests/cases/fourslash/extractSymbolForTriggerReason.ts | 10 ++++++++++ tests/cases/fourslash/refactorExtractTypeValidSpans.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/extractSymbolForTriggerReason.ts diff --git a/tests/cases/fourslash/extractSymbolForTriggerReason.ts b/tests/cases/fourslash/extractSymbolForTriggerReason.ts new file mode 100644 index 00000000000..be946f5fc15 --- /dev/null +++ b/tests/cases/fourslash/extractSymbolForTriggerReason.ts @@ -0,0 +1,10 @@ +/// + +////function foo() { +//// return 1/*a*//*b*/00; +////} + +// Only offer refactor for empty span if explicity requested +goTo.select("a", "b"); +verify.not.refactorAvailableForTriggerReason("implicit", "Extract Symbol"); +verify.refactorAvailableForTriggerReason("invoked", "Extract Symbol", "constant_scope_0"); diff --git a/tests/cases/fourslash/refactorExtractTypeValidSpans.ts b/tests/cases/fourslash/refactorExtractTypeValidSpans.ts index cf0319876be..a1030a44c43 100644 --- a/tests/cases/fourslash/refactorExtractTypeValidSpans.ts +++ b/tests/cases/fourslash/refactorExtractTypeValidSpans.ts @@ -2,7 +2,7 @@ //// var x: /*1a*/{ a?:/*2a*/ number, b?: string/*2b*//*3a*//*3b*/ }/*1b*/ = { }; -// Only offer refactor for cursor position if explicitly requested +// Only offer refactor for empty span if explicity requested goTo.select("3a", "3b"); verify.refactorNotAvailableForTriggerReason("implicit", "Extract type");