Skip to content

Commit 0206761

Browse files
committed
internal/lsp: replace mistaken "break" with "continue"
I had meant to continue instead of break this loop. This caused us to invalidate all IDs (except for those for one file) every time a snapshot was cloned. Picked up a staticcheck fix along the way. Change-Id: I8fb3b2bdd6b58ac21130e01cb0d32fa6a57e6b73 Reviewed-on: https://go-review.googlesource.com/c/tools/+/221103 Run-TryBot: Rebecca Stambler <[email protected]> Reviewed-by: Rohan Challa <[email protected]>
1 parent abb57c6 commit 0206761

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/lsp/cache/snapshot.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (s *snapshot) buildOverlay() map[string][]byte {
131131

132132
func (s *snapshot) PackageHandles(ctx context.Context, fh source.FileHandle) ([]source.PackageHandle, error) {
133133
if fh.Identity().Kind != source.Go {
134-
panic(fmt.Sprintf("called PackageHandles on a non-Go FileHandle"))
134+
panic("called PackageHandles on a non-Go FileHandle")
135135
}
136136

137137
ctx = telemetry.File.With(ctx, fh.Identity().URI)
@@ -743,7 +743,7 @@ outer:
743743
for k, ids := range s.ids {
744744
for _, id := range ids {
745745
if invalidateMetadata, ok := transitiveIDs[id]; invalidateMetadata && ok {
746-
break outer
746+
continue outer
747747
}
748748
}
749749
result.ids[k] = ids

0 commit comments

Comments
 (0)