From 45eff0fdb0da1630f095ee1fa953c9e57d8664eb Mon Sep 17 00:00:00 2001 From: Rebecca Stambler Date: Mon, 2 Aug 2021 11:37:50 -0400 Subject: [PATCH] internal/lsp: remove duplicated loop that copies IDs This logic was duplicated as part of the invalid metadata CL. I believe the loop on L1873 is the intended behavior. Change-Id: I93ceb3da4045f0536be7dc9da7cecc4323e14a92 Reviewed-on: https://go-review.googlesource.com/c/tools/+/339112 Trust: Rebecca Stambler Run-TryBot: Robert Findley gopls-CI: kokoro TryBot-Result: Go Bot Reviewed-by: Robert Findley --- internal/lsp/cache/snapshot.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/internal/lsp/cache/snapshot.go b/internal/lsp/cache/snapshot.go index a763f97630..4f1bf19819 100644 --- a/internal/lsp/cache/snapshot.go +++ b/internal/lsp/cache/snapshot.go @@ -1902,20 +1902,6 @@ func (s *snapshot) clone(ctx, bgCtx context.Context, changes map[span.URI]*fileC shouldLoad: v.shouldLoad || invalidateMetadata, } } - // Copy the URI to package ID mappings, skipping only those URIs whose - // metadata will be reloaded in future calls to load. - for k, ids := range s.ids { - var newIDs []packageID - for _, id := range ids { - if invalidateMetadata, ok := idsToInvalidate[id]; invalidateMetadata && ok { - continue - } - newIDs = append(newIDs, id) - } - if len(newIDs) != 0 { - result.ids[k] = newIDs - } - } // Copy the set of initially loaded packages. for id, pkgPath := range s.workspacePackages {