Skip to content

Commit

Permalink
internal/lsp/source: remove the unused UpdateUserModFile invocation flag
Browse files Browse the repository at this point in the history
Change-Id: I4325417e4d97d3ab82551c2fa0382aa3d962a781
Reviewed-on: https://go-review.googlesource.com/c/tools/+/382077
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
  • Loading branch information
findleyr committed Feb 3, 2022
1 parent 727dfdb commit 4da8ceb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 2 additions & 3 deletions internal/lsp/cache/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 0 additions & 3 deletions internal/lsp/source/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4da8ceb

Please sign in to comment.