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
Files:
- M gopls/internal/cache/snapshot.go
Change size: S
Delta: 1 file changed, 10 insertions(+), 0 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Code-Review: +1 by Michael Knyszek, +2 by Alan Donovan
TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI