TypeScript/tests/cases/fourslash/codeFixUnusedIdentifier_delete_templateTag.ts
Andy d40d54984e
Support deleting all unused type parameters in a list, and deleting @template tag (#25748)
* Support deleting all unused type parameters in a list, and deleting @template tag

* Support type parameter in 'infer'
2018-07-27 11:55:31 -07:00

62 lines
1,007 B
TypeScript

/// <reference path='fourslash.ts' />
// @allowJs: true
// @Filename: /first.js
/////**
//// * Doc
//// * @template T,U Comment
//// * @param {U} p
//// */
////function first(p) { return p; }
goTo.file("/first.js");
verify.codeFix({
index: 0,
description: "Remove declaration for: 'T'",
newFileContent:
`/**
* Doc
* @template U Comment
* @param {U} p
*/
function first(p) { return p; }`,
});
// @Filename: /second.js
/////**
//// * Doc
//// * @template T,U Comment
//// * @param {T} p
//// */
////function second(p) { return p; }
goTo.file("/second.js");
verify.codeFix({
description: "Remove declaration for: 'U'",
index: 0,
newFileContent:
`/**
* Doc
* @template T Comment
* @param {T} p
*/
function second(p) { return p; }`,
});
// @Filename: /both.js
/////**
//// * @template T,U Comment
//// */
////function both() {}
goTo.file("/both.js");
verify.codeFix({
description: "Remove template tag",
newFileContent:
`/**
* Comment
*/
function both() {}`,
});