DisposaBoy / GoSublime

A Golang plugin collection for SublimeText 3, providing code completion and other IDE-like features.
MIT License
3.42k stars 302 forks source link

plugin_host regularly crashing, apparently caused by GoVet #895

Closed xanderflood closed 5 years ago

xanderflood commented 5 years ago

I'm running Sublime Text Build 3176 on OSX Sierra with GoSublime commit 9be2a67d5dec0bc85736b44b1e09b79d3779aa05 (apparently v18.11.28).

The unexpected behavior is that intermittently if I have enabled govet on save in my margo.go, I'll receive a dialog on save telling me that the plugin_host has crashed and that sublime text needs to be restarted.

This behavior is a little slippery and I've been unable to build a minimal example. It starts happening a few times a week one particular file or another, and will sometimes disappear if I copy the exact contents of that file into a new one, so it's hard to say what exactly is causing it. However, in all instances, the behavior has been consistently reproducible on the file where it started appearing, and in all cases the behavior has stopped as soon as I disabled GoVet on save in my margo.go, so I think it's save to assume that GoVet failures are the problem. It seems to be frequently associated with unresolved names (it's happened a few times when I add a new field to a struct, expecting GoImports to resolve the type name, but I've misspelled the type name or package so that it doesn't get resolved).

There's no output in the Sublime logs from GoSublime, only a line stating matter-of-factly that the plugin_host has crashed. When I have a little more free time I'll happily dive into the source and see if I can find an unreported panic or something like that.

Workaround: disable GoVet in margo.go

DisposaBoy commented 5 years ago

You're most likely experiencing this issue https://github.com/SublimeTextIssues/Core/issues/2327#issuecomment-425767504 which should be fixed in the dev version of Sublime Text.