Skip to content

Commit eb7c562

Browse files
committed
internal/lsp: remove unknown dependency from highlight tests
The highlight tests imported golang.org/x/tools/internal/lsp/protocol package, which doesn't exist when the testdata is set up in the test harness. This causes gopls to try to reload the metadata for the package. I'm not sure why this wasn't an issue before, since we should re-run go/packages.Load every time we have missing dependencies. Fixes golang/go#37365 Change-Id: I8ebcbbf78b7e6fcdac9ab83bef3f5a0c9a50a361 Reviewed-on: https://go-review.googlesource.com/c/tools/+/221107 Run-TryBot: Rebecca Stambler <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Rohan Challa <[email protected]> Reviewed-by: Robert Findley <[email protected]>
1 parent 26f6a1b commit eb7c562

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

internal/lsp/testdata/lsp/primarymod/highlights/highlights.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
44
"fmt" //@mark(fmtImp, "\"fmt\""),highlight(fmtImp, fmtImp, fmt1, fmt2, fmt3, fmt4)
55
h2 "net/http" //@mark(hImp, "h2"),highlight(hImp, hImp, hUse)
66
"sort"
7-
8-
"golang.org/x/tools/internal/lsp/protocol"
97
)
108

119
type F struct{ bar int } //@mark(barDeclaration, "bar"),highlight(barDeclaration, barDeclaration, bar1, bar2, bar3)
@@ -35,12 +33,10 @@ func testFunctions() {
3533
Print() //@mark(printTest, "Print"),highlight(printTest, printFunc, printTest)
3634
}
3735

38-
func toProtocolHighlight(rngs []protocol.Range) []protocol.DocumentHighlight { //@mark(doc1, "DocumentHighlight"),mark(docRet1, "[]protocol.DocumentHighlight"),highlight(doc1, docRet1, doc1, doc2, doc3, result)
39-
result := make([]protocol.DocumentHighlight, 0, len(rngs)) //@mark(doc2, "DocumentHighlight"),highlight(doc2, doc1, doc2, doc3)
40-
kind := protocol.Text
36+
func toProtocolHighlight(rngs []int) []DocumentHighlight { //@mark(doc1, "DocumentHighlight"),mark(docRet1, "[]DocumentHighlight"),highlight(doc1, docRet1, doc1, doc2, doc3, result)
37+
result := make([]DocumentHighlight, 0, len(rngs)) //@mark(doc2, "DocumentHighlight"),highlight(doc2, doc1, doc2, doc3)
4138
for _, rng := range rngs {
42-
result = append(result, protocol.DocumentHighlight{ //@mark(doc3, "DocumentHighlight"),highlight(doc3, doc1, doc2, doc3)
43-
Kind: kind,
39+
result = append(result, DocumentHighlight{ //@mark(doc3, "DocumentHighlight"),highlight(doc3, doc1, doc2, doc3)
4440
Range: rng,
4541
})
4642
}

0 commit comments

Comments
 (0)