Currently vim-go is blocking the UI whilst gopls is loading. Although I understand that gopls is essential for this plugin to function well, I think that the user should not have to wait for the server to start before they can start editing. This was not happening before gopls support and I think that this is a regression from the previous user experience.
Would it be possible to disable gopls with a configuration switch or make it non blocking? I know that there is already #2250, but I thought that creating a new issue better in this case we have a performance degradation.
Open a a go file in a large repository.
I can edit the file immediately.
gopls is being loaded for about a second and the UI is unresponsive.
Default vim-go configuration.
Latest master.
vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):set nocompatible
scriptencoding utf-8
let s:data_dir = $HOME . '/.local/share/nvim'
call plug#begin(s:data_dir . '/plugged')
Plug 'fatih/vim-go'
call plug#end()
:version):$ nvim --version
NVIM v0.4.0-dev
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshado
w -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/tmp
/neovim-20190712-1828-h164ff/build/config -I/tmp/neovim-20190712-1828-h164ff/src -I/usr/local/include -I/tmp/neovim-20190712-1828-h164ff/deps-build/include -I/usr/local/opt/gettext/include -I/Library/Developer/CommandLine
Tools/SDKs/MacOSX10.14.sdk/usr/include -I/tmp/neovim-20190712-1828-h164ff/build/src/nvim/auto -I/tmp/neovim-20190712-1828-h164ff/build/include
Compiled by aignas@aignas-C02WT100HV2T
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/Cellar/neovim/HEAD-6eab3b9/share/nvim"
Run :checkhealth for more info
go version):go version go1.12.6 darwin/amd64
I use vim-go in a large repository daily without blocking behavior when opening a Go file. To the best of my knowledge, the delay caused by using gopls in a large repo has been resolved since https://github.com/fatih/vim-go/pull/2371/files. It's curious that you're still seeing a delay 馃
I can confirm this: it takes 1-2 seconds to initialize gopls with latest vim-go.
The initialization blocks the UI thread, which makes this painful every time I open a *.go file.
I can confirm this: it takes 1-2 seconds to initialize gopls with latest vim-go.
@motiejus are you using the latest commit on master or are you using the latest release of vim-go?
I can confirm this: it takes 1-2 seconds to initialize gopls with latest vim-go.
@motiejus are you using the latest commit on master or are you using the latest release of vim-go?
I dove a little deeper. Turns out, in my environment, go is pointing to a shell script which does some environment checks, which, with new vim-go (or perhaps with gopls) gets triggered, which did not happen before.
I will dig into this more internally, but I am taking back my comment.
Thanks for confirming. I'm going to close this again, but please feel free to open a new issue if your analysis leads you to think this is a problem with vim-go again.
It happens for me if I use vim to open a file under a large repo when I enter .. Then it will stuck forever saying initialized gopls
@XavierCheng1996
I encountered the same behavior you described: "stuck forever saying initialized gopls". My installation of vim-go is configured to run in a docker container. Linux find couldn't locate gopls in it. Installing gopls to the container using these instructions resolved the issue.
Most helpful comment
It happens for me if I use vim to open a file under a large repo when I enter
.. Then it will stuck forever sayinginitialized gopls