[tools] gopls/internal/cache: avoid unnecessary mod tidy invalidation

0 views
Skip to first unread message

Alan Donovan (Gerrit)

unread,
Dec 16, 2025, 1:42:51 PM (14 hours ago) Dec 16
to Pontus Leitzler, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Michael Knyszek, Robert Findley, Go LUCI, golang-co...@googlegroups.com

Alan Donovan submitted the change

Change information

Commit message:
gopls/internal/cache: avoid unnecessary mod tidy invalidation

When a file is closed (didClose) we get a transition from overlay
to disk which gopls always assumed was a "save" event that
invalidated mod tidy handle. That in hand triggered an unnecessary
"go mod tidy" invocation.

Browsing files in VSCode for example could cause a lot of didClose
event on unchanged files, and if the module is large each
invocation takes a while.

With this change we now check if the Identity changed when
determine if a file was saved, from the perspective of go mod tidy.
If the Identity hasn't changed, the content hasn't changed.
Change-Id: Ied0a89b4cb51a8cfec5c3ee04308944a30b36fa1
Reviewed-by: Michael Knyszek <mkny...@google.com>
Reviewed-by: Alan Donovan <adon...@google.com>
Files:
  • M gopls/internal/cache/snapshot.go
Change size: S
Delta: 1 file changed, 10 insertions(+), 0 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Michael Knyszek, +2 by Alan Donovan
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: Ied0a89b4cb51a8cfec5c3ee04308944a30b36fa1
Gerrit-Change-Number: 730220
Gerrit-PatchSet: 2
Gerrit-Owner: Pontus Leitzler <leit...@gmail.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
Gerrit-Reviewer: Pontus Leitzler <leit...@gmail.com>
Gerrit-CC: Robert Findley <rfin...@golang.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages