Skip to content

Commit

Permalink
[gopls-release-branch.0.7] internal/lsp: remove duplicated loop that …
Browse files Browse the repository at this point in the history
…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 <[email protected]>
Run-TryBot: Robert Findley <[email protected]>
gopls-CI: kokoro <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
(cherry picked from commit 45eff0f)
Reviewed-on: https://go-review.googlesource.com/c/tools/+/339096
Run-TryBot: Rebecca Stambler <[email protected]>
  • Loading branch information
stamblerre committed Aug 2, 2021
1 parent c923fbd commit 9b21a88
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions internal/lsp/cache/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -1843,20 +1843,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 {
Expand Down

0 comments on commit 9b21a88

Please sign in to comment.