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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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();

tests/cases/fourslash/codeFixAwaitInSyncFunction5.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
////}
88

99
verify.codeFix({
10-
description: "Convert to async",
10+
description: "Add async modifier to containing function",
1111
newFileContent:
1212
`class Foo {
1313
async bar() {

tests/cases/fourslash/codeFixAwaitInSyncFunction6.5.ts

+1-1
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 => {
1111
await promise;

tests/cases/fourslash/codeFixAwaitInSyncFunction6.ts

+1-1
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) => {
1111
await promise;

tests/cases/fourslash/codeFixAwaitInSyncFunction7.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
////}
88

99
verify.codeFix({
10-
description: "Convert to async",
10+
description: "Add async modifier to containing function",
1111
newFileContent:
1212
`async function f() {
1313
for await (const x of g()) {

tests/cases/fourslash/codeFixAwaitInSyncFunction8.ts

+1-1
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(): Promise<number | string> {
1111
await Promise.resolve(8);

tests/cases/fourslash/codeFixAwaitInSyncFunction9.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
////}
88

99
verify.codeFix({
10-
description: "Convert to async",
10+
description: "Add async modifier to containing function",
1111
newFileContent:
1212
`class Foo {
1313
async bar(): Promise<string> {

0 commit comments

Comments
 (0)