Commit Graph

7 Commits

Author SHA1 Message Date
Suzy Mueller 43f084e593 internal/typesinternal: update typesinternal for 1.18
This CL adds the error codes introduced in
1.17 and 1.18.

Change-Id: I5646a2cdfe2b1a86756f3e9beb8b9c781d7cbccf
Reviewed-on: https://go-review.googlesource.com/c/tools/+/386874
Trust: Suzy Mueller <suzmue@golang.org>
Run-TryBot: Suzy Mueller <suzmue@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-02-22 16:42:18 +00:00
Heschi Kreinick 164402db9d internal/lsp/cache: set types.Config.GoVersion
Set the language version from the controlling go.mod file's go version,
if any. Also verify that we properly surface a diagnostic if the version
is invalid.

I didn't add any quick fixes.

Fixes golang/go#50688.

Change-Id: Ic472502d1224a1decb5b989d51110b837020e998
Reviewed-on: https://go-review.googlesource.com/c/tools/+/383394
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-07 18:19:30 +00:00
Robert Findley fe076c893b internal/typesinternal: document ReadGo116ErrorData
Change-Id: I5afe3e4d3f137758da404e779d6bc9b0a57b6a02
Reviewed-on: https://go-review.googlesource.com/c/tools/+/351089
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2021-09-21 03:32:29 +00:00
Rob Findley 5848b84f5d internal/typesinternal: sync error codes with go1.16
Before go1.16 was cut, I made one breaking change to the error codes,
inserting a new code value in the middle of the enumeration. Sync to
pick up this change. In the future, such breaking changes won't be made.

Change-Id: I1ee0d78a11971013b38a370207e1d472065a02d5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/292669
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-02-16 20:01:04 +00:00
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
Rob Findley 079ba7bd75 internal/typesinternal: add a copy of the Go 1.16 go/types error codes
This CL adds a copy of the internal error codes added to go/types in
https://golang.org/cl/264179. In a subsequent CL, we will use these to
extract the unexported error code from go/types errors via reflection.

A generated String method is added to provide a human-readable code for
the user.

For golang/go#42290

Change-Id: I280c9b111598426dce4eef38b9979919ed590068
Reviewed-on: https://go-review.googlesource.com/c/tools/+/267939
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-11-10 12:42:07 +00:00
Matthew Dempsky 51e3d70dba go/packages: use go115UsesCgo instead of UsesCgo
x/tools half of golang.org/cl/237417.

Updates #16623.
Updates #39072.

Change-Id: Ic31c2cf64dc1b71b70912b9641cf468f60d116f8
Reviewed-on: https://go-review.googlesource.com/c/tools/+/237418
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-06-10 21:22:23 +00:00