mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fixed "Delete all unused declarations" to delete self-referential functions (#60888)
This commit is contained in:
@@ -200,6 +200,9 @@ registerCodeFix({
|
||||
else if (canDeleteEntireVariableStatement(sourceFile, token)) {
|
||||
deleteEntireVariableStatement(changes, sourceFile, token.parent as VariableDeclarationList);
|
||||
}
|
||||
else if (isIdentifier(token) && isFunctionDeclaration(token.parent)) {
|
||||
deleteFunctionLikeDeclaration(changes, sourceFile, token.parent as FunctionLikeDeclaration);
|
||||
}
|
||||
else {
|
||||
tryDeleteDeclaration(sourceFile, token, changes, checker, sourceFiles, program, cancellationToken, /*isFixAll*/ true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user