Closed drunkenplatypus closed 4 months ago
What version of gopls are you using?
Can you give a try to v0.15.0 prerelease? When the types can be inferred, v0.15.0-pre.3 omits type param.
Indeed: gopls@v0.15.0 indends to fix this:
go install golang.org/x/tools/gopls@v0.15.0-pre.3
Yeah installing that version of gopls fixed it for me, thanks both!
I find it annoying when you use IntelliSense to autocomplete a generic function and are left with e.g.
slices.Contains[]()
with your cursor between the square brackets.In a lot of cases providing an explicit type isn't required, and it can be inferred from the provided argument e.g.
slices.Contains([]string{}, "foo")
It would be nice if this behaviour was configurable so that generic functions behaved like any other function.