mirror of
https://github.com/golang/go
synced 2024-09-30 20:28:32 -06:00
internal/lsp: turn tempModfile flag on by default
This change turns the tempModfile flag on by default in the master branch. Change-Id: If96369aee4e970421a80d5ff89385a38c7ccf0b2 Reviewed-on: https://go-review.googlesource.com/c/tools/+/219225 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
3187b3c415
commit
0abbfa5d31
4
internal/lsp/cache/view.go
vendored
4
internal/lsp/cache/view.go
vendored
@ -591,8 +591,8 @@ func (v *view) setBuildInformation(ctx context.Context, folder span.URI, env []s
|
||||
// check if the view has a valid build configuration.
|
||||
v.hasValidBuildConfiguration = checkBuildConfiguration(v.goCommand, v.realMod, v.folder, v.gopath)
|
||||
|
||||
// The user has disabled the use of the -modfile flag.
|
||||
if !modfileFlagEnabled {
|
||||
// The user has disabled the use of the -modfile flag or has no go.mod file.
|
||||
if !modfileFlagEnabled || v.realMod == "" {
|
||||
return nil
|
||||
}
|
||||
if modfileFlag, err := v.modfileFlagExists(ctx, v.Options().Env); err != nil {
|
||||
|
@ -51,7 +51,6 @@ func testLSP(t *testing.T, exporter packagestest.Exporter) {
|
||||
cache := cache.New(nil)
|
||||
session := cache.NewSession()
|
||||
options := tests.DefaultOptions()
|
||||
options.TempModfile = exporter == packagestest.Modules
|
||||
session.SetOptions(options)
|
||||
options.Env = datum.Config.Env
|
||||
v, _, err := session.NewView(ctx, datum.Config.Dir, span.FileURI(datum.Config.Dir), options)
|
||||
|
@ -82,7 +82,7 @@ func DefaultOptions() Options {
|
||||
CompletionBudget: 100 * time.Millisecond,
|
||||
},
|
||||
ExperimentalOptions: ExperimentalOptions{
|
||||
TempModfile: false,
|
||||
TempModfile: true,
|
||||
},
|
||||
Hooks: Hooks{
|
||||
ComputeEdits: myers.ComputeEdits,
|
||||
|
Loading…
Reference in New Issue
Block a user