saibing / bingo

Bingo is a Go language server that speaks Language Server Protocol.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Invalid type" hint for Go built-ins

inliquid opened this issue · comments

This is shown for cap, len, and copy built-ins.
изображение

The problem is because is the call s = types.ObjectString(o, qf) is assigning s the value "func len(v Type) invalid type" in this line https://github.com/saibing/bingo/blob/master/langserver/hover.go#L151

You argue that you won't fix this because there is nothing we can do with types.ObjectString (in package go/types) returning invalid type but maybe we could do better...

We could do something similar to https://github.com/saibing/bingo/blob/master/langserver/definition.go#L122 because jumping to the definition of len works, i.e., I get taken to the defintion of len in /usr/local/go/src/builtin/builtin.go.