fix(50048): remove token name from id (#50051)

This commit is contained in:
Oleksandr T
2022-07-26 11:13:04 +03:00
committed by GitHub
parent b5b02eefc8
commit bcd22b47d2
2 changed files with 41 additions and 3 deletions

View File

@@ -26,14 +26,13 @@ namespace ts.codefix {
fixIds: [fixId],
getAllCodeActions: context => {
const { program, preferences, host } = context;
const seen = new Map<string, true>();
const seen = new Map<number, true>();
return createCombinedCodeActions(textChanges.ChangeTracker.with(context, changes => {
eachDiagnostic(context, errorCodes, diag => {
const info = getInfo(program, diag.file, createTextSpan(diag.start, diag.length));
if (info) {
const id = getNodeId(info.declaration) + "#" + info.token.getText();
if (addToSeen(seen, id)) {
if (addToSeen(seen, getNodeId(info.declaration))) {
return addMissingConstraint(changes, program, preferences, host, diag.file, info);
}
}