x/tools/gopls: handle formatting on files that do not parse #31291
If we don't check a package's parse errors before formatting, we may encounter a case where we delete code on format.
To handle this, we check the parse errors before formatting. However, we should confirm that these errors belong to the file in question and lie within the specified range before failing.
@stamblerre @ianthehat - should/can we also use this issue to pick up the conversation from https://go-review.googlesource.com/c/tools/+/171019/2#message-f8bec621217d3d2caad7dda408cdc629c71aaed6:
Or do you want to capture that discussion about error propagation elsewhere?