go/internal/lsp/testdata/callhierarchy
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
..
incoming internal/lsp: remove multi-module support in tests 2020-09-22 16:28:30 +00:00
outgoing internal/lsp: remove multi-module support in tests 2020-09-22 16:28:30 +00:00
callhierarchy.go internal/lsp/source: do not panic in "var func" outgoing callhierarchy 2020-12-26 21:56:59 +00:00