tools/internal/typesinternal
Rob Findley 6d2eea5430 internal/typesinternal: use Go 1.16 metadata for go/types errors
In Go 1.16 error codes as well as start and end positions are added for
go/types errors. This information is temporarily stored in unexported
fields, until we're more confident in the correctness of both the API
and the underlying data.

Read this information using reflection and, if available, use it to set
the corresponding field in compiler diagnostics. This establishes a
positive feedback loop: in most cases this should improve the gopls
diagnostic, and wherever it doesn't we can make a note and fall back on
the old heuristics for that error code.

For golang/go#42290

Change-Id: I37475189cbd14a0a5bcfde163f599c9a7b957372
Reviewed-on: https://go-review.googlesource.com/c/tools/+/268539
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Trust: Robert Findley <rfindley@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-12-07 17:42:14 +00:00
..
errorcode.go internal/typesinternal: add a copy of the Go 1.16 go/types error codes 2020-11-10 12:42:07 +00:00
errorcode_string.go internal/typesinternal: add a copy of the Go 1.16 go/types error codes 2020-11-10 12:42:07 +00:00
types.go internal/typesinternal: use Go 1.16 metadata for go/types errors 2020-12-07 17:42:14 +00:00