1 // Copyright 2020 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
10 "golang.org/x/tools/internal/lsp"
11 "golang.org/x/tools/internal/lsp/fake"
14 // Test that enabling and disabling produces the expected results of showing
15 // and hiding staticcheck analysis results.
16 func TestChangeConfiguration(t *testing.T) {
25 // NotThisVariable should really start with ThisVariable.
26 const ThisVariable = 7
28 run(t, files, func(t *testing.T, env *Env) {
29 env.OpenFile("a/a.go")
31 CompletedWork(lsp.DiagnosticWorkTitle(lsp.FromDidOpen), 1),
32 NoDiagnostics("a/a.go"),
34 cfg := &fake.EditorConfig{}
35 *cfg = env.Editor.Config
36 cfg.EnableStaticcheck = true
37 env.changeConfiguration(t, cfg)
39 DiagnosticAt("a/a.go", 2, 0),