x/tools/gopls: define which LSP features return errors #35694
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Previously we have discussed what
Formatting
/CodeAction
should do in the presence of parse errors.Currently,
Formatting
/CodeAction
return an error if the code in question does not parse. However, clients have no way of distinguishing a parse error from a "real" error (i.e. anything else that would point to a more significant problem)Therefore clients like
govim
end up simply ignoring return errors, reason being:This approach of ignoring all errors has the unfortunate side effect of "real" errors getting missed. In
govim
we have had ~2/3 instances of non-parse errors getting missed in this way and real bugs slipping through the net.We have at least two options as previously discussed:
Formatting
/CodeAction
and instead rely on diagnostics which already tell the user about thisThoughts?
cc @stamblerre
The text was updated successfully, but these errors were encountered: