Skip to content

Commit 752a972

Browse files
committed
Change codefix message
1 parent bbba931 commit 752a972

16 files changed

+16
-16
lines changed

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3843,7 +3843,7 @@
38433843
"category": "Message",
38443844
"code": 90028
38453845
},
3846-
"Convert to async": {
3846+
"Add async modifier to containing function": {
38473847
"category": "Message",
38483848
"code": 90029
38493849
},

src/services/codefixes/fixAwaitInSyncFunction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace ts.codefix {
1212
const nodes = getNodes(sourceFile, span.start);
1313
if (!nodes) return undefined;
1414
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, nodes));
15-
return [{ description: getLocaleSpecificMessage(Diagnostics.Convert_to_async), changes, fixId }];
15+
return [{ description: getLocaleSpecificMessage(Diagnostics.Add_async_modifier_to_containing_function), changes, fixId }];
1616
},
1717
fixIds: [fixId],
1818
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {

tests/cases/fourslash/codeFixAwaitInSyncFunction1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
////}
66

77
verify.codeFix({
8-
description: "Convert to async",
8+
description: "Add async modifier to containing function",
99
newFileContent:
1010
`async function f() {
1111
await Promise.resolve();

tests/cases/fourslash/codeFixAwaitInSyncFunction10.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
////}
66

77
verify.codeFix({
8-
description: "Convert to async",
8+
description: "Add async modifier to containing function",
99
newFileContent:
1010
`const f: () => Promise<number | string> = async () => {
1111
await Promise.resolve('foo');

tests/cases/fourslash/codeFixAwaitInSyncFunction11.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
// should not change type if it's incorrectly set
88
verify.codeFix({
9-
description: "Convert to async",
9+
description: "Add async modifier to containing function",
1010
newFileContent:
1111
`const f: string = async () => {
1212
await Promise.resolve('foo');

tests/cases/fourslash/codeFixAwaitInSyncFunction12.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
////}
66

77
verify.codeFix({
8-
description: "Convert to async",
8+
description: "Add async modifier to containing function",
99
newFileContent:
1010
`const f: () => Promise<Array<number | string>> = async function() {
1111
await Promise.resolve([]);

tests/cases/fourslash/codeFixAwaitInSyncFunction13.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
////}
66

77
verify.codeFix({
8-
description: "Convert to async",
8+
description: "Add async modifier to containing function",
99
newFileContent:
1010
`const f: () => Promise<number | string> = async () => {
1111
await Promise.resolve('foo');

tests/cases/fourslash/codeFixAwaitInSyncFunction14.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
////}
66

77
verify.codeFix({
8-
description: "Convert to async",
8+
description: "Add async modifier to containing function",
99
newFileContent:
1010
`const f = async function(): Promise<number> {
1111
await Promise.resolve(1);

tests/cases/fourslash/codeFixAwaitInSyncFunction15.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
////}
66

77
verify.codeFix({
8-
description: "Convert to async",
8+
description: "Add async modifier to containing function",
99
newFileContent:
1010
`const f = async (): Promise<number[]> => {
1111
await Promise.resolve([1]);

tests/cases/fourslash/codeFixAwaitInSyncFunction2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
////}
66

77
verify.codeFix({
8-
description: "Convert to async",
8+
description: "Add async modifier to containing function",
99
newFileContent:
1010
`const f = async function() {
1111
await Promise.resolve();

0 commit comments

Comments
 (0)