Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 27dfeb2

Browse files
committedJan 13, 2023
gopls/internal/regtest: replace NoDiagnostics with NoMatchingDiagnostics
Replace uses of NoDiagnostics with the more flexible NoMatchingDiagnostics, and rename NoMatchingDiagnostics to NoDiagnostics. Updates golang/go#39384 Change-Id: I15b19ad6c9b58c1ae88ec1b444bb589002f75a80 Reviewed-on: https://go-review.googlesource.com/c/tools/+/461936 gopls-CI: kokoro <[email protected]> Reviewed-by: Alan Donovan <[email protected]> Run-TryBot: Robert Findley <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 87092c8 commit 27dfeb2

23 files changed

+130
-147
lines changed
 

‎gopls/internal/lsp/regtest/expectation.go

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -728,12 +728,10 @@ func Diagnostics(filters ...DiagnosticFilter) Expectation {
728728
}
729729
}
730730

731-
// NoMatchingDiagnostics asserts that there are no diagnostics matching the
732-
// given filters. Notably, if no filters are supplied this assertion checks
733-
// that there are no diagnostics at all, for any file.
734-
//
735-
// TODO(rfindley): replace NoDiagnostics with this, and rename.
736-
func NoMatchingDiagnostics(filters ...DiagnosticFilter) Expectation {
731+
// NoDiagnostics asserts that there are no diagnostics matching the given
732+
// filters. Notably, if no filters are supplied this assertion checks that
733+
// there are no diagnostics at all, for any file.
734+
func NoDiagnostics(filters ...DiagnosticFilter) Expectation {
737735
check := func(s State) Verdict {
738736
diags := flattenDiagnostics(s)
739737
for _, filter := range filters {
@@ -778,7 +776,7 @@ func flattenDiagnostics(state State) []flatDiagnostic {
778776
// -- Diagnostic filters --
779777

780778
// A DiagnosticFilter filters the set of diagnostics, for assertion with
781-
// Diagnostics or NoMatchingDiagnostics.
779+
// Diagnostics or NoDiagnostics.
782780
type DiagnosticFilter struct {
783781
desc string
784782
check func(name string, _ protocol.Diagnostic) bool
@@ -832,21 +830,6 @@ func WithMessageContaining(substring string) DiagnosticFilter {
832830

833831
// TODO(rfindley): eliminate all expectations below this point.
834832

835-
// NoDiagnostics asserts that either no diagnostics are sent for the
836-
// workspace-relative path name, or empty diagnostics are sent.
837-
func NoDiagnostics(name string) Expectation {
838-
check := func(s State) Verdict {
839-
if diags := s.diagnostics[name]; diags == nil || len(diags.Diagnostics) == 0 {
840-
return Met
841-
}
842-
return Unmet
843-
}
844-
return SimpleExpectation{
845-
check: check,
846-
description: fmt.Sprintf("empty or no diagnostics for %q", name),
847-
}
848-
}
849-
850833
// DiagnosticAtRegexp expects that there is a diagnostic entry at the start
851834
// position matching the regexp search string re in the buffer specified by
852835
// name. Note that this currently ignores the end position.

‎gopls/internal/regtest/codelens/codelens_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,13 @@ require golang.org/x/hello v1.2.3
215215
// but there may be some subtlety in timing here, where this
216216
// should always succeed, but may not actually test the correct
217217
// behavior.
218-
NoMatchingDiagnostics(env.AtRegexp("b/go.mod", `require`)),
218+
NoDiagnostics(env.AtRegexp("b/go.mod", `require`)),
219219
)
220220
// Check for upgrades in b/go.mod and then clear them.
221221
env.ExecuteCodeLensCommand("b/go.mod", command.CheckUpgrades, nil)
222222
env.Await(env.DiagnosticAtRegexpWithMessage("b/go.mod", `require`, "can be upgraded"))
223223
env.ExecuteCodeLensCommand("b/go.mod", command.ResetGoModDiagnostics, nil)
224-
env.Await(NoDiagnostics("b/go.mod"))
224+
env.Await(NoDiagnostics(ForFile("b/go.mod")))
225225

226226
// Apply the diagnostics to a/go.mod.
227227
env.ApplyQuickFixes("a/go.mod", d.Diagnostics)
@@ -331,6 +331,6 @@ func Foo() {
331331

332332
// Regenerate cgo, fixing the diagnostic.
333333
env.ExecuteCodeLensCommand("cgo.go", command.RegenerateCgo, nil)
334-
env.Await(NoDiagnostics("cgo.go"))
334+
env.Await(NoDiagnostics(ForFile("cgo.go")))
335335
})
336336
}

‎gopls/internal/regtest/codelens/gcdetails_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func main() {
6666
// Editing a buffer should cause gc_details diagnostics to disappear, since
6767
// they only apply to saved buffers.
6868
env.EditBuffer("main.go", fake.NewEdit(0, 0, 0, 0, "\n\n"))
69-
env.AfterChange(NoDiagnostics("main.go"))
69+
env.AfterChange(NoDiagnostics(ForFile("main.go")))
7070

7171
// Saving a buffer should re-format back to the original state, and
7272
// re-enable the gc_details diagnostics.
@@ -75,7 +75,7 @@ func main() {
7575

7676
// Toggle the GC details code lens again so now it should be off.
7777
env.ExecuteCodeLensCommand("main.go", command.GCDetails, nil)
78-
env.Await(NoDiagnostics("main.go"))
78+
env.Await(NoDiagnostics(ForFile("main.go")))
7979
})
8080
}
8181

‎gopls/internal/regtest/diagnostics/analysis_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ func main() {
4444
)
4545

4646
env.ApplyQuickFixes("main.go", d.Diagnostics)
47-
env.AfterChange(NoDiagnostics("main.go"))
47+
env.AfterChange(NoDiagnostics(ForFile("main.go")))
4848
})
4949
}

