diff --git a/internal/lsp/cache/check.go b/internal/lsp/cache/check.go index ef547bf0cbf..8bd21b8d5ae 100644 --- a/internal/lsp/cache/check.go +++ b/internal/lsp/cache/check.go @@ -136,7 +136,11 @@ func (s *snapshot) buildKey(ctx context.Context, id packageID, mode source.Parse // Begin computing the key by getting the depKeys for all dependencies. var depKeys [][]byte for _, depID := range depList { - depHandle, err := s.packageHandle(ctx, depID, source.ParseExported) + mode := source.ParseExported + if s.workspacePackages[depID] { + mode = source.ParseFull + } + depHandle, err := s.packageHandle(ctx, depID, mode) if err != nil { log.Error(ctx, "no dep handle", err, telemetry.Package.Of(depID)) diff --git a/internal/lsp/testdata/implementation/implementation.go b/internal/lsp/testdata/implementation/implementation.go index 2b1070123a1..b4a98cc4929 100644 --- a/internal/lsp/testdata/implementation/implementation.go +++ b/internal/lsp/testdata/implementation/implementation.go @@ -1,6 +1,6 @@ package implementation -import "implementation/other" +import "golang.org/x/tools/internal/lsp/implementation/other" type ImpP struct{} //@ImpP @@ -25,5 +25,9 @@ type Foo struct { } type U interface { - U() //@mark(IntU, "U"),implementations("U", ImpU), + U() //TODO: fix flaky @implementations("U", ImpU) } + +type cryer int + +func (cryer) Cry(other.CryType) {} //@mark(CryImpl, "Cry") diff --git a/internal/lsp/testdata/implementation/other/other.go b/internal/lsp/testdata/implementation/other/other.go index e8410aff873..6fe16d4931a 100644 --- a/internal/lsp/testdata/implementation/other/other.go +++ b/internal/lsp/testdata/implementation/other/other.go @@ -19,3 +19,11 @@ type Foo struct { func (Foo) U() { //@mark(ImpU, "U") } + +type CryType int + +const Sob CryType = 1 + +type Cryer interface { + Cry(CryType) //@implementations("Cry", CryImpl) +}