1
0
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:
Rohan Challa 2020-02-12 16:42:17 -05:00
parent 3187b3c415
commit 0abbfa5d31
3 changed files with 3 additions and 4 deletions

View File

@ -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 {

View File

@ -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)

View File

@ -82,7 +82,7 @@ func DefaultOptions() Options {
CompletionBudget: 100 * time.Millisecond,
},
ExperimentalOptions: ExperimentalOptions{
TempModfile: false,
TempModfile: true,
},
Hooks: Hooks{
ComputeEdits: myers.ComputeEdits,