Skip to content

Commit 1a2a9e0

Browse files
fix: prevent duplicated code actions
1 parent 46ff0db commit 1a2a9e0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/upgrade/upgradeCodeActionProvider.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ export default class UpgradeCodeActionProvider implements CodeActionProvider {
2828
if (!metadata) {
2929
continue;
3030
}
31-
const action = new CodeAction(
32-
`Fix: Upgrade ${metadata.name}`,
33-
CodeActionKind.QuickFix
34-
);
31+
const actionName = `Fix: Upgrade ${metadata.name}`;
32+
if (actions.findIndex(x => x.title === actionName) !== -1) {
33+
continue;
34+
}
3535

36+
const action = new CodeAction(actionName, CodeActionKind.QuickFix);
3637
action.command = {
3738
title: "Upgrade",
3839
command: Commands.VIEW_TRIGGER_JAVA_UPGRADE_TOOL,

0 commit comments

Comments
 (0)