Cherry-pick PR #34745 into release-3.7 (#34766)

Component commits:
07a371bbf6 Fix extract type on JS function params
This commit is contained in:
TypeScript Bot
2019-10-28 11:04:07 -07:00
committed by Andrew Branch
parent 6317c901d7
commit 9df593b1f3
2 changed files with 19 additions and 5 deletions
@@ -0,0 +1,18 @@
/// <reference path='fourslash.ts' />
// @allowJs: true
// @Filename: a.js
////function a(/** @type {/*a*/string/*b*/} */ b) {}
goTo.file('a.js')
goTo.select("a", "b");
edit.applyRefactor({
refactorName: "Extract type",
actionName: "Extract to typedef",
actionDescription: "Extract to typedef",
newContent: `/**
* @typedef {string} /*RENAME*/NewType
*/
function a(/** @type {NewType} */ b) {}`,
});