If no editor is open apply the resolution directly #1961
+11
−7
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.
What it does
Currently if one applies a QuickFix without the java editor open (e.g. from the Problems view), then JDT opens a new editor, applies the quickfix and then leave the user in a dirty state, so the error/warning is still shown in the problems view unless one manually save the editor.
This now changes the behavior by apply the resolution directly on the document and commit (or save) the compilation unit.
How to test
I use this simple test class:
it will produce:
You will end up with the problem resolved and no dirty editor.
Author checklist