This PR updates the link of nvim-lspconfig doc for gopls.
Change-Id: I9f64ca9c310af8a6c6392245c88eea666edf4657
GitHub-Last-Rev: 9774e504c77d7b0d00f932dd5af85563498a21b2
GitHub-Pull-Request: golang/tools#351
Reviewed-on: https://go-review.googlesource.com/c/tools/+/367254
Reviewed-by: Robert Findley <rfindley@google.com>
Trust: Robert Findley <rfindley@google.com>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Now that any is an alias for interface{}, we need to recognize both
func (T) As(any) bool
func (T) As(interface{}) bool
as satisfying errors.As.
For golang/go#33232.
Change-Id: Ie5a992c37da8020e80367528bc23370227a70f75
Reviewed-on: https://go-review.googlesource.com/c/tools/+/369954
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Templates were reporting 'oops' when hovering over a string.
Fixes: golang/go#50031
Change-Id: I9e256b1f7d193bf090590c1ec71e85fc8493d7f7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/369956
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Peter Weinberger <pjw@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
In Go 1.18 context uses any, not interface{}.
Fix the test in a way that should work for both older and newer versions.
For golang/go#49884.
Change-Id: Ib8690876c6a9364b98f9c7ba739b953a8d7565d4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/369955
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
The error messages produced by go/types related to an incorrect number
of return values have changed, and have been repositioned. Update the
fillreturns analyzer to handle the Go 1.18 form of these errors.
Ideally we'd use error codes here, but can't because they are not
forwarded by go/packages. Added a TODO to revisit when error codes are
exposed.
Change-Id: I4c594fd2fd1cb7423f37ff9c6a57e9490dcbc2a4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/367714
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
The Acquire method is nearly instantaneous; it only potentially blocks
on a small, constant sequence of cache misses, so there is no need to
avoid blocking in it when a Context is cancelled.
An early return when the passed-in Context is canceled was added in CL
242838 to avoid incrementing the Generation's WaitGroup after its
destruction has begun; however, that early return also bypasses the
WaitGroup accounting that blocks Destroy while the generation is still
in use. Instead, we need the invariant that Acquire is not called in
the first place after Destroy, which we can ensure by nilling out
the View's snapshot when we begin destroying it.
I was not able to reproduce golang/go#48774 locally, but I believe
that this CL will fix it. (It may, however, expose other races or
deadlocks that may have been masked by the early return, which we can
then fix separately.)
Fixesgolang/go#48774
Change-Id: Iac36fceb06485f849da5ba0250b44b55f937c44b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/367675
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Add support to the typeutil package for hashing the new types produced
when type-checking generic code.
Change-Id: I05a213baee80c53c673442f3c28fddb26ad0b03f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/366614
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: Tim King <taking@google.com>
type decls
This is a port of CL 367851 to x/tools. The test set-up is slightly
different; I added a TODO to converge.
Updates golang/go#49888
Change-Id: I31a63c1fc8f9a78526d8eea05fd01dae35770b5f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/368354
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: Robert Griesemer <gri@golang.org>
There's one case when doing something about newlines in comments is
necessary, but the existing code removed newlines from comments in
several other places. The new code fixes that and a few other
leftovers.
Change-Id: Ia7905f07584ea1774f4fde786bdd5ee732acc818
Reviewed-on: https://go-review.googlesource.com/c/tools/+/368214
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Trust: Peter Weinberger <pjw@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
There are no changes, other than generated code, to gopls. The vscode
typescript implementation includes 3 new and undocumented RPCs:
InlineValues, InlineValuesRefresh, and ResolveWorkspaceSymbol.
There are some places that need work, marked by //PJW: comments in
code.ts.
Change-Id: I20e4c6792ae37323bb9c887ffefbe81930ef62fe
Reviewed-on: https://go-review.googlesource.com/c/tools/+/367845
Trust: Peter Weinberger <pjw@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
This test was written for GOPATH mode, and subsequently updated to use
packagestest at a time when GO111MODULE defaulted to "auto" (in this
case, off). As a result, the test was failing to set environment
variables relevant to the test, such as GO111MODULE=off.
The missing environment was causing errors that were subsequently
masked by a missing error check: the errors returned by
importgraph.Build were only read in an "if false" block.
This CL adds the missing environment variables and error checks. Using
the correct environment may or may not fix the observed test failures.
For golang/go#37823
Change-Id: I75844e6fdf47222aa4f953c8c4fbcc93cec606c9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/367846
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
The hypothesis for golang/go#48774 is that the generation is being destroyed by
a call to (*View).shutdown. This change adds a bit of logging to
confirm that hypothesis.
For golang/go#48774
Change-Id: I34be2e16a0dcab4cea7e9b704b56f4cf0abb0c71
Reviewed-on: https://go-review.googlesource.com/c/tools/+/367674
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Skip tests so we can get CL 367196 submitted. After that
reenable tests (and adjust as needed).
Change-Id: Id0a6d6b873a0760ae438f6f0cb147c20d00b1ca6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/367574
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
When LSP asks for a completion it sends a position, which is the
position of the first character after the cursor. The old code
mistakenly thought it was the position of the last character seen,
and sometimes produced an impossible slice to parse.
The example at line 29 of completion_test.go used to cause a panic.
Fixes: golang/go#49600
Change-Id: I772fe38a1a12d3876ef866819e6a878b297bb92f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/366036
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Peter Weinberger <pjw@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The comment is already inside a /* */ block, so no need for //.
Updates golang/go#49212.
Change-Id: I6d50cedab363ed312d85e66797cbc4f652e56dab
Reviewed-on: https://go-review.googlesource.com/c/tools/+/367014
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Adds 'templateExtensions' (with default ["tmpl", "gotmpl"]) to control
which files gopls considers template files.
Adds template support documentation to features.md.
Fixesgolang/go#36911
Change-Id: If0920912bf3748d1c231b3b29e7a008da186bede
Reviewed-on: https://go-review.googlesource.com/c/tools/+/363360
Run-TryBot: Peter Weinberger <pjw@google.com>
Trust: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
workspaces
Go versions are not valid semver, so we were always resolving Go 1.12 in
the workspace module. This matters with lazy module loading.
Fixesgolang/go#49668
Updates golang/go#49105Fixesgolang/go#48364
Change-Id: Iae4f5f6e17df4be1f4d6ee9d3f439efa3cf658d3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/365737
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: Heschi Kreinick <heschi@google.com>
interfaces
Now that the underlying of type parameters is their constraint
interface, a couple places in the printf analyzer need to be updated:
- We need to explicitly exclude type parameters when looking at
interfaces in isFormatter.
- We need to consider at the element type, not its underlying, when
looking at pointers to type parameters
Change-Id: I8c6843e001a98d45ff0f30df305e3536335f567e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/364678
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: Robert Griesemer <gri@golang.org>
This test is probably detecting a real bug that exclusively affects
Windows. To avoid masking other bugs, let's skip the test on that
platform until the bug is fixed.
For golang/go#49646
Change-Id: I38c615d47454ecfd72b416fff2018973b3ae9259
Reviewed-on: https://go-review.googlesource.com/c/tools/+/364676
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Guard against the panic in golang/go#49397, though it should not be
possible with well-formed AST.
Updates golang/go#49397
Change-Id: I3428504a4cfd361c1f51316d8c9aeee4aa9d7f42
Reviewed-on: https://go-review.googlesource.com/c/tools/+/364675
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Make a couple of small changes to support keeping track of the
predeclared any by pointer identity, and formatting it as 'any'. This
should allow x/tools trybots to pass on CL 363974.
Updates golang/go#49583
Change-Id: I79cffee6adbf000a7251dbea4091fdd7b8fdcf0a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/364194
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: Robert Griesemer <gri@golang.org>
A call to Underlying() was missing from the computation of a type
parameter's structural terms, resulting in incorrect results for type
parameters with defined constraints. This wasn't caught because all
analyzer tests use inlined interfaces out of convenience, and the
fallback behavior for vet analyzers using this API is to fail silently.
Fix this, and add tests that would have failed. Also update the
normalization tests to use the StructuralTerms API, and delete the
earlier NormalizeInterface API. StructuralTerms has proven to be more
useful.
For clarity, change the StructuralTerms function to accept a *TypeParam
rather than arbitrary Type, and significantly revamp its docstring.
Updates golang/go#49597
Change-Id: I8b863604655b44b943e6afbd5d22a66f44260d10
Reviewed-on: https://go-review.googlesource.com/c/tools/+/363982
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: Tim King <taking@google.com>
Unlike with some other analyzers, it did not seem worthwhile to consider
a type parameter's type set when looking for incorrect conversions to
unsafe.Pointer. There's probably no reason to have a type parameter with
uintptr structural type.
Add some sanity-check tests for the behavior of this analyzer with
respect to generic code.
Updates golang/go#48704
Change-Id: Ibc3180c6eba9c2c88ea2220b1c84cd27971a6700
Reviewed-on: https://go-review.googlesource.com/c/tools/+/360174
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: Matthew Dempsky <mdempsky@google.com>
This test has a high failure rate on the builders. Adding a skip until
it is fixed so that we will more easily notice other regressions.
For golang/go#44098
Change-Id: I8dcd6b205a5a7876d2a16c54f3c19c1bb0397843
Reviewed-on: https://go-review.googlesource.com/c/tools/+/363614
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Some slow builders need more time to get ready.
Updates golang/go#49503
Change-Id: I9225ef43b1fdeb5195467331c7b779fb11dd0e7e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/362976
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Move template processing out of experimental and enable it. Users
can set the option 'templateSupport' to false to disable it.
Also, add a new flag 'templateExtensions', defaulting to ['tmpl','gotmpl']
to let the user provide a list of extensions of files
to be considered as template files.
Change-Id: I724387738c1632256999cda304d6cf9fa48ed91d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/362241
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Peter Weinberger <pjw@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
When context.Only is passed in the codeAction request, all code actions
that have a matching prefix should be returned. For example:
context.Only: "refactor"
want: "refactor.extract", "refactor.rewrite"
Fixesgolang/go#49263
Change-Id: I4bcea4a0b0097f3187f3d7055cbb73b518008107
Reviewed-on: https://go-review.googlesource.com/c/tools/+/361834
Trust: Suzy Mueller <suzmue@golang.org>
Run-TryBot: Suzy Mueller <suzmue@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Skip the obj importer test when running on AIX. For this test to
work properly on AIX, we need to port CL 152720 (or something like
it) here from the main repo.
Updtes golang/go/#49445.
Updates golang/go#29113.
Change-Id: If75a452950a5dcad4afa18d973f3c94b6065f724
Reviewed-on: https://go-review.googlesource.com/c/tools/+/362434
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Skip the installation test when running on AIX. For this test to
work properly on AIX, we need to port CL 152720 (or something like
it) here from the main repo.
Fixes golang/go/#49445.
Updates golang/go#29113.
Change-Id: Idf1f9d717aa835b80cffa4e3ab34ae578a809860
Reviewed-on: https://go-review.googlesource.com/c/tools/+/362248
gopls-CI: kokoro <noreply+kokoro@google.com>
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Change the TestInstallationImporter testpoint to query type
information for sort.Search instead of sort.Ints. The latter function
changed recently (1.16 timeframe), parameter "a" is now "x". A better
candidate for this sort of query is sort.Search, which has been stable
or a while.
This is a copy of CL 294290 from the main repo.
Updates golang/go#44425.
Change-Id: Ibc79602cafc46c20be4b085f9a92977b06f9d658
Reviewed-on: https://go-review.googlesource.com/c/tools/+/362247
Trust: Than McIntosh <thanm@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Use t.TempDir() instead of os.MkdirTemp().
This is a copy of CL 309356 from the main repo.
Updates golang/go#45402.
Change-Id: Ia555a701e4de568871a765ee551e65a5c998cde9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/362246
Trust: Than McIntosh <thanm@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Avoid problems with distro scanning by not using files that look like
object files.
This is a copy of CL 352450 from the main repo.
Updates golang/go#48548.
Change-Id: I519d0aa73fa46470d1a41ce29a1da046a9f57f3b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/362245
Trust: Than McIntosh <thanm@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
In a couple of places the documentation had the wrong names for
examples.
Change-Id: If321643d2bc22e2d1bd27203f0e8dbf3ef66beba
Reviewed-on: https://go-review.googlesource.com/c/tools/+/362154
Trust: Peter Weinberger <pjw@google.com>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
Also eliminate a goroutine leak in case of connection timeout.
Change-Id: I82c1a8352658353ef5d0ba4e7ce9e617ce7b42a3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/236750
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
Add test cases to verify that generic functions and methods are detected
as printf wrappers.
Change-Id: I110a415673976d01b5baae6e2a82d296c2f7d2bf
Reviewed-on: https://go-review.googlesource.com/c/tools/+/360155
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: Tim King <taking@google.com>
parameter’s type set
Pending the acceptance of golang/go#49038, this CL updates the printf
analyzer to warn if any elements of a type parameter's type set do not
match the printf verb being considered. Since this may be a source of
confusion, it also refactors slightly to allow providing a reason why a
match failed.
Updates golang/go#48704
Updates golang/go#49038
Change-Id: I92d4d58dd0e9218ae9d522bf2a2999f4c6f9fd84
Reviewed-on: https://go-review.googlesource.com/c/tools/+/351832
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Tim King <taking@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Updates importMap() to consider generics.
For golang/go#48704
Change-Id: Ic5dafc644c4e81a64df338a165ee8e20627c6113
Reviewed-on: https://go-review.googlesource.com/c/tools/+/360295
Run-TryBot: Tim King <taking@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Trust: Tim King <taking@google.com>
We should not infinitely expand type parameters looking for a lock path.
Fixesgolang/go#49384
Change-Id: I8e1c952d468908aeb16751dddd6c05bb07f3c95c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/361456
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: Tim King <taking@google.com>
typeutil.StaticCallee now supports generic functions, so that can be
used instead of ctrlflow computing static callee for generics on its own.
Change-Id: I38aaf2d91bf1b7f4d0bf5ba6a6684271c1569464
Reviewed-on: https://go-review.googlesource.com/c/tools/+/361406
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
The zero value of token.Pos is special: it determines IsValid(), which
has semantic significance in many places.
offsetPositions, which adjusts positions after AST mangling, was
adjusting all positions -- including invalid positions. As a result it
was making invalid positions valid, leaving a nonsensical AST.
Fix it to skip invalid positions.
Change-Id: I844f243f9a4a3f98ace32fe30e934410d11142dd
Reviewed-on: https://go-review.googlesource.com/c/tools/+/361614
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: Suzy Mueller <suzmue@golang.org>