Skip to content

Implement confirmation for non-fatal "Move Instance Method" problems before applying edits - #4482

Open
shin19991207 wants to merge 1 commit into
redhat-developer:mainfrom
shin19991207:fix-4460
Open

Implement confirmation for non-fatal "Move Instance Method" problems before applying edits#4482
shin19991207 wants to merge 1 commit into
redhat-developer:mainfrom
shin19991207:fix-4460

Conversation

@shin19991207

Copy link
Copy Markdown
Member

Fixes #4460

Depends on and was tested with eclipse-jdtls/eclipse.jdt.ls#3862

This PR adds a confirmation dialog for non-fatal "Move Instance Method" refactoring problems reported by JDT LS.

In Eclipse IDE, ERROR-level refactoring problems are displayed in the Found problems dialog. The user can review the problems and choose whether to continue or cancel the refactoring.

Eclipse IDE Found problems dialog

This PR provides the same choice in VS Code:

VS Code refactoring confirmation dialog

When JDT LS reports non-fatal problems, VS Code displays all found problems and asks the user whether to continue. No edit is applied if the dialog is cancelled. If the user selects Continue, the move request is repeated with the confirmation token returned by JDT LS.

The confirmation token prevents the user from confirming a refactoring after its source or conditions have changed. To test this behavior: Select Refactor... > Move... > Wait for the problem dialog to appear > Modify and save the source file in another editor > Select Continue in the dialog > The stale confirmation is rejected:

VS Code stale refactoring confirmation error

…g edits

Signed-off-by: Morgan Chang <shin19991207@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move Instance Method changes field null-check semantics and introduces NullPointerException

1 participant