govim: cmd/govim: goimports fails in github.com/eliasnaur/gophercon-uk-2019-talk

What version of Vim/Gvim are you using?

Vim/Gvim version
$ vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Aug 22 2019 04:01:19)
macOS version
Included patches: 1-1900
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             -mouse_sysmouse    -tag_any_white
+arabic            +file_in_path      +mouse_urxvt       -tcl
+autocmd           +find_in_path      +mouse_xterm       +termguicolors
+autochdir         +float             +multi_byte        +terminal
-autoservername    +folding           +multi_lang        +terminfo
-balloon_eval      -footer            -mzscheme          +termresponse
+balloon_eval_term +fork()            +netbeans_intg     +textobjects
-browse            +gettext           +num64             +textprop
++builtin_terms    -hangul_input      +packages          +timers
+byte_offset       +iconv             +path_extra        +title
+channel           +insert_expand     +perl              -toolbar
+cindent           +job               +persistent_undo   +user_commands
-clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +virtualedit
+cmdline_hist      +langmap           -python            +visual
+cmdline_info      +libcall           +python3           +visualextra
+comments          +linebreak         +quickfix          +viminfo
+conceal           +lispindent        +reltime           +vreplace
+cryptv            +listcmds          +rightleft         +wildignore
+cscope            +localmap          +ruby              +wildmenu
+cursorbind        +lua               +scrollbind        +windows
+cursorshape       +menu              +signs             +writebackup
+dialog_con        +mksession         +smartindent       -X11
+diff              +modify_fname      -sound             -xfontset
+digraphs          +mouse             +spell             -xim
-dnd               -mouseshape        +startuptime       -xpm
-ebcdic            +mouse_dec         +statusline        -xsmp
+emacs_tags        -mouse_gpm         -sun_workshop      -xterm_clipboard
+eval              -mouse_jsbterm     +syntax            -xterm_save
+ex_extra          +mouse_netterm     +tag_binary
+extra_search      +mouse_sgr         -tag_old_static
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -lintl -framework AppKit  -L/usr/local/opt/lua/lib -llua5.3 -mmacosx-version-min=10.14 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.30.0/lib/perl5/5.30.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m -framework CoreFoundation  -lruby.2.6

What version of Go are you using (go version)?

$ go version
go version devel +0212f0410f Thu Aug 15 17:49:11 2019 +0000 darwin/amd64

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/var/folders/_7/lnt35k555hl2bs7fjygkhgx00000gp/T/tmp.6dcyONcR/Library/Caches/go-build"
GOENV="/var/folders/_7/lnt35k555hl2bs7fjygkhgx00000gp/T/tmp.6dcyONcR/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/var/folders/_7/lnt35k555hl2bs7fjygkhgx00000gp/T/tmp.6dcyONcR/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/elias/go-tip"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/elias/go-tip/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/var/folders/_7/lnt35k555hl2bs7fjygkhgx00000gp/T/tmp.6dcyONcR/gophercon-uk-2019-talk/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/_7/lnt35k555hl2bs7fjygkhgx00000gp/T/go-build043891830=/tmp/go-build -gno-record-gcc-switches -fno-common"

What version/commit of govim are you using?

Git commit b6bbbaec1c8457db55c5f7e26d3030fe5c118d13.

What is the output of :messages in Vim?

Messages maintainer: Bram Moolenaar <Bram@vim.org>

Do the Vim channel, govim or gopls log files show anything interesting?

@myitcv kindly debugged the issue with me and found nothing interesting in the logs.

What did you do?

$ cd $(mktemp -d)
$ export HOME=$PWD
$ git clone https://github.com/myitcv/govim.git ~/.vim/pack/plugins/start/govim
Cloning into '/var/folders/_7/lnt35k555hl2bs7fjygkhgx00000gp/T/tmp.6dcyONcR/.vim/pack/plugins/start/govim'...

...

$ git clone https://github.com/eliasnaur/gophercon-uk-2019-talk.git

...

$ cd gophercon-uk-2019-talk
$ cd demo/
$
$ vi main.go
Installing govim and gopls

I then deleted the import "gioui.org/ui/layout" line and issued :w to save the file.

What did you expect to see?

The import line re-added by govim.

What did you see instead?

No change.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

Because https://go-review.googlesource.com/c/tools/+/192719 is listed in https://github.com/govim/govim/commit/6961210ff30a5862594ff04dde9f3a5f62120ae4, I assume this is fixed with v0.0.23. Thank you for working on this!

Got somehow nerd-sniped into this as well on my way home from work. I managed to reproduce it using Paul’s steps (except for the wait for “things to settle”) on the subway a few times, but as soon as I got home the error disappeared.

Haven’t had time to dive deeper, but I realised that the connection was pretty bad on my way home, and during this “things to settle” wait, there were a few network requests to gioui.org.

Could it be related to gopls being interrupted by a save during some init phase that takes longer time on slow connections? And then doesn’t recover fully.

I had to try running it at home again but manually blocking the network requests for a few seconds, then I’m able to reproduce it again.