internal/lsp: add type to placeholders in completion parameters

Fixes golang/go#31547

Change-Id: Ib6e54ae17c778421a49f34d3c60d56b126419a91
Reviewed-on: https://go-review.googlesource.com/c/tools/+/172666
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
This commit is contained in:
Rebecca Stambler 2019-04-18 16:40:24 -04:00
parent f939817187
commit c39e7748f6

View File

@ -155,8 +155,7 @@ func labelToInsertText(label string, kind source.CompletionItemKind, insertTextF
if i != 0 { if i != 0 {
b.WriteString(", ") b.WriteString(", ")
} }
p = strings.Split(strings.Trim(p, " "), " ")[0] fmt.Fprintf(b, "${%v:%v}", i+1, r.Replace(strings.TrimSpace(p)))
fmt.Fprintf(b, "${%v:%v}", i+1, r.Replace(p))
} }
b.WriteByte(')') b.WriteByte(')')
return b.String() return b.String()