Skip to content

Handle confirmation responses for all "move" refactoring actions - #4563

Open
shin19991207 wants to merge 1 commit into
redhat-developer:mainfrom
shin19991207:support-move-confirmation
Open

shin19991207 wants to merge 1 commit into
redhat-developer:mainfrom
shin19991207:support-move-confirmation

Conversation

@shin19991207

Copy link
Copy Markdown
Member

Currently, only "move instance method" refactoring uses requestMoveWithConfirmation(). Other "move" refactoring actions send requests directly and pass their responses to applyRefactorEdit(), which displays messages as notifications instead of offering the Continue/Cancel confirmation dialog.

This PR routes all supported "move" refactoring actions through the existing confirmation helper.

Tested with eclipse-jdtls/eclipse.jdt.ls#3953

@datho7561

Copy link
Copy Markdown
Contributor

I'm trying this out with the given test case and VS Code freezes then crashes.

@shin19991207

Copy link
Copy Markdown
Member Author

@datho7561 Hmmm .... Not sure if it is related to microsoft/vscode#321312. Does configuring "window.dialogStyle": "custom" help solve the issue?

@datho7561

Copy link
Copy Markdown
Contributor

That helped, but I think I see the root cause of the problem now:

image

@shin19991207

Copy link
Copy Markdown
Member Author

I can reproduce the repeated warnings using the original test files plus this additional file:

src/test1/Noise.java

package test1;

// Missing is intentionally undefined
class Noise {
    int use(Missing receiver) {
        return receiver.value() + receiver.value() + receiver.value() + receiver.value()
                + receiver.value() + receiver.value() + receiver.value() + receiver.value()
                + receiver.value() + receiver.value() + receiver.value() + receiver.value()
                + receiver.value() + receiver.value() + receiver.value() + receiver.value()
                + receiver.value() + receiver.value() + receiver.value() + receiver.value()
                + receiver.value() + receiver.value() + receiver.value() + receiver.value()
                + receiver.value() + receiver.value() + receiver.value() + receiver.value()
                + receiver.value() + receiver.value() + receiver.value() + receiver.value()
                + receiver.value() + receiver.value() + receiver.value() + receiver.value()
                + receiver.value() + receiver.value() + receiver.value() + receiver.value();
    }
}

However, this doesn't seem specific to VS Code or this patch (?) I also get repeated warnings when performing the same refactoring in Eclipse IDE with upstream JDT.
Screenshot 2026-10-28 at 9 47 02 PM
Do you see the same repeated messages when testing your project in Eclipse? (Not sure if my reproduction matches your case exactly because yours look endless)

I added .distinct() so repeated messages appear only once and this makes the VSCode dialog shorter. Does it resolve the issue on your setup?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants