Closed suhas-bn-1412 closed 3 years ago
you get can get the version of gopls
with gopls version
or by using :GoReportGitHubIssue
in Vim and copying it from the information populated for you.
:GoReportGithubIssue won't work as I'm using vim inside ssh session. 'gopls version' didn't work in terminal(-bash: gopls: command not found) or vim(E492: Not an editor command: gopls version)
gopls
may be in your $GOPATH/bin
or $GOBIN
directories; it sounds like neither is in your $PATH
, so try:
$GOBIN/gopls version
and $GOPATH/bin/gopls version
.
gopls version: golang.org/x/tools/gopls v0.6.11 golang.org/x/tools/gopls@v0.6.11 h1:7S2k0xuVYc3secjy2uz0n+fGYxGJU6gXsLOmQ/r1HoI=
The strange thing here is that job doesn't do much. You can even see in your profile that the time executing code in that file was very small; it's the total duration that took a long time.
Can you add let g:go_debug=['shell-commands']
to your vimrc and duplicate this? I'm curious exactly which command is being executed when you see this delay.
Have you tried using top
or other tools to see what's running on your system?
After adding let g:go_debug=['shell-commands']
, I see these are the shell commands that are being run
vim-go: shell command: 'go' 'env' 'GOBIN'
I suspect there's more than that. You can execute :messages
to see them all.
As I mentioned before, I don't think this is vim-go that's the problem. Running using top
to see what's taking a while may be helpful for you, too.
vim-go: shell command: 'go' 'env' 'GOBIN'
vim-go: shell command: 'go' 'env' 'GOPATH'
vim-go: job command: ['/home/snataraj/go/bin/gopls', '-remote=auto']
vim-go: shell command: '/usr/local/fw-tools/Linux/bin/go' 'env' 'GOMOD'
vim-go: shell command: '/usr/local/fw-tools/Linux/bin/go' 'env' 'GOMOD'
vim-go: initializing gopls
vim-go: initialized gopls
This is the complete output of ":messages"
Thank you
The good news is that I don't see anything unexpected here. The bad news for you is that I don't see anything that points to a problem in vim-go itself. As I mentioned previously, the original startup profile output shows that the time spent in job.vim
is minimal.
The only things I've been able to think of are to:
:GoUpdateBinaries
afterwards!).:profile start profile.log
:profile func *
:profile file *
" At this point do slow actions (e.g. open a go file).
:profile pause
:noautocmd qall!
closed for lack of feedback.
This is happening for me as well, though I don't see anything off in this profile I don't think?
https://gist.github.com/keyboard-clacker/919ddd0a078673abcfec8480aa20c104
EDIT:
I actually just tried uninstalling my go lsp, looks like it was conflicting with vim-go. Uninstalling my other LSP solved my specific problem.
I'm having the same issue
What did you do? (required: The issue will be closed when not provided)
I installed vim-go plugin and tried to open .go files and it takes a lot of time. Upon inspection, I noticed that sourcing some files related to vim-go plugin is consuming most of the time
As you can see the time difference between line 111 and 112, sourcing path.vim (or job.vim I don't exactly know how logs are printed) takes a lot of time
What did you expect to happen?
I expected that the file would open immediately
What happened instead?
It takes more time to open the file
Configuration (MUST fill this out):
vim-go version: latest
vimrc
you used to reproduce:vimrc
```vim " install vim-plug if empty(glob('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim autocmd VimEnter * PlugInstall --sync | source ~/.vimrc endif "------------------------------------------------------------------------------ " Plug installed plugins call plug#begin('~/.vim/plugged') " Golang syntax highlighting, auto completions Plug 'fatih/vim-go' " NERDtree for file browsing Plug 'preservim/nerdtree' " Botton line (vim status bar) Plug 'itchyny/lightline.vim' " Color scheme Plug 'gryf/wombat256grf' call plug#end() "------------------------------------------------------------------------------ " Turn on syntax highlighting syntax on " Backapce should work over everything set backspace=indent,eol,start " Show line numbers set number " tab uses this many spaces set tabstop=8 " Status bar set laststatus=2 " Last line set showmode set showcmd " colorscheme colorscheme wombat256grf " Any vertical splits to happen on right set splitright " Any horizontal splits to happen at bottom set splitbelow "------------------------------------------------------------------------------ " NERDtree nnoremapVim version (first three lines from
:version
): VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar 8 2021 09:58:42)Go version (
go version
): go version go1.13.7 linux/amd64Go environment
go env
Output:gopls version
gopls version
Output:(PS: specify how to check gopls version, I'll paste the output)