diff --git a/gopls/internal/regtest/watch_test.go b/gopls/internal/regtest/watch_test.go index 3b5b69dcd1..9786480e8c 100644 --- a/gopls/internal/regtest/watch_test.go +++ b/gopls/internal/regtest/watch_test.go @@ -375,7 +375,9 @@ func _() { package a ` t.Run("close then delete", func(t *testing.T) { - runner.Run(t, pkg, func(t *testing.T, env *Env) { + withOptions(EditorConfig{ + VerboseOutput: true, + }).run(t, pkg, func(t *testing.T, env *Env) { env.OpenFile("a/a.go") env.OpenFile("a/a_unneeded.go") env.Await( @@ -407,7 +409,9 @@ package a }) t.Run("delete then close", func(t *testing.T) { - runner.Run(t, pkg, func(t *testing.T, env *Env) { + withOptions(EditorConfig{ + VerboseOutput: true, + }).run(t, pkg, func(t *testing.T, env *Env) { env.OpenFile("a/a.go") env.OpenFile("a/a_unneeded.go") env.Await( diff --git a/internal/lsp/cache/load.go b/internal/lsp/cache/load.go index 9eed1c4c91..8009df1dbc 100644 --- a/internal/lsp/cache/load.go +++ b/internal/lsp/cache/load.go @@ -81,7 +81,7 @@ func (s *snapshot) load(ctx context.Context, scopes ...interface{}) error { panic(fmt.Sprintf("unknown scope type %T", scope)) } switch scope.(type) { - case viewLoadScope: + case viewLoadScope, moduleLoadScope: containsDir = true } } diff --git a/internal/lsp/fake/editor.go b/internal/lsp/fake/editor.go index fed01eca95..12b9b1cbae 100644 --- a/internal/lsp/fake/editor.go +++ b/internal/lsp/fake/editor.go @@ -95,6 +95,8 @@ type EditorConfig struct { // Whether to send the current process ID, for testing data that is joined to // the PID. This can only be set by one test. SendPID bool + + VerboseOutput bool } // NewEditor Creates a new Editor. @@ -212,6 +214,10 @@ func (e *Editor) configuration() map[string]interface{} { config["allExperiments"] = true } + if e.Config.VerboseOutput { + config["verboseOutput"] = true + } + // TODO(rFindley): uncomment this if/when diagnostics delay is on by // default... and probably change to the new settings name. // config["experimentalDiagnosticsDelay"] = "10ms"