Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/services/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"refactorProvider.ts",
"codefixes/addMissingInvocationForDecorator.ts",
"codefixes/annotateWithTypeFromJSDoc.ts",
"codefixes/inferFromUsage.ts",
"codefixes/convertFunctionToEs6Class.ts",
"codefixes/convertToAsyncFunction.ts",
"codefixes/convertToEs6Module.ts",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

verify.codeFix({
description: "Infer parameter types from usage",
index: 2,
index: 0,
newFileContent:
`/**
* @param {(arg0: any) => void} callback
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/fourslash/codeFixInferFromUsageJS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 1 addition & 1 deletion tests/cases/fourslash/codeFixInferFromUsageMember2JS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
////i.p = 0;


verify.rangeAfterCodeFix("p: number", undefined, undefined, 1);
verify.rangeAfterCodeFix("p: number", undefined, undefined, 0);
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

verify.codeFix({
description: "Infer parameter types from usage",
index: 6,
index: 4,
newFileContent:
`/**
* @param {number} a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

verify.codeFix({
description: "Infer parameter types from usage",
index: 2,
index: 0,
newFileContent:
`/**
* @param {number[]} a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

verify.codeFix({
description: "Infer parameter types from usage",
index: 2,
index: 0,
newFileContent:
`/**
* @param {number} [a]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

verify.codeFix({
description: "Infer parameter types from usage",
index: 2,
index: 0,
newFileContent:
`/**
* @param {*} y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

verify.codeFix({
description: "Infer parameter types from usage",
index: 2,
index: 0,
newFileContent:
`/**
* @param {{ b: { c: any; }; }} a
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/fourslash/codeFixInferFromUsageRestParam2JS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

verify.codeFix({
description: "Infer parameter types from usage",
index: 2,
index: 0,
newFileContent:
`/**
* @param {number} a
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/fourslash/codeFixInferFromUsageRestParam3JS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

verify.codeFix({
description: "Infer parameter types from usage",
index: 2,
index: 0,
newFileContent:
`/**
* @param {number} a
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/fourslash/codeFixInferFromUsageRestParamJS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

verify.codeFix({
description: "Infer parameter types from usage",
index: 4,
index: 2,
newFileContent:
`/**
* @param {number} a
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/fourslash/codeFixInferFromUsageSetterJS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

verify.codeFix({
description: "Infer type of \'x\' from usage",
index: 2,
index: 0,
newFileContent:
`class C {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

verify.codeFix({
description: "Infer parameter types from usage",
index: 2,
index: 0,
newFileContent:
`class C {/**
* @param {number} x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
////}

verify.codeFix({
index: 2,
index: 0,
description: "Infer parameter types from usage",
newFileContent:
`/**
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/fourslash/codeFixInferFromUsageVariable2JS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ var x;
function f() {
x++;
}
`, /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, 2);
`, /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, 0);
2 changes: 1 addition & 1 deletion tests/cases/fourslash/codeFixInferFromUsageVariableJS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);