Add comment explaining special casing
This commit is contained in:
parent
3ad6a66e69
commit
97e539339d
1 changed files with 2 additions and 0 deletions
|
@ -44,6 +44,8 @@ namespace ts.codefix {
|
|||
// get the function declaration - returns a promise
|
||||
const tokenAtPosition = getTokenAtPosition(sourceFile, position);
|
||||
let functionToConvert: FunctionLikeDeclaration;
|
||||
|
||||
// if the parent of a FunctionLikeDeclaration is a variable declaration, the convertToAsync diagnostic will be reported on the variable name
|
||||
if (isIdentifier(tokenAtPosition) && isVariableDeclaration(tokenAtPosition.parent) &&
|
||||
tokenAtPosition.parent.initializer && isFunctionLikeDeclaration(tokenAtPosition.parent.initializer)) {
|
||||
functionToConvert = tokenAtPosition.parent.initializer;
|
||||
|
|
Loading…
Reference in a new issue