Repository navigation
Error reporting for failed quick fix - #685
Merged
mickaelistria merged 1 commit intoJun 6, 2023
Merged
Conversation
rubenporras
requested changes
Jun 6, 2023
| String errorMessage = "Failed to fetch quick fix edit for '" + codeAction.getTitle() //$NON-NLS-1$ | ||
| + "'. See Language Server '" + serverId + "' log for more details."; //$NON-NLS-1$ //$NON-NLS-2$ | ||
| Display display = PlatformUI.getWorkbench().getDisplay(); | ||
| display.asyncExec(() -> MessageDialog.openError(display.getActiveShell(), errorTitle, errorMessage)); |
Contributor
There was a problem hiding this comment.
I think we should rather use ServerMessageHandler.showMessage, as in other places in the codebase. Could you do that?
Comment on lines
+104
to
+105
| Display display = PlatformUI.getWorkbench().getDisplay(); | ||
| display.asyncExec(() -> MessageDialog.openError(display.getActiveShell(), errorTitle, errorMessage)); |
Contributor
There was a problem hiding this comment.
If you want to have fun with newer constructs:
.execute(ls -> ls.getWorkspaceService()
.executeCommand(...)
.exceptionally(this::constructErrorMessages()) // could be a Pair<String, String> or an Entry<String, String>
.thenAcceptAsync(messages -> MessageDialog.openError(Display.getCurrent(), messages.getKey(), messages.getValue()), PlatformUI.getWorkbench().getDisplay())); // Display is now an Executor that can be used to "host" future chains
BoykoAlex
force-pushed
the
quick-fix-error-dialog
branch
from
June 6, 2023 17:36
4b17d93 to
6e2369b
Compare
Contributor
Author
|
@rubenporras @mickaelistria I have update the PR to address your comment. Thanks for the review :-) (Couldn't quite get the nice syntax for the future but something that is hopefully close enough) |
Contributor
|
Thanks! |
Contributor
|
thanks |
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.
Show error dialog if quick fix failed on the server side.