We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ad6a66 commit 97e5393Copy full SHA for 97e5393
src/services/codefixes/convertToAsyncFunction.ts
@@ -44,6 +44,8 @@ namespace ts.codefix {
44
// get the function declaration - returns a promise
45
const tokenAtPosition = getTokenAtPosition(sourceFile, position);
46
let functionToConvert: FunctionLikeDeclaration;
47
+
48
+ // if the parent of a FunctionLikeDeclaration is a variable declaration, the convertToAsync diagnostic will be reported on the variable name
49
if (isIdentifier(tokenAtPosition) && isVariableDeclaration(tokenAtPosition.parent) &&
50
tokenAtPosition.parent.initializer && isFunctionLikeDeclaration(tokenAtPosition.parent.initializer)) {
51
functionToConvert = tokenAtPosition.parent.initializer;
0 commit comments