1/// <reference path='fourslash.ts' /> 2 3// @filename: a.ts 4/////** 5//// * @param {number} notDefined1 6//// * @param {number} notDefined2 7//// * @param {number} a 8//// * @param {number} b 9//// */ 10////function foo(a: number, b: string, typo1: string, typo2: string) { 11//// a; 12//// b; 13//// typo1; 14//// typo2; 15////} 16 17verify.codeFixAvailable([ 18 { description: "Delete unused '@param' tag 'notDefined1'" }, 19 { description: "Rename '@param' tag name 'notDefined1' to 'typo1'" }, 20 { description: "Delete unused '@param' tag 'notDefined2'" }, 21 { description: "Rename '@param' tag name 'notDefined2' to 'typo1'" }, 22]); 23 24verify.codeFix({ 25 description: [ts.Diagnostics.Rename_param_tag_name_0_to_1.message, "notDefined1", "typo1"], 26 index: 1, 27 newFileContent: 28`/** 29 * @param {number} typo1 30 * @param {number} notDefined2 31 * @param {number} a 32 * @param {number} b 33 */ 34function foo(a: number, b: string, typo1: string, typo2: string) { 35 a; 36 b; 37 typo1; 38 typo2; 39}`, 40 applyChanges: true 41}); 42 43verify.codeFixAvailable([ 44 { description: "Delete unused '@param' tag 'notDefined2'" }, 45 { description: "Rename '@param' tag name 'notDefined2' to 'typo2'" }, 46]); 47 48verify.codeFix({ 49 description: [ts.Diagnostics.Rename_param_tag_name_0_to_1.message, "notDefined2", "typo2"], 50 index: 1, 51 newFileContent: 52`/** 53 * @param {number} typo1 54 * @param {number} typo2 55 * @param {number} a 56 * @param {number} b 57 */ 58function foo(a: number, b: string, typo1: string, typo2: string) { 59 a; 60 b; 61 typo1; 62 typo2; 63}`, 64}); 65