Skip to content

Commit 3e9ce40

Browse files
committed
gopls/internal/test/integration/template: add test for golang/go#74635
This CL adds a regression test (currently skipped) for the crash in the associated issue. The fix will come in the following CL. Updates golang/go#74635 Change-Id: If6988909e17c6c5a3bde3511f7205c2fc30cf034 Reviewed-on: https://go-review.googlesource.com/c/tools/+/688936 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Robert Findley <[email protected]>
1 parent 4388b61 commit 3e9ce40

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

gopls/internal/test/integration/template/template_test.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,36 @@ go 1.17
5252
})
5353
}
5454

55+
func TestMultilineTokensAgain(t *testing.T) {
56+
t.Skip("skipping due to go.dev/issue/74635")
57+
58+
const files = `
59+
-- go.mod --
60+
module mod.com
61+
62+
go 1.17
63+
-- hi.tmpl --
64+
{{/* this is
65+
a comment */}}
66+
`
67+
WithOptions(
68+
Settings{
69+
"templateExtensions": []string{"tmpl"},
70+
"semanticTokens": true,
71+
},
72+
).Run(t, files, func(t *testing.T, env *Env) {
73+
var p protocol.SemanticTokensParams
74+
p.TextDocument.URI = env.Sandbox.Workdir.URI("hi.tmpl")
75+
toks, err := env.Editor.Server.SemanticTokensFull(env.Ctx, &p)
76+
if err != nil {
77+
t.Errorf("semantic token failed: %v", err)
78+
}
79+
if toks == nil || len(toks.Data) == 0 {
80+
t.Errorf("got no semantic tokens")
81+
}
82+
})
83+
}
84+
5585
func TestTemplatesFromExtensions(t *testing.T) {
5686
const files = `
5787
-- go.mod --

0 commit comments

Comments
 (0)