internal/lsp: change -modfile flag to tempModfile

Remove double negative issues and rename the disableTempModfile flag
to be tempModfile.

Updates golang/go#31999

Change-Id: Id62aa3707fef6758a1026c864a962f0bed36bc2b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/212240
Run-TryBot: Rohan Challa <rohan@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
Rohan Challa 2019-12-20 13:50:28 -05:00
parent 5e752206af
commit 75f8c4427c
2 changed files with 9 additions and 9 deletions

View File

@ -37,7 +37,7 @@ func modfileFlagExists(ctx context.Context, folder string, env []string) (string
// The function getModfiles will return the go.mod files associated with the directory that is passed in.
func getModfiles(ctx context.Context, folder string, options source.Options) (*modfiles, error) {
if options.DisableTempModfile {
if !options.TempModfile {
log.Print(ctx, "using the -modfile flag is disabled", telemetry.Directory.Of(folder))
return nil, nil
}

View File

@ -67,11 +67,11 @@ var (
Literal: true,
Budget: 100 * time.Millisecond,
},
ComputeEdits: myers.ComputeEdits,
Analyzers: defaultAnalyzers,
GoDiff: true,
LinkTarget: "pkg.go.dev",
DisableTempModfile: true,
ComputeEdits: myers.ComputeEdits,
Analyzers: defaultAnalyzers,
GoDiff: true,
LinkTarget: "pkg.go.dev",
TempModfile: false,
}
)
@ -117,7 +117,7 @@ type Options struct {
// WARNING: This configuration will be changed in the future.
// It only exists while this feature is under development.
// Disable use of the -modfile flag in Go 1.14.
DisableTempModfile bool
TempModfile bool
LinkTarget string
}
@ -323,8 +323,8 @@ func (o *Options) set(name string, value interface{}) OptionResult {
case "verboseOutput":
result.setBool(&o.VerboseOutput)
case "disableTempModfile":
result.setBool(&o.DisableTempModfile)
case "tempModfile":
result.setBool(&o.TempModfile)
// Deprecated settings.
case "wantSuggestedFixes":