‎gopls/internal/regtest/diagnostics/builtin_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ const (
3030
if !strings.HasSuffix(name, "builtin.go") {
3131
t.Fatalf("jumped to %q, want builtin.go", name)
3232
}
33-
env.AfterChange(NoDiagnostics("builtin.go"))
33+
env.AfterChange(NoDiagnostics(ForFile("builtin.go")))
3434
})
3535
}

‎gopls/internal/regtest/diagnostics/diagnostics_test.go

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func m() {
7777
env.DiagnosticAtRegexp("main.go", "log"),
7878
)
7979
env.SaveBuffer("main.go")
80-
env.AfterChange(NoDiagnostics("main.go"))
80+
env.AfterChange(NoDiagnostics(ForFile("main.go")))
8181
})
8282
}
8383

@@ -119,8 +119,8 @@ func TestDiagnosticClearingOnEdit(t *testing.T) {
119119
// Fix the error by editing the const name in b.go to `b`.
120120
env.RegexpReplace("b.go", "(a) = 2", "b")
121121
env.AfterChange(
122-
NoDiagnostics("a.go"),
123-
NoDiagnostics("b.go"),
122+
NoDiagnostics(ForFile("a.go")),
123+
NoDiagnostics(ForFile("b.go")),
124124
)
125125
})
126126
}
@@ -132,8 +132,8 @@ func TestDiagnosticClearingOnDelete_Issue37049(t *testing.T) {
132132
env.RemoveWorkspaceFile("b.go")
133133

134134
env.Await(
135-
NoDiagnostics("a.go"),
136-
NoDiagnostics("b.go"),
135+
NoDiagnostics(ForFile("a.go")),
136+
NoDiagnostics(ForFile("b.go")),
137137
)
138138
})
139139
}
@@ -152,7 +152,7 @@ const a = 3`)
152152
env.AfterChange(
153153
env.DiagnosticAtRegexp("a.go", "a = 1"),
154154
env.DiagnosticAtRegexp("b.go", "a = 2"),
155-
NoDiagnostics("c.go"),
155+
NoDiagnostics(ForFile("c.go")),
156156
)
157157
})
158158
}
@@ -177,7 +177,7 @@ const a = http.MethodGet
177177
// Expect the diagnostics to clear.
178178
env.SaveBuffer("c/c.go")
179179
env.AfterChange(
180-
NoDiagnostics("c/c.go"),
180+
NoDiagnostics(ForFile("c/c.go")),
181181
)
182182
})
183183
}
@@ -213,7 +213,7 @@ func TestDeleteTestVariant(t *testing.T) {
213213
Run(t, test38878, func(t *testing.T, env *Env) {
214214
env.Await(env.DiagnosticAtRegexp("a_test.go", `f\((3)\)`))
215215
env.RemoveWorkspaceFile("a_test.go")
216-
env.AfterChange(NoDiagnostics("a_test.go"))
216+
env.AfterChange(NoDiagnostics(ForFile("a_test.go")))
217217

218218
// Make sure the test variant has been removed from the workspace by
219219
// triggering a metadata load.
@@ -267,7 +267,7 @@ func Hello() {
267267
env.SaveBuffer("go.mod")
268268
var d protocol.PublishDiagnosticsParams
269269
env.AfterChange(
270-
NoDiagnostics("main.go"),
270+
NoDiagnostics(ForFile("main.go")),
271271
env.DiagnosticAtRegexp("bob/bob.go", "x"),
272272
ReadDiagnostics("bob/bob.go", &d),
273273
)
@@ -283,7 +283,7 @@ func Hello() {
283283
)
284284
env.RunGoCommand("mod", "init", "mod.com")
285285
env.AfterChange(
286-
NoDiagnostics("main.go"),
286+
NoDiagnostics(ForFile("main.go")),
287287
env.DiagnosticAtRegexp("bob/bob.go", "x"),
288288
)
289289
})
@@ -300,7 +300,7 @@ func Hello() {
300300
t.Fatal(err)
301301
}
302302
env.AfterChange(
303-
NoDiagnostics("main.go"),
303+
NoDiagnostics(ForFile("main.go")),
304304
env.DiagnosticAtRegexp("bob/bob.go", "x"),
305305
)
306306
})
@@ -350,7 +350,7 @@ func TestHello(t *testing.T) {
350350
env.RegexpReplace("lib.go", "_ = x", "var y int")
351351
env.AfterChange(
352352
env.DiagnosticAtRegexp("lib.go", "y int"),
353-
NoDiagnostics("lib_test.go"),
353+
NoDiagnostics(ForFile("lib_test.go")),
354354
)
355355
})
356356
}
@@ -370,7 +370,7 @@ func main() {}
370370
env.OpenFile("a.go")
371371
env.RegexpReplace("a.go", "foo", "foox")
372372
env.AfterChange(
373-
NoDiagnostics("a.go"),
373+
NoDiagnostics(ForFile("a.go")),
374374
)
375375
})
376376
}
@@ -464,7 +464,7 @@ func _() {
464464
env.OpenFile("main.go")
465465
env.AfterChange(env.DiagnosticAtRegexp("main.go", "fmt"))
466466
env.SaveBuffer("main.go")
467-
env.AfterChange(NoDiagnostics("main.go"))
467+
env.AfterChange(NoDiagnostics(ForFile("main.go")))
468468
})
469469
}
470470

@@ -489,7 +489,7 @@ var X = 0
489489
).Run(t, files, func(t *testing.T, env *Env) {
490490
env.OpenFile("main.go")
491491
env.OrganizeImports("main.go")
492-
env.AfterChange(NoDiagnostics("main.go"))
492+
env.AfterChange(NoDiagnostics(ForFile("main.go")))
493493
})
494494
}
495495

@@ -650,7 +650,7 @@ func main() {
650650
env.ApplyQuickFixes("main.go", d.Diagnostics)
651651
env.SaveBuffer("go.mod")
652652
env.AfterChange(
653-
NoDiagnostics("main.go"),
653+
NoDiagnostics(ForFile("main.go")),
654654
)
655655
// Comment out the line that depends on conf and expect a
656656
// diagnostic and a fix to remove the import.
@@ -661,14 +661,14 @@ func main() {
661661
env.SaveBuffer("main.go")
662662
// Expect a diagnostic and fix to remove the dependency in the go.mod.
663663
env.AfterChange(
664-
NoDiagnostics("main.go"),
664+
NoDiagnostics(ForFile("main.go")),
665665
env.DiagnosticAtRegexpWithMessage("go.mod", "require github.com/ardanlabs/conf", "not used in this module"),
666666
ReadDiagnostics("go.mod", &d),
667667
)
668668
env.ApplyQuickFixes("go.mod", d.Diagnostics)
669669
env.SaveBuffer("go.mod")
670670
env.AfterChange(
671-
NoDiagnostics("go.mod"),
671+
NoDiagnostics(ForFile("go.mod")),
672672
)
673673
// Uncomment the lines and expect a new diagnostic for the import.
674674
env.RegexpReplace("main.go", "//_ = conf.ErrHelpWanted", "_ = conf.ErrHelpWanted")
@@ -707,7 +707,7 @@ func main() {
707707
)
708708
env.ApplyQuickFixes("main.go", d.Diagnostics)
709709
env.AfterChange(
710-
NoDiagnostics("main.go"),
710+
NoDiagnostics(ForFile("main.go")),
711711
)
712712
})
713713
}
@@ -733,11 +733,11 @@ func _() {
733733
env.CreateBuffer("a/a2.go", ``)
734734
env.SaveBufferWithoutActions("a/a2.go")
735735
env.AfterChange(
736-
NoDiagnostics("a/a1.go"),
736+
NoDiagnostics(ForFile("a/a1.go")),
737737
)
738738
env.EditBuffer("a/a2.go", fake.NewEdit(0, 0, 0, 0, `package a`))
739739
env.AfterChange(
740-
NoDiagnostics("a/a1.go"),
740+
NoDiagnostics(ForFile("a/a1.go")),
741741
)
742742
})
743743
}
@@ -805,7 +805,7 @@ func TestHello(t *testing.T) {
805805
)
806806
env.SaveBuffer("hello/hello_x_test.go")
807807
env.AfterChange(
808-
NoDiagnostics("hello/hello_x_test.go"),
808+
NoDiagnostics(ForFile("hello/hello_x_test.go")),
809809
)
810810
})
811811
}
@@ -854,8 +854,8 @@ package foo_
854854
env.OpenFile("foo/bar_test.go")
855855
env.RegexpReplace("foo/bar_test.go", "package foo_", "package foo_test")
856856
env.AfterChange(
857-
NoDiagnostics("foo/bar_test.go"),
858-
NoDiagnostics("foo/foo.go"),
857+
NoDiagnostics(ForFile("foo/bar_test.go")),
858+
NoDiagnostics(ForFile("foo/foo.go")),
859859
)
860860
})
861861
}
@@ -874,7 +874,7 @@ var _ = foo.Bar
874874
Run(t, ws, func(t *testing.T, env *Env) {
875875
env.OpenFile("_foo/x.go")
876876
env.AfterChange(
877-
NoDiagnostics("_foo/x.go"),
877+
NoDiagnostics(ForFile("_foo/x.go")),
878878
)
879879
})
880880
}
@@ -997,9 +997,9 @@ func TestDoIt(t *testing.T) {
997997
)
998998
env.RegexpReplace("p/p.go", "s string", "i int")
999999
env.AfterChange(
1000-
NoDiagnostics("main.go"),
1001-
NoDiagnostics("p/p_test.go"),
1002-
NoDiagnostics("p/x_test.go"),
1000+
NoDiagnostics(ForFile("main.go")),
1001+
NoDiagnostics(ForFile("p/p_test.go")),
1002+
NoDiagnostics(ForFile("p/x_test.go")),
10031003
)
10041004
})
10051005
})
@@ -1054,7 +1054,7 @@ func main() {
10541054
}`)
10551055
env.OpenFile("foo/foo_test.go")
10561056
env.RegexpReplace("foo/foo_test.go", `package main`, `package foo`)
1057-
env.AfterChange(NoDiagnostics("foo/foo.go"))
1057+
env.AfterChange(NoDiagnostics(ForFile("foo/foo.go")))
10581058
})
10591059
}
10601060

