From 497c7f156cadd89c7e3b6a1e5ecc9dafdec9efea Mon Sep 17 00:00:00 2001 From: Rebecca Stambler Date: Tue, 14 Jan 2020 18:25:22 -0500 Subject: [PATCH] internal/lsp/cache: construct package handles as part of IWL Package handles should be cached on the snapshot as part of the initial workspace load, otherwise this cached data will be repeatedly lost and reconstructed during tests and regular execution. Fixes golang/go#36556 Change-Id: If7676685db17519c998b857a812467c7f3cc6003 Reviewed-on: https://go-review.googlesource.com/c/tools/+/214799 Run-TryBot: Rebecca Stambler TryBot-Result: Gobot Gobot Reviewed-by: Heschi Kreinick --- internal/lsp/cache/view.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/lsp/cache/view.go b/internal/lsp/cache/view.go index 765b05defa..7915643976 100644 --- a/internal/lsp/cache/view.go +++ b/internal/lsp/cache/view.go @@ -480,6 +480,9 @@ func (v *view) initialize(ctx context.Context, s *snapshot) { // the non-test variant with -test. Track the import path of the non-test variant. for _, m := range meta { s.setWorkspacePackage(m.id, m.pkgPath) + if _, err := s.packageHandle(ctx, m.id); err != nil { + return err + } } return nil })