Skip to content

Commit 68cbf41

Browse files
committed
internal/lsp/template: add missed hover cases
Templates were reporting 'oops' when hovering over a string. Fixes: golang/go#50031 Change-Id: I9e256b1f7d193bf090590c1ec71e85fc8493d7f7 Reviewed-on: https://go-review.googlesource.com/c/tools/+/369956 Run-TryBot: Peter Weinberger <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Trust: Peter Weinberger <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
1 parent d3358c1 commit 68cbf41

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/lsp/template/implementations.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ func Hover(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle,
118118
ans.Contents.Value = fmt.Sprintf("template %s\n(add definition)", sym.name)
119119
case protocol.Namespace:
120120
ans.Contents.Value = fmt.Sprintf("template %s defined", sym.name)
121+
case protocol.Number:
122+
ans.Contents.Value = "number"
123+
case protocol.String:
124+
ans.Contents.Value = "string"
125+
case protocol.Boolean:
126+
ans.Contents.Value = "boolean"
121127
default:
122128
ans.Contents.Value = fmt.Sprintf("oops, sym=%#v", sym)
123129
}

0 commit comments

Comments
 (0)