@@ -1173,7 +1173,7 @@ func main() {
11731173
).Run(t, mod, func(t *testing.T, env *Env) {
11741174
env.OpenFile("a/main.go")
11751175
env.AfterChange(
1176-
NoDiagnostics("main.go"),
1176+
NoDiagnostics(ForFile("main.go")),
11771177
)
11781178
})
11791179
}
@@ -1212,7 +1212,7 @@ func main() {
12121212
t.Errorf("wanted Unnecessary tag on diagnostic, got %v", tags)
12131213
}
12141214
env.ApplyQuickFixes("main.go", d.Diagnostics)
1215-
env.AfterChange(NoDiagnostics("main.go"))
1215+
env.AfterChange(NoDiagnostics(ForFile("main.go")))
12161216
})
12171217
}
12181218

@@ -1369,7 +1369,7 @@ func main() {
13691369
Run(t, mod, func(t *testing.T, env *Env) {
13701370
env.OnceMet(
13711371
InitialWorkspaceLoad,
1372-
NoMatchingDiagnostics(WithMessageContaining("illegal character U+0023 '#'")),
1372+
NoDiagnostics(WithMessageContaining("illegal character U+0023 '#'")),
13731373
)
13741374
})
13751375
}
@@ -1431,7 +1431,7 @@ package foo_
14311431
env.Await(env.DoneWithChange())
14321432
env.RegexpReplace("foo/foo_test.go", "_t", "_test")
14331433
env.AfterChange(
1434-
NoDiagnostics("foo/foo_test.go"),
1434+
NoDiagnostics(ForFile("foo/foo_test.go")),
14351435
NoOutstandingWork(),
14361436
)
14371437
})
@@ -1498,7 +1498,7 @@ func main() {
14981498
env.RemoveWorkspaceFile("bob")
14991499
env.AfterChange(
15001500
env.DiagnosticAtRegexp("cmd/main.go", `"mod.com/bob"`),
1501-
NoDiagnostics("bob/bob.go"),
1501+
NoDiagnostics(ForFile("bob/bob.go")),
15021502
NoFileWatchMatching("bob"),
15031503
)
15041504
})
@@ -1585,8 +1585,8 @@ const B = a.B
15851585
env.RegexpReplace("b/b.go", `const B = a\.B`, "")
15861586
env.SaveBuffer("b/b.go")
15871587
env.Await(
1588-
NoDiagnostics("a/a.go"),
1589-
NoDiagnostics("b/b.go"),
1588+
NoDiagnostics(ForFile("a/a.go")),
1589+
NoDiagnostics(ForFile("b/b.go")),
15901590
)
15911591
})
15921592
}
@@ -1718,7 +1718,7 @@ var Bar = Foo
17181718
env.OpenFile("foo.go")
17191719
env.AfterChange(env.DiagnosticAtRegexp("bar.go", `Foo`))
17201720
env.RegexpReplace("foo.go", `\+build`, "")
1721-
env.AfterChange(NoDiagnostics("bar.go"))
1721+
env.AfterChange(NoDiagnostics(ForFile("bar.go")))
17221722
})
17231723

17241724
}
@@ -1819,7 +1819,7 @@ const C = 0b10
18191819
)
18201820
env.WriteWorkspaceFile("go.mod", "module mod.com \n\ngo 1.13\n")
18211821
env.AfterChange(
1822-
NoDiagnostics("main.go"),
1822+
NoDiagnostics(ForFile("main.go")),
18231823
)
18241824
})
18251825
}
@@ -1874,7 +1874,7 @@ func F[T any](_ T) {
18741874

18751875
env.ApplyQuickFixes("main.go", d.Diagnostics)
18761876
env.AfterChange(
1877-
NoDiagnostics("main.go"),
1877+
NoDiagnostics(ForFile("main.go")),
18781878
)
18791879
})
18801880
}
@@ -1912,7 +1912,7 @@ func F[T any](_ T) {
19121912
// Once the edit is applied, the problematic diagnostics should be
19131913
// resolved.
19141914
env.AfterChange(
1915-
NoDiagnostics("main.go"),
1915+
NoDiagnostics(ForFile("main.go")),
19161916
)
19171917
})
19181918
}

‎gopls/internal/regtest/misc/configuration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var FooErr = errors.New("foo")
3636
Run(t, files, func(t *testing.T, env *Env) {
3737
env.OpenFile("a/a.go")
3838
env.AfterChange(
39-
NoDiagnostics("a/a.go"),
39+
NoDiagnostics(ForFile("a/a.go")),
4040
)
4141
cfg := env.Editor.Config()
4242
cfg.Settings = map[string]interface{}{

‎gopls/internal/regtest/misc/embed_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ var foo string
3030
env.OpenFile("x.go")
3131
env.AfterChange(env.DiagnosticAtRegexpWithMessage("x.go", `NONEXISTENT`, "no matching files found"))
3232
env.RegexpReplace("x.go", `NONEXISTENT`, "x.go")
33-
env.AfterChange(NoDiagnostics("x.go"))
33+
env.AfterChange(NoDiagnostics(ForFile("x.go")))
3434
})
3535
}

‎gopls/internal/regtest/misc/failures_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ const a = 2
7777
// Fix the error by editing the const name in b.go to `b`.
7878
env.RegexpReplace("b.go", "(a) = 2", "b")
7979
env.Await(
80-
NoDiagnostics("a.go"),
81-
NoDiagnostics("b.go"),
80+
NoDiagnostics(ForFile("a.go")),
81+
NoDiagnostics(ForFile("b.go")),
8282
)
8383
})
8484
}

‎gopls/internal/regtest/misc/fix_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ func Foo() error {
102102
t.Fatalf("expected fixall code action, got none")
103103
}
104104
env.ApplyQuickFixes("main.go", d.Diagnostics)
105-
env.AfterChange(NoDiagnostics("main.go"))
105+
env.AfterChange(NoDiagnostics(ForFile("main.go")))
106106
})
107107
}

‎gopls/internal/regtest/misc/generate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func main() {
6565
env.RunGenerate("./lib1")
6666
env.RunGenerate("./lib2")
6767
env.AfterChange(
68-
NoDiagnostics("main.go"),
68+
NoDiagnostics(ForFile("main.go")),
6969
)
7070
})
7171
}

‎gopls/internal/regtest/misc/imports_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ var _, _ = x.X, y.Y
158158
env.OpenFile("main.go")
159159
env.AfterChange(env.DiagnosticAtRegexp("main.go", `y.Y`))
160160
env.SaveBuffer("main.go")
161-
env.AfterChange(NoDiagnostics("main.go"))
161+
env.AfterChange(NoDiagnostics(ForFile("main.go")))
162162
path, _ := env.GoToDefinition("main.go", env.RegexpSearch("main.go", `y.(Y)`))
163163
if !strings.HasPrefix(path, filepath.ToSlash(modcache)) {
164164
t.Errorf("found module dependency outside of GOMODCACHE: got %v, wanted subdir of %v", path, filepath.ToSlash(modcache))
@@ -205,7 +205,7 @@ func TestA(t *testing.T) {
205205
)
206206
env.ApplyQuickFixes("a/a.go", d.Diagnostics)
207207
env.AfterChange(
208-
NoDiagnostics("a/a.go"),
208+
NoDiagnostics(ForFile("a/a.go")),
209209
)
210210
})
211211
}
@@ -252,6 +252,6 @@ func Test() {
252252
// Saving caller.go should trigger goimports, which should find a.Test in
253253
// the mod.com module, thanks to the go.work file.
254254
env.SaveBuffer("caller/caller.go")
255-
env.AfterChange(NoDiagnostics("caller/caller.go"))
255+
env.AfterChange(NoDiagnostics(ForFile("caller/caller.go")))
256256
})
257257
}

‎gopls/internal/regtest/misc/rename_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ package b
412412
// Moving x.go should make the diagnostic go away.
413413
env.RenameFile("a/x.go", "b/x.go")
414414
env.AfterChange(
415-
NoDiagnostics("a/a.go"), // no more duplicate declarations
415+
NoDiagnostics(ForFile("a/a.go")), // no more duplicate declarations
416416
env.DiagnosticAtRegexp("b/b.go", "package"), // as package names mismatch
417417
)
418418

‎gopls/internal/regtest/misc/shared_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func main() {
6565

6666
env1.RegexpReplace("main.go", "Printl", "Println")
6767
env1.AfterChange(
68-
NoDiagnostics("main.go"),
68+
NoDiagnostics(ForFile("main.go")),
6969
)
7070
})
7171
}

‎gopls/internal/regtest/misc/vuln_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func main() {
228228
env.OnceMet(
229229
CompletedProgress(result.Token, nil),
230230
ShownMessage("Found GOSTDLIB"),
231-
NoDiagnostics("go.mod"),
231+
NoDiagnostics(ForFile("go.mod")),
232232
)
233233
testFetchVulncheckResult(t, env, map[string]fetchVulncheckResult{
234234
"go.mod": {IDs: []string{"GOSTDLIB"}, Mode: govulncheck.ModeGovulncheck}})
@@ -274,7 +274,7 @@ func main() {
274274
).Run(t, files, func(t *testing.T, env *Env) {
275275
env.OpenFile("go.mod")
276276
env.AfterChange(
277-
NoDiagnostics("go.mod"),
277+
NoDiagnostics(ForFile("go.mod")),
278278
// we don't publish diagnostics for standard library vulnerability yet.
279279
)
280280
testFetchVulncheckResult(t, env, map[string]fetchVulncheckResult{
@@ -854,7 +854,7 @@ func TestGovulncheckInfo(t *testing.T) {
854854
}
855855
env.ApplyCodeAction(reset)
856856

857-
env.Await(NoDiagnostics("go.mod"))
857+
env.Await(NoDiagnostics(ForFile("go.mod")))
858858
})
859859
}
860860

‎gopls/internal/regtest/modfile/modfile_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ func main() {
485485
)
486486
env.RunGoCommandInDir("a", "mod", "tidy")
487487
env.AfterChange(
488-
NoDiagnostics("a/go.mod"),
488+
NoDiagnostics(ForFile("a/go.mod")),
489489
)
490490
})
491491
}
@@ -558,7 +558,7 @@ require (
558558
)
559559
`
560560
env.SaveBuffer("a/go.mod")
561-
env.AfterChange(NoDiagnostics("a/main.go"))
561+
env.AfterChange(NoDiagnostics(ForFile("a/main.go")))
562562
if got := env.BufferText("a/go.mod"); got != want {
563563
t.Fatalf("suggested fixes failed:\n%s", compare.Text(want, got))
564564
}
@@ -614,7 +614,7 @@ func main() {
614614
env.ApplyCodeAction(qfs[0]) // Arbitrarily pick a single fix to apply. Applying all of them seems to cause trouble in this particular test.
615615
env.SaveBuffer("a/go.mod") // Save to trigger diagnostics.
616616
env.AfterChange(
617-
NoDiagnostics("a/go.mod"),
617+
NoDiagnostics(ForFile("a/go.mod")),
618618
env.DiagnosticAtRegexp("a/main.go", "x = "),
619619
)
620620
})
@@ -744,7 +744,7 @@ func main() {
744744
env.RunGoCommand("get", "example.com/blah@v1.2.3")
745745
env.RunGoCommand("mod", "tidy")
746746
env.AfterChange(
747-
NoDiagnostics("main.go"),
747+
NoDiagnostics(ForFile("main.go")),
748748
)
749749
})
750750
}
@@ -882,7 +882,7 @@ func main() {
882882
env.ApplyQuickFixes("go.mod", d.Diagnostics)
883883
env.SaveBuffer("go.mod") // Save to trigger diagnostics.
884884
env.AfterChange(
885-
NoDiagnostics("go.mod"),
885+
NoDiagnostics(ForFile("go.mod")),
886886
)
887887
})
888888
}
@@ -1149,8 +1149,8 @@ func main() {
11491149
)
11501150
env.ApplyQuickFixes("main.go", d.Diagnostics)
11511151
env.Await(
1152-
NoDiagnostics("main.go"),
1153-
NoDiagnostics("go.mod"),
1152+
NoDiagnostics(ForFile("main.go")),
1153+
NoDiagnostics(ForFile("go.mod")),
11541154
)
11551155
})
11561156
}
@@ -1170,7 +1170,7 @@ package main
11701170
env.DiagnosticAtRegexpWithMessage("go.mod", `go foo`, "invalid go version"),
11711171
)
11721172
env.WriteWorkspaceFile("go.mod", "module mod.com \n\ngo 1.12\n")
1173-
env.AfterChange(NoDiagnostics("go.mod"))
1173+
env.AfterChange(NoDiagnostics(ForFile("go.mod")))
11741174
})
11751175
}
11761176

‎gopls/internal/regtest/template/template_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Hello {{}} <-- missing body
9696
}
9797

9898
env.WriteWorkspaceFile("hello.tmpl", "{{range .Planets}}\nHello {{.}}\n{{end}}")
99-
env.AfterChange(NoDiagnostics("hello.tmpl"))
99+
env.AfterChange(NoDiagnostics(ForFile("hello.tmpl")))
100100
})
101101
}
102102

@@ -121,7 +121,7 @@ B {{}} <-- missing body
121121
env.OnceMet(
122122
InitialWorkspaceLoad,
123123
env.DiagnosticAtRegexp("a/a.tmpl", "()A"),
124-
NoDiagnostics("b/b.tmpl"),
124+
NoDiagnostics(ForFile("b/b.tmpl")),
125125
)
126126
})
127127
}
@@ -137,12 +137,12 @@ go 1.12
137137
Run(t, files, func(t *testing.T, env *Env) {
138138
env.CreateBuffer("hello.tmpl", "")
139139
env.AfterChange(
140-
NoDiagnostics("hello.tmpl"), // Don't get spurious errors for empty templates.
140+
NoDiagnostics(ForFile("hello.tmpl")), // Don't get spurious errors for empty templates.
141141
)
142142
env.SetBufferContent("hello.tmpl", "{{range .Planets}}\nHello {{}}\n{{end}}")
143143
env.Await(env.DiagnosticAtRegexp("hello.tmpl", "()Hello {{}}"))
144144
env.RegexpReplace("hello.tmpl", "{{}}", "{{.}}")
145-
env.Await(NoDiagnostics("hello.tmpl"))
145+
env.Await(NoDiagnostics(ForFile("hello.tmpl")))
146146
})
147147
}
148148

@@ -167,7 +167,7 @@ Hello {{}} <-- missing body
167167
// should make its diagnostics disappear.
168168
env.CloseBuffer("hello.tmpl")
169169
env.AfterChange(
170-
NoDiagnostics("hello.tmpl"),
170+
NoDiagnostics(ForFile("hello.tmpl")),
171171
)
172172
})
173173
}

‎gopls/internal/regtest/watch/watch_test.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func _() {
4343
)
4444
env.WriteWorkspaceFile("a/a.go", `package a; func _() {};`)
4545
env.AfterChange(
46-
NoDiagnostics("a/a.go"),
46+
NoDiagnostics(ForFile("a/a.go")),
4747
)
4848
})
4949
})
@@ -137,8 +137,8 @@ func _() {
137137
}`,
138138
})
139139
env.AfterChange(
140-
NoDiagnostics("a/a.go"),
141-
NoDiagnostics("b/b.go"),
140+
NoDiagnostics(ForFile("a/a.go")),
141+
NoDiagnostics(ForFile("b/b.go")),
142142
)
143143
})
144144
}
@@ -204,7 +204,7 @@ func _() {
204204
)
205205
env.WriteWorkspaceFile("c/c.go", `package c; func C() {};`)
206206
env.AfterChange(
207-
NoDiagnostics("a/a.go"),
207+
NoDiagnostics(ForFile("a/a.go")),
208208
)
209209
})
210210
}
@@ -226,7 +226,7 @@ func _() {}
226226
env.WriteWorkspaceFile("c/c.go", `package c; func C() {};`)
227227
env.WriteWorkspaceFile("a/a.go", `package a; import "mod.com/c"; func _() { c.C() }`)
228228
env.AfterChange(
229-
NoDiagnostics("a/a.go"),
229+
NoDiagnostics(ForFile("a/a.go")),
230230
)
231231
})
232232
}
@@ -252,7 +252,7 @@ func _() {
252252
)
253253
env.WriteWorkspaceFile("a/a2.go", `package a; func hello() {};`)
254254
env.AfterChange(
255-
NoDiagnostics("a/a.go"),
255+
NoDiagnostics(ForFile("a/a.go")),
256256
)
257257
})
258258
}
@@ -328,7 +328,7 @@ func _() {
328328
)
329329
env.WriteWorkspaceFile("a/a.go", implementation)
330330
env.AfterChange(
331-
NoDiagnostics("a/a.go"),
331+
NoDiagnostics(ForFile("a/a.go")),
332332
)
333333
})
334334
})
@@ -337,11 +337,11 @@ func _() {
337337
Run(t, pkg, func(t *testing.T, env *Env) {
338338
env.WriteWorkspaceFile("a/a.go", implementation)
339339
env.AfterChange(
340-
NoDiagnostics("a/a.go"),
340+
NoDiagnostics(ForFile("a/a.go")),
341341
)
342342
env.WriteWorkspaceFile("b/b.go", newMethod)
343343
env.AfterChange(
344-
NoDiagnostics("a/a.go"),
344+
NoDiagnostics(ForFile("a/a.go")),
345345
)
346346
})
347347
})
@@ -353,8 +353,8 @@ func _() {
353353
"b/b.go": newMethod,
354354
})
355355
env.AfterChange(
356-
NoDiagnostics("a/a.go"),
357-
NoDiagnostics("b/b.go"),
356+
NoDiagnostics(ForFile("a/a.go")),
357+
NoDiagnostics(ForFile("b/b.go")),
358358
)
359359
})
360360
})
@@ -400,7 +400,7 @@ package a
400400
// a_unneeded.go, from the initial workspace load, which we
401401
// check for earlier. If there are more, there's a bug.
402402
LogMatching(protocol.Info, "a_unneeded.go", 1, false),
403-
NoDiagnostics("a/a.go"),
403+
NoDiagnostics(ForFile("a/a.go")),
404404
)
405405
})
406406
})
@@ -428,7 +428,7 @@ package a
428428
// a_unneeded.go, from the initial workspace load, which we
429429
// check for earlier. If there are more, there's a bug.
430430
LogMatching(protocol.Info, "a_unneeded.go", 1, false),
431-
NoDiagnostics("a/a.go"),
431+
NoDiagnostics(ForFile("a/a.go")),
432432
)
433433
})
434434
})
@@ -470,7 +470,7 @@ func _() {}
470470
env.RemoveWorkspaceFile("a/a1.go")
471471
env.WriteWorkspaceFile("a/a2.go", "package a; func _() {};")
472472
env.AfterChange(
473-
NoDiagnostics("main.go"),
473+
NoDiagnostics(ForFile("main.go")),
474474
)
475475
})
476476
}
@@ -547,7 +547,7 @@ func main() {
547547
})
548548
env.AfterChange(
549549
env.DoneWithChangeWatchedFiles(),
550-
NoDiagnostics("main.go"),
550+
NoDiagnostics(ForFile("main.go")),
551551
)
552552
})
553553
}
@@ -575,7 +575,7 @@ func main() {
575575
).Run(t, files, func(t *testing.T, env *Env) {
576576
env.OpenFile("main.go")
577577
env.AfterChange(
578-
NoDiagnostics("main.go"),
578+
NoDiagnostics(ForFile("main.go")),
579579
)
580580
if err := env.Sandbox.RunGoCommand(env.Ctx, "", "mod", []string{"init", "mod.com"}, true); err != nil {
581581
t.Fatal(err)
@@ -589,7 +589,7 @@ func main() {
589589

590590
env.RegexpReplace("main.go", `"foo/blah"`, `"mod.com/foo/blah"`)
591591
env.AfterChange(
592-
NoDiagnostics("main.go"),
592+
NoDiagnostics(ForFile("main.go")),
593593
)
594594
})
595595
}
@@ -625,7 +625,7 @@ func main() {
625625
)
626626
env.RegexpReplace("foo/main.go", `"mod.com/blah"`, `"foo/blah"`)
627627
env.AfterChange(
628-
NoDiagnostics("foo/main.go"),
628+
NoDiagnostics(ForFile("foo/main.go")),
629629
)
630630
})
631631
}
@@ -669,8 +669,8 @@ func TestAll(t *testing.T) {
669669
`,
670670
})
671671
env.AfterChange(
672-
NoDiagnostics("a/a.go"),
673-
NoDiagnostics("a/a_test.go"),
672+
NoDiagnostics(ForFile("a/a.go")),
673+
NoDiagnostics(ForFile("a/a_test.go")),
674674
)
675675
// Now, add a new file to the test variant and use its symbol in the
676676
// original test file. Expect no diagnostics.
@@ -695,8 +695,8 @@ func TestSomething(t *testing.T) {}
695695
`,
696696
})
697697
env.AfterChange(
698-
NoDiagnostics("a/a_test.go"),
699-
NoDiagnostics("a/a2_test.go"),
698+
NoDiagnostics(ForFile("a/a_test.go")),
699+
NoDiagnostics(ForFile("a/a2_test.go")),
700700
)
701701
})
702702
}

