89badcc9d5
* Add remove unnecessary await fix * Add test for removing unnecessary parens after await is gone * Fix handling of numbers in property access expressions * Don’t offer suggestion when awaited type is any/unknown * Fix random other test * Fix new expression edge cases * Only remove parens for identifiers and call expressions
30 lines
615 B
TypeScript
30 lines
615 B
TypeScript
/// <reference path='fourslash.ts' />
|
|
|
|
// @allowNonTsExtensions: true
|
|
// @Filename: test123.js
|
|
// @lib: es5
|
|
////export function /**/MyClass() {
|
|
////}
|
|
////MyClass.prototype.foo = async function() {
|
|
//// await Promise.resolve();
|
|
////}
|
|
////MyClass.bar = async function() {
|
|
//// await Promise.resolve();
|
|
////}
|
|
|
|
verify.codeFix({
|
|
description: "Convert function to an ES2015 class",
|
|
newFileContent:
|
|
`export class MyClass {
|
|
constructor() {
|
|
}
|
|
async foo() {
|
|
await Promise.resolve();
|
|
}
|
|
static async bar() {
|
|
await Promise.resolve();
|
|
}
|
|
}
|
|
`,
|
|
});
|