Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Wingman produce user-facing error messages #1502

Merged
merged 6 commits into from Mar 7, 2021

Conversation

isovector
Copy link
Collaborator

@isovector isovector commented Mar 5, 2021

Wingman now sends WindowShowMessage notifications in the case of errors, significantly clearing up the confusion around "why didn't that code action do anything?"

@michaelpj
Copy link
Collaborator

I think there's the ability for most requests to return an error with a code and message in case something went wrong during the request (e.g. see at the bottom of the executeCommand docs: https://microsoft.github.io/language-server-protocol/specification#workspace_executeCommand).

It seems like this would be a better way to signal failure? And I think it lets you give a message too. Not sure how to do this in our library, though.

@isovector
Copy link
Collaborator Author

isovector commented Mar 6, 2021

result: any | null

what a type smh.

However, I'm currently returning the error as the response to the codeaction:

but it doesn't show any messages in either vscode or vim/coc.

Maybe some LSP wizard could chime in here? @bubba do you know the right way to indicate errors to users?

@isovector
Copy link
Collaborator Author

isovector commented Mar 6, 2021

@wz1000 chimes in from IRC:

│07:16:39    isovector | are there any LSP wizards? what's the right way to report a failing code action to the user?
│07:17:26       wz1000 | do you want the user to actually see the error?
│07:17:30    isovector | yes
│07:17:44       wz1000 | then 'showMessage'

which suggests I'm on the right track with this PR

@isovector isovector added the merge me Label to trigger pull request merge label Mar 6, 2021
@michaelpj
Copy link
Collaborator

Boo, that seems like a missed opportunity on the client side.

@michaelpj
Copy link
Collaborator

Y do people not think about the non-happy path??

@mergify mergify bot merged commit 848067b into haskell:master Mar 7, 2021
@isovector isovector deleted the error-reports branch April 5, 2021 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants