bingo icon indicating copy to clipboard operation
bingo copied to clipboard

"Invalid type" hint for Go built-ins

Open inliquid opened this issue 6 years ago • 1 comments

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

inliquid avatar Mar 09 '19 13:03 inliquid

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.

mbana avatar Mar 15 '19 17:03 mbana