Implement confirmation for non-fatal "Move Instance Method" problems before applying edits - #4482
Open
shin19991207 wants to merge 1 commit into
Open
Implement confirmation for non-fatal "Move Instance Method" problems before applying edits#4482shin19991207 wants to merge 1 commit into
shin19991207 wants to merge 1 commit into
Conversation
…g edits Signed-off-by: Morgan Chang <shin19991207@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.This PR provides the same choice in VS Code:
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: