gocode panicked
osleg opened this issue · 7 comments
With autocomplete on there are some (rare) cases where I get gocode panicked. Use :messages / see above for error details
This happens in 2 cases:
- If the package referred is not imported yet like above, eg
package main
type A struct {
sync.Mutex
i int
}
func main() {
a := A{}
a.M // Gocode panic occurs
}
- When running vim/go under non unix GOOS, eg
$ GOOS=windows vim
And then this code
package main
import "sync"
type A struct {
sync.Mutex
i int
}
func main() {
a := A{}
a.M // Gocode panic occurs
}
I cannot reproduce the both problems with https://github.com/mdempsky/gocode.
And it is not deoplete-go's issue.
I'm using the latest gocode from the same repository above.
And I feel like it does deoplete issue since running gocode directly on the file does provide results:
Without GOOS:
$ gocode -f json --in main.go autocomplete 96
[0,[{"class":"func","package":"","name":"main","type":"func()"},{"class":"package","package":"","name":"sync","type":""},{"class":"type","package":"","name":"A","type":"struct"},{"class":"var","package":"","name":"a","type":"A"}]]
With GOOS:
$ GOOS=windows gocode -f json --in main.go autocomplete 96
[1,[{"class":"type","package":"sync","name":"Map","type":"struct"},{"class":"type","package":"sync","name":"Mutex","type":"struct"}]]
Offset 96 is right after the .
on line 12 a.M|
where |
is cursor position
Hence gocode doesn't actually panicking when trying to parse the data whether with GOOS or without.
If so, why I don't reproduce the problem?
Please upload the minimal init.vim to reproduce it.
And deoplete-go is open source project. You can research the problem.
Hm... I removed deoplete and then installed it again and it works 🤔 probably was something wrong with my install
Oh... I see. I think gocode close
is needed.