‎gopls/internal/regtest/workspace/broken_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ const F = named.D - 3
166166
env.OpenFile("go.mod")
167167
env.RegexpReplace("go.mod", "mod.testx", "mod.test")
168168
env.SaveBuffer("go.mod") // saving triggers a reload
169-
env.AfterChange(NoMatchingDiagnostics())
169+
env.AfterChange(NoDiagnostics())
170170
})
171171
}
172172

@@ -219,8 +219,8 @@ package b
219219
// workspace folder, therefore we can't invoke AfterChange here.
220220
env.ChangeWorkspaceFolders("a", "b")
221221
env.Await(
222-
NoDiagnostics("a/a.go"),
223-
NoDiagnostics("b/go.mod"),
222+
NoDiagnostics(ForFile("a/a.go")),
223+
NoDiagnostics(ForFile("b/go.mod")),
224224
NoOutstandingWork(),
225225
)
226226

@@ -256,7 +256,7 @@ package b
256256
).Run(t, modules, func(t *testing.T, env *Env) {
257257
env.OpenFile("a/a.go")
258258
env.AfterChange(
259-
NoDiagnostics("a/a.go"),
259+
NoDiagnostics(ForFile("a/a.go")),
260260
NoOutstandingWork(),
261261
)
262262
})

‎gopls/internal/regtest/workspace/directoryfilters_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const _ = Nonexistant
5555
).Run(t, files, func(t *testing.T, env *Env) {
5656
env.OnceMet(
5757
InitialWorkspaceLoad,
58-
NoDiagnostics("exclude/x.go"),
58+
NoDiagnostics(ForFile("exclude/x.go")),
5959
)
6060
})
6161
}
@@ -85,8 +85,8 @@ const X = 1
8585
).Run(t, files, func(t *testing.T, env *Env) {
8686
env.OnceMet(
8787
InitialWorkspaceLoad,
88-
NoDiagnostics("exclude/exclude.go"), // filtered out
89-
NoDiagnostics("include/include.go"), // successfully builds
88+
NoDiagnostics(ForFile("exclude/exclude.go")), // filtered out
89+
NoDiagnostics(ForFile("include/include.go")), // successfully builds
9090
)
9191
})
9292
}

