mirror of
https://github.com/golang/go
synced 2024-11-18 11:24:41 -07:00
internal/lsp/cache: don't skip x_tests
We were marking normal tests as workspace packages, but pruning x_tests. Don't do that. Fixes golang/go#39578. Change-Id: Ia8eceea38e63ac17e40f50d6837de9c7a668469b Reviewed-on: https://go-review.googlesource.com/c/tools/+/237943 Run-TryBot: Heschi Kreinick <heschi@google.com> Reviewed-by: zikaeroh <zikaeroh@gmail.com> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
parent
1725ffee6d
commit
a2fa627c4b
10
internal/lsp/cache/load.go
vendored
10
internal/lsp/cache/load.go
vendored
@ -222,13 +222,13 @@ func (s *snapshot) setMetadata(ctx context.Context, pkgPath packagePath, pkg *pa
|
||||
continue
|
||||
}
|
||||
|
||||
switch m.forTest {
|
||||
case "":
|
||||
switch {
|
||||
case m.forTest == "":
|
||||
// A normal package.
|
||||
s.workspacePackages[m.id] = pkgPath
|
||||
case m.pkgPath:
|
||||
// The test variant of some workspace package. To load it, we need to
|
||||
// load the non-test variant with -test.
|
||||
case m.forTest == m.pkgPath, m.forTest+"_test" == m.pkgPath:
|
||||
// The test variant of some workspace package or its x_test.
|
||||
// To load it, we need to load the non-test variant with -test.
|
||||
s.workspacePackages[m.id] = m.forTest
|
||||
default:
|
||||
// A test variant of some intermediate package. We don't care about it.
|
||||
|
@ -5,4 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func TestA2(t *testing.T) { //@TestA2,godef(TestA2, TestA2)
|
||||
Nonexistant() //@diag("Nonexistant", "compiler", "undeclared name: Nonexistant", "error")
|
||||
}
|
||||
|
2
internal/lsp/testdata/lsp/summary.txt.golden
vendored
2
internal/lsp/testdata/lsp/summary.txt.golden
vendored
@ -7,7 +7,7 @@ DeepCompletionsCount = 5
|
||||
FuzzyCompletionsCount = 8
|
||||
RankedCompletionsCount = 120
|
||||
CaseSensitiveCompletionsCount = 4
|
||||
DiagnosticsCount = 43
|
||||
DiagnosticsCount = 44
|
||||
FoldingRangesCount = 2
|
||||
FormatCount = 6
|
||||
ImportCount = 8
|
||||
|
Loading…
Reference in New Issue
Block a user