Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix(50416): correctly names disabled export refactors (#50663)
* added test case to try to retrieve duplicate refactor as in #50416. 'verify.refactorAvailable' correctly retrieves nonduplicate refactors... * optional arguments in refactorAvailable return `true` even if there is no single refactor that satisfies both * it still passes :C * Delete fixExtractToInnerFunctionDuplicaton.ts * deleted extra test code * fix 'verify.refactorAvailable' so that tests correctly check for multiple arguments * fixes #50416 * refactor
- Loading branch information
Showing
3 changed files
with
28 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
tests/cases/fourslash/server/fixExtractToInnerFunctionDuplicaton.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/// <reference path="../fourslash.ts" /> | ||
|
||
//// function foo(): void { /*x*/console.log('a');/*y*/ } | ||
|
||
goTo.select("x","y"); | ||
verify.refactorAvailable("Extract Symbol", 'function_scope_0', "Extract to inner function in function 'foo'"); | ||
verify.refactorAvailable("Extract Symbol", 'function_scope_1', "Extract to function in global scope"); | ||
|
||
verify.not.refactorAvailable("Extract Symbol", 'constant_scope_0', "Extract to inner function in function 'foo'"); | ||
|
||
verify.refactorAvailable("Extract Symbol", 'constant_scope_0', "Extract to constant in enclosing scope"); | ||
verify.refactorAvailable("Extract Symbol", 'constant_scope_1', "Extract to constant in global scope"); | ||
|
||
verify.not.refactorAvailable("Extract Symbol", 'constant_scope_0', "Extract to constant in global scope"); |