1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:54:42 -07:00
go/internal/lsp/testdata
Muir Manders cbc0cc175f internal/lsp/source: fix completion crash in append()
We were crashing in cases like:

    var _ []byte = append([]byte{}, ""...<>)

We were type asserting the type of append's second param
to *types.Slice, but in this case it is a string (*types.Basic). Fix
by checking the type assert was successful.

Note that we still don't attempt to give string completions when
appending to a byte slice. We can add that special case later once
everyone is clamoring for it.

Change-Id: I1d2fbd7f538e580d33c2dab4ef127a88e16d7ced
Reviewed-on: https://go-review.googlesource.com/c/tools/+/219144
Run-TryBot: Muir Manders <muir@mnd.rs>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-02-13 02:33:03 +00:00
..
indirect internal/lsp: add quickfixes for missing dependencies in go.mod 2020-02-07 00:16:14 +00:00
lsp internal/lsp/source: fix completion crash in append() 2020-02-13 02:33:03 +00:00
missingdep internal/lsp: add quickfixes for missing dependencies in go.mod 2020-02-07 00:16:14 +00:00
missingtwodep internal/lsp: add quickfixes for missing dependencies in go.mod 2020-02-07 00:16:14 +00:00
unused internal/lsp: add quickfixes for missing dependencies in go.mod 2020-02-07 00:16:14 +00:00