liteide Can not auto completion
Please answer these questions before submitting your issue. Thanks! Please download LiteIDE latest version and test before submitting your issue. Thanks!
What version of LiteIDE are you using (LiteIDE About - Version and Build Qt Version)?
liteide36.3 qt5.7.1
What version of Go are you using (go version)?
go1.14.2
What operating system and processor architecture are you using(go env)?
linux amd64
What did you do?
If possible, provide a recipe for reproducing the error.
import (
"fmt"
)
type BasePlayer struct {
Gold int
}
type Player struct {
BasePlayer
}
type Room struct {
players [5]*Player
}
func main() {
var room = &Room{}
for _, p := range room.players {
if p != nil && p.Gold > 0 {
fmt.Println("hello")
}
if p != nil && p
}
}
code above, if you press "." after p, the "Gold" should appear by auto completion but nothing happend
What did you expect to see?
have auto completion for the code I give
What did you see instead?
no auto completion for the code I give
问题已修复,更新 gocode 即可。 https://github.com/visualfc/gocode/commit/40ca1c8bbafe4b288771c2f4f74059fa4cca648a 原因在于对于一个未完成的 Block 中,在 Go1.13 中 Rbrace 值为 block.End()-1 ,而在 Go1.14 中 Rbrace 值为 0, 所以在 Go1.14 中识别出错,之前做一个修复但不完全,这次重新修复。
go get -u github.com/visualfc/gotools go get -u github.com/visualfc/gocode
Windows/Linux: copy GOPATH/bin gotools and gocode to liteide/bin MacOS: copy GOPATH/bin gotools and gocode to LiteIDE.app/Contents/MacOS
更新 gocode 就好了