Closed
Description
We need to think about what the rules for error handling should be in gopls, specifically what kinds of things result in rpc errors vs just logging.
For instance:
- errors in producing diagnostics, which happen without the user requesting them, cannot result in an rpc error but should not be invisible. Should they appear as a diagnostic, or just be logged to the client console?
- errors in formatting, should they fail the rpc or just result in no edits?
- errors in attempting to generate code actions, which happen inside an rpc but without the user asking for them, should they fail the rpc or just log to the client console?
I am currently looking into using xerrors extensively through gopls to both improve the error messages, give us call traces, and also give us the type information to make decisions in the lsp layer about things that happened way down inside the source layer.
Once that is done it will get much easier to think about and experiment with the rules, but we should probably have some kind of overall logic we apply to make these decision.