x/tools/gopls: use RelatedInformation for diagnostics on interface implementation errors #39062
See the example in https://play.golang.org/p/2TrSYmBsdLU.
In this case, both the compiler and go/types report error messages on L17 where the error occurs. However, in cases like these, the user is most likely interested in fixing their mistake on L9 by changing the return type of
The text was updated successfully, but these errors were encountered:
The type checker sometimes emits secondary diagnostics. For instance, if a function is defined twice, then when it sees the second definition it emits a diagnostic at the second definition and a secondary diagnostic pointing to the first diagnostic. Presently gopls treats these as two separate diagnostics. The changed code still produces two diagnostics, but now the secondary diagnostic is also converted into a RelatedInformation so the user sees a xpointer to the earlier definition. Updates golang/go#39062. Change-Id: Ic421ec91d2b46c28681ab3ec010d5b02c0442e68 Reviewed-on: https://go-review.googlesource.com/c/tools/+/251617 Run-TryBot: Peter Weinberger <firstname.lastname@example.org> TryBot-Result: Gobot Gobot <email@example.com> Reviewed-by: Rebecca Stambler <firstname.lastname@example.org>