mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 20:14:01 -06:00
Move infer-from-usage earlier in codefix list (#28318)
This makes it appear before the ts-ignore codefix, specifically.
This commit is contained in:
parent
4e59096ea5
commit
ce85ee5115
@ -45,6 +45,7 @@
|
||||
"refactorProvider.ts",
|
||||
"codefixes/addMissingInvocationForDecorator.ts",
|
||||
"codefixes/annotateWithTypeFromJSDoc.ts",
|
||||
"codefixes/inferFromUsage.ts",
|
||||
"codefixes/convertFunctionToEs6Class.ts",
|
||||
"codefixes/convertToAsyncFunction.ts",
|
||||
"codefixes/convertToEs6Module.ts",
|
||||
@ -66,7 +67,6 @@
|
||||
"codefixes/fixAwaitInSyncFunction.ts",
|
||||
"codefixes/disableJsDiagnostics.ts",
|
||||
"codefixes/helpers.ts",
|
||||
"codefixes/inferFromUsage.ts",
|
||||
"codefixes/fixInvalidImportSyntax.ts",
|
||||
"codefixes/fixStrictClassInitialization.ts",
|
||||
"codefixes/generateTypes.ts",
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Infer parameter types from usage",
|
||||
index: 2,
|
||||
index: 0,
|
||||
newFileContent:
|
||||
`/**
|
||||
* @param {(arg0: any) => void} callback
|
||||
|
||||
@ -9,4 +9,4 @@
|
||||
//// foo += 2;
|
||||
////}
|
||||
|
||||
verify.rangeAfterCodeFix("/** @type {number} */\nvar foo;",/*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, 2);
|
||||
verify.rangeAfterCodeFix("/** @type {number} */\nvar foo;",/*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, 0);
|
||||
|
||||
@ -11,4 +11,4 @@
|
||||
////i.p = 0;
|
||||
|
||||
|
||||
verify.rangeAfterCodeFix("p: number", undefined, undefined, 1);
|
||||
verify.rangeAfterCodeFix("p: number", undefined, undefined, 0);
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Infer parameter types from usage",
|
||||
index: 6,
|
||||
index: 4,
|
||||
newFileContent:
|
||||
`/**
|
||||
* @param {number} a
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Infer parameter types from usage",
|
||||
index: 2,
|
||||
index: 0,
|
||||
newFileContent:
|
||||
`/**
|
||||
* @param {number[]} a
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Infer parameter types from usage",
|
||||
index: 2,
|
||||
index: 0,
|
||||
newFileContent:
|
||||
`/**
|
||||
* @param {number} [a]
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Infer parameter types from usage",
|
||||
index: 2,
|
||||
index: 0,
|
||||
newFileContent:
|
||||
`/**
|
||||
* @param {*} y
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Infer parameter types from usage",
|
||||
index: 2,
|
||||
index: 0,
|
||||
newFileContent:
|
||||
`/**
|
||||
* @param {{ b: { c: any; }; }} a
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Infer parameter types from usage",
|
||||
index: 2,
|
||||
index: 0,
|
||||
newFileContent:
|
||||
`/**
|
||||
* @param {number} a
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Infer parameter types from usage",
|
||||
index: 2,
|
||||
index: 0,
|
||||
newFileContent:
|
||||
`/**
|
||||
* @param {number} a
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Infer parameter types from usage",
|
||||
index: 4,
|
||||
index: 2,
|
||||
newFileContent:
|
||||
`/**
|
||||
* @param {number} a
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Infer type of \'x\' from usage",
|
||||
index: 2,
|
||||
index: 0,
|
||||
newFileContent:
|
||||
`class C {
|
||||
/**
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
goTo.file("/b.js");
|
||||
verify.codeFix({
|
||||
index: 2,
|
||||
index: 0,
|
||||
description: "Infer type of 'x' from usage",
|
||||
newFileContent:
|
||||
`export class C {
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Infer parameter types from usage",
|
||||
index: 2,
|
||||
index: 0,
|
||||
newFileContent:
|
||||
`class C {/**
|
||||
* @param {number} x
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
////}
|
||||
|
||||
verify.codeFix({
|
||||
index: 2,
|
||||
index: 0,
|
||||
description: "Infer parameter types from usage",
|
||||
newFileContent:
|
||||
`/**
|
||||
|
||||
@ -15,4 +15,4 @@ var x;
|
||||
function f() {
|
||||
x++;
|
||||
}
|
||||
`, /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, 2);
|
||||
`, /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, 0);
|
||||
|
||||
@ -11,4 +11,4 @@
|
||||
//// x++;
|
||||
////}
|
||||
|
||||
verify.rangeAfterCodeFix("/** @type {number } */\nvar x;", /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, 2);
|
||||
verify.rangeAfterCodeFix("/** @type {number } */\nvar x;", /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, 0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user