diff --git a/gopls/internal/lsp/source/options.go b/gopls/internal/lsp/source/options.go index 45aeca99dd..b15d7144bf 100644 --- a/gopls/internal/lsp/source/options.go +++ b/gopls/internal/lsp/source/options.go @@ -164,6 +164,7 @@ func DefaultOptions() *Options { CompleteUnimported: true, CompletionDocumentation: true, DeepCompletion: true, + ChattyDiagnostics: true, }, Hooks: Hooks{ ComputeEdits: myers.ComputeEdits, @@ -587,11 +588,6 @@ type InternalOptions struct { // ChattyDiagnostics controls whether to report file diagnostics for each // file change. If unset, gopls only reports diagnostics when they change, or // when a file is opened or closed. - // - // TODO(rfindley): is seems that for many clients this should be true by - // default. For example, coc.nvim seems to get confused if diagnostics are - // not re-published. Switch the default to true after some period of internal - // testing. ChattyDiagnostics bool } @@ -824,7 +820,6 @@ func (o *Options) EnableAllExperiments() { o.ExperimentalUseInvalidMetadata = true o.ExperimentalWatchedFileDelay = 50 * time.Millisecond o.NewDiff = "checked" - o.ChattyDiagnostics = true } func (o *Options) enableAllExperimentMaps() { diff --git a/gopls/internal/regtest/modfile/modfile_test.go b/gopls/internal/regtest/modfile/modfile_test.go index 7da8830c91..eb3f966569 100644 --- a/gopls/internal/regtest/modfile/modfile_test.go +++ b/gopls/internal/regtest/modfile/modfile_test.go @@ -1189,8 +1189,8 @@ func main() { ) env.ApplyQuickFixes("main.go", d.Diagnostics) env.Await( - EmptyDiagnostics("main.go"), - NoDiagnostics("go.mod"), + EmptyOrNoDiagnostics("main.go"), + EmptyOrNoDiagnostics("go.mod"), ) }) }