‎gopls/internal/regtest/workspace/metadata_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const C = 42
3434
env.OpenFile("p.go")
3535
env.RegexpReplace("p.go", "\"fmt\"", "\"fmt\"\n)")
3636
env.AfterChange(
37-
NoDiagnostics("p.go"),
37+
NoDiagnostics(ForFile("p.go")),
3838
)
3939
})
4040
}
@@ -88,8 +88,8 @@ func main() {}
8888
// information when fresh metadata arrives.
8989
// env.RegexpReplace("foo.go", "package main", "package main // test")
9090
env.AfterChange(
91-
NoDiagnostics("foo.go"),
92-
NoDiagnostics("bar.go"),
91+
NoDiagnostics(ForFile("foo.go")),
92+
NoDiagnostics(ForFile("bar.go")),
9393
)
9494

9595
// If instead of 'ignore' (which gopls treats as a standalone package) we

‎gopls/internal/regtest/workspace/standalone_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ func main() {
7474
}
7575

7676
env.OpenFile("lib/lib.go")
77-
env.AfterChange(NoMatchingDiagnostics())
77+
env.AfterChange(NoDiagnostics())
7878

7979
// Replacing C with D should not cause any workspace diagnostics, since we
8080
// haven't yet opened the standalone file.
8181
env.RegexpReplace("lib/lib.go", "C", "D")
82-
env.AfterChange(NoMatchingDiagnostics())
82+
env.AfterChange(NoDiagnostics())
8383
env.RegexpReplace("lib/lib.go", "D", "C")
84-
env.AfterChange(NoMatchingDiagnostics())
84+
env.AfterChange(NoDiagnostics())
8585

