-
Notifications
You must be signed in to change notification settings - Fork 763
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
Prettier error display, like pretty-typescript-error extension #3644
Comments
In what context are you seeing this error? Is it a diagnostic (squiggly red line) in the editor or something else? IIRC diagnostics are provided by the language server, gopls. Rich diagnostic messages would probably be most easily provided by gopls because (I think) it has access to the underlying error before it's stringified. But I'm not familiar with the details of the language server protocol and I don't know if it's possible for gopls to provide rich messages through the standard protocol, though I'd guess it is. |
Hi, The errors are coming from the squigly red line of the editor yes, Showing up in the problem tab of vscode, i'm assuming it's coming from the LSP when it detects compiler error. I'm assuming gopls would be able to do some sort of check if it's running in an editor that's capable of ouputting rich diagnostic messages and then returning that, and returning the standard error message if it's not running in an editor capable of it? |
Upstream issue: microsoft/vscode#54272 The pretty ts error extension seems to implement a hover message provider that digests diagnostics messages and formats it. https://github.com/yoavbls/pretty-ts-errors/blob/main/src/extension.ts Btw, if the error message came from the compiler, I don't know how perfectly gopls can reformat compiler's message. |
I just meant that it would be less difficult to implement with gopls vs with the extension since gopls will at least have some |
Is your feature request related to a problem? Please describe.
Error messages on complex types and functions can be messy and tricky to read and understand
For example
Describe the solution you'd like
It'll be nice if we can have error display like in the popular vscode extension, Pretty Typescript Error
https://marketplace.visualstudio.com/items?itemName=yoavbls.pretty-ts-errors
So instead of the error above
We can instead display
cannot use
(value of type
func(b *"clockey/bot".Bot) handler.MessageCommandHandler)
ashandler.MessageCommandHandler
value in argument toh.MessageCommand
Something to this effect
The text was updated successfully, but these errors were encountered: