mirror of https://github.com/golang/go.git
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:
parent
5e752206af
commit
75f8c4427c
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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":
|
||||
|
|
|
|||
Loading…
Reference in New Issue