8686
refs := env.References("lib/lib.go", env.RegexpSearch("lib/lib.go", "C"))
8787
checkLocations("References", refs, "lib/lib.go")
@@ -91,7 +91,7 @@ func main() {
9191

9292
// Opening the standalone file should not result in any diagnostics.
9393
env.OpenFile("lib/ignore.go")
94-
env.AfterChange(NoMatchingDiagnostics())
94+
env.AfterChange(NoDiagnostics())
9595

9696
// Having opened the standalone file, we should find its symbols in the
9797
// workspace.
@@ -135,7 +135,7 @@ func main() {
135135

136136
// Undoing the replacement should fix diagnostics
137137
env.RegexpReplace("lib/lib.go", "D", "C")
138-
env.AfterChange(NoMatchingDiagnostics())
138+
env.AfterChange(NoDiagnostics())
139139

140140
// Now that our workspace has no errors, we should be able to find
141141
// references and rename.
@@ -187,7 +187,7 @@ func main() {}
187187

188188
env.AfterChange(
189189
env.DiagnosticAtRegexp("ignore.go", "package (main)"),
190-
NoDiagnostics("standalone.go"),
190+
NoDiagnostics(ForFile("standalone.go")),
191191
)
192192

193193
cfg := env.Editor.Config()
@@ -201,7 +201,7 @@ func main() {}
201201
env.RegexpReplace("ignore.go", "arbitrary", "meaningless")
202202

203203
env.AfterChange(
204-
NoDiagnostics("ignore.go"),
204+
NoDiagnostics(ForFile("ignore.go")),
205205
env.DiagnosticAtRegexp("standalone.go", "package (main)"),
206206
)
207207
})

‎gopls/internal/regtest/workspace/workspace_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func TestClearAnalysisDiagnostics(t *testing.T) {
156156
)
157157
env.CloseBuffer("pkg/main.go")
158158
env.AfterChange(
159-
NoDiagnostics("pkg/main2.go"),
159+
NoDiagnostics(ForFile("pkg/main2.go")),
160160
)
161161
})
162162
}
@@ -269,7 +269,7 @@ func Hello() int {
269269
env.AfterChange(
270270
env.DiagnosticAtRegexp("moda/a/a.go", "x"),
271271
env.DiagnosticAtRegexp("modb/b/b.go", "x"),
272-
NoMatchingDiagnostics(env.AtRegexp("moda/a/a.go", `"b.com/b"`)),
272+
NoDiagnostics(env.AtRegexp("moda/a/a.go", `"b.com/b"`)),
273273
)
274274
})
275275
}
@@ -643,7 +643,7 @@ use (
643643

644644
// This fails if guarded with a OnceMet(DoneWithSave(), ...), because it is
645645
// debounced (and therefore not synchronous with the change).
646-
env.Await(NoDiagnostics("modb/go.mod"))
646+
env.Await(NoDiagnostics(ForFile("modb/go.mod")))
647647

648648
// Test Formatting.
649649
env.SetBufferContent("go.work", `go 1.18
@@ -693,7 +693,7 @@ module example.com/bar
693693
// the diagnostic still shows up.
694694
env.SetBufferContent("go.work", "go 1.18 \n\n use ./bar\n")
695695
env.AfterChange(
696-
NoMatchingDiagnostics(env.AtRegexp("go.work", "use")),
696+
NoDiagnostics(env.AtRegexp("go.work", "use")),
697697
)
698698
env.SetBufferContent("go.work", "go 1.18 \n\n use ./foo\n")
699699
env.AfterChange(
@@ -978,7 +978,7 @@ func main() {
978978
env.ApplyQuickFixes("b/go.mod", []protocol.Diagnostic{d})
979979
}
980980
env.AfterChange(
981-
NoDiagnostics("b/go.mod"),
981+
NoDiagnostics(ForFile("b/go.mod")),
982982
)
983983
})
984984
}
@@ -1051,7 +1051,7 @@ func main() {}
10511051
// Since b/main.go is not in the workspace, it should have a warning on its
10521052
// package declaration.
10531053
env.AfterChange(
1054-
NoDiagnostics("main.go"),
1054+
NoDiagnostics(ForFile("main.go")),
10551055
DiagnosticAt("b/main.go", 0, 0),
10561056
)
10571057
env.WriteWorkspaceFile("go.work", `go 1.16
@@ -1061,7 +1061,7 @@ use (
10611061
b
10621062
)
10631063
`)
1064-
env.AfterChange(NoMatchingDiagnostics())
1064+
env.AfterChange(NoDiagnostics())
10651065
// Removing the go.work file should put us back where we started.
10661066
env.RemoveWorkspaceFile("go.work")
10671067

@@ -1077,7 +1077,7 @@ use (
10771077
env.OpenFile("b/main.go")
10781078

10791079
env.AfterChange(
1080-
NoDiagnostics("main.go"),
1080+
NoDiagnostics(ForFile("main.go")),
10811081
DiagnosticAt("b/main.go", 0, 0),
10821082
)
10831083
})
@@ -1119,8 +1119,8 @@ func (Server) Foo() {}
11191119
)
11201120
env.RegexpReplace("other_test.go", "main", "main_test")
11211121
env.AfterChange(
1122-
NoDiagnostics("other_test.go"),
1123-
NoDiagnostics("main_test.go"),
1122+
NoDiagnostics(ForFile("other_test.go")),
1123+
NoDiagnostics(ForFile("main_test.go")),
11241124
)
11251125

11261126
// This will cause a test failure if other_test.go is not in any package.
@@ -1163,7 +1163,7 @@ import (
11631163
Run(t, ws, func(t *testing.T, env *Env) {
11641164
env.OpenFile("b/main.go")
11651165
env.AfterChange(
1166-
NoDiagnostics("a/main.go"),
1166+
NoDiagnostics(ForFile("a/main.go")),
11671167
)
11681168
env.OpenFile("a/main.go")
11691169
env.AfterChange(
@@ -1178,7 +1178,7 @@ import (
11781178
// Gopls should be smart enough to avoid diagnosing a.
11791179
env.RegexpReplace("b/main.go", "package b", "package b // a package")
11801180
env.AfterChange(
1181-
NoDiagnostics("a/main.go"),
1181+
NoDiagnostics(ForFile("a/main.go")),
11821182
)
11831183
})
11841184
}

0 commit comments

Comments
 (0)
Please sign in to comment.