go/internal
Pontus Leitzler b1c90890d2 internal/lsp/source: do not panic in "var func" outgoing callhierarchy
When trying to get outgoing call hierarchy from an var func like:

func main() {
    foo := func() {}
    foo()
}

gopls crashed with a panic.

This change makes it return an empty call hierarchy instead.
It also adds support for testing outgoing calls where the expected
result is 0 items, to be able to test this change.

Fixes golang/go#43376

Change-Id: Icd91bf54cb4fbd5203f5865f0ff9d81365c27d5d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/279469
Trust: Pontus Leitzler <leitzler@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Pontus Leitzler <leitzler@gmail.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-12-26 21:56:59 +00:00
..
analysisinternal internal/lsp/fuzzy: fix return value on no match 2020-08-28 15:37:48 +00:00
apidiff
event internal/lsp: fix some incorrect spelling 2020-11-24 11:59:21 +00:00
fakenet
fastwalk
gocommand internal/gocommand: improve debug string 2020-11-16 17:23:50 +00:00
gopathwalk internal/imports: fix crash when adding stdlib imports 2020-08-13 17:47:04 +00:00
imports internal/imports: prevent panic in imports GOMODCACHE logic 2020-12-07 18:59:00 +00:00
jsonrpc2 internal/lsp: support go1.12 2020-07-20 15:02:56 +00:00
lsp internal/lsp/source: do not panic in "var func" outgoing callhierarchy 2020-12-26 21:56:59 +00:00
memoize internal/memoize: add a final argument to Bind for cleaning up 2020-10-30 19:59:21 +00:00
packagesinternal all: use explicit -mod, -modfile fields for gocommand.Invocation 2020-10-19 17:57:15 +00:00
proxydir
span internal/typesinternal: use Go 1.16 metadata for go/types errors 2020-12-07 17:42:14 +00:00
stack
testenv
tool
typesinternal internal/typesinternal: use Go 1.16 metadata for go/types errors 2020-12-07 17:42:14 +00:00
xcontext