diff --git a/internal/lsp/cache/snapshot.go b/internal/lsp/cache/snapshot.go index edcb5213e5..1dd3339e8e 100644 --- a/internal/lsp/cache/snapshot.go +++ b/internal/lsp/cache/snapshot.go @@ -391,14 +391,13 @@ func (s *snapshot) goCommandInvocation(ctx context.Context, flags source.Invocat } else { inv.ModFlag = mutableModFlag } - case source.UpdateUserModFile, source.WriteTemporaryModFile: + case source.WriteTemporaryModFile: inv.ModFlag = mutableModFlag } } - wantTempMod := mode != source.UpdateUserModFile needTempMod := mode == source.WriteTemporaryModFile - tempMod := wantTempMod && s.workspaceMode()&tempModfile != 0 + tempMod := s.workspaceMode()&tempModfile != 0 if needTempMod && !tempMod { return "", nil, cleanup, source.ErrTmpModfileUnsupported } diff --git a/internal/lsp/source/view.go b/internal/lsp/source/view.go index 906d45fc0e..e7120ec5af 100644 --- a/internal/lsp/source/view.go +++ b/internal/lsp/source/view.go @@ -201,9 +201,6 @@ const ( // Normal is appropriate for commands that might be run by a user and don't // deliberately modify go.mod files, e.g. `go test`. Normal InvocationFlags = iota - // UpdateUserModFile is for commands that intend to update the user's real - // go.mod file, e.g. `go mod tidy` in response to a user's request to tidy. - UpdateUserModFile // WriteTemporaryModFile is for commands that need information from a // modified version of the user's go.mod file, e.g. `go mod tidy` used to // generate diagnostics.