Vim-go: How to "initialize gopls" for vim-go?

Created on 21 Jun 2019  路  7Comments  路  Source: fatih/vim-go

What did you do? (required: The issue will be closed when not provided)

Tried to configure vim-go for gopls, tried to install gopls, then opened a go file in a go-modules-style repo. Got vim-go: initialize gopls message, so I assume I'm doing it wrong somehow.

When I run :GoInstallBinaries, I see:

vim-go: Updating gopls. Reinstalling golang.org/x/tools/cmd/gopls to folder /Users/johnrefior/home/go/bin/

According to gopls wiki, installation of gopls is:

install gopls by running go get -u golang.org/x/tools/cmd/gopls

I did that.

I wouldn't be surprised if this is my issue and I just haven't learned how to set up gopls yet, or am doing something wrong with vim-go configuration, just looking for some assistance / direction-pointing if available.

What did you expect to happen?

Expected the file to open without error/warning.

What happened instead?

Got message vim-go: initialize gopls.

I appreciate the warning, I'm just trying to figure out how to satisfy the condition that prevents it.

Configuration (MUST fill this out):

vim-go version:

Current master as of June 21, 10am EDT:

cd ~/.vim/bundle/vim-go
$ git branch
* master
$ git pull
Already up to date.

vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):

vimrc

" use pathogen for package installations
execute pathogen#infect()
execute pathogen#helptags()

" essential for vim-go, I think
filetype plugin indent on

" configure gopls? also disable guru in vim-go
let g:go_def_mode='gopls'
let g:go_info_mode='gopls'

" remove this after getting a good gopls setup?
let g:go_null_module_warning = 0

" add tabs for buffers when in single window
let g:airline#extensions#tabline#enabled = 1

Vim version (first three lines from :version):

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Feb 22 2019 19:03:04)
Included patches: 1-503, 505-680, 682-1283
Compiled by [email protected]

Go version (go version):


go1.12.6 darwin/amd64

Go environment

go env Output:


GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/johnrefior/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/johnrefior/home/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/johnrefior/home/work/healthcheck/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/bl/pl1t3r9x7pn_1jxl5krxs7800000gn/T/go-build843095891=/tmp/go-build -gno-record-gcc-switches -fno-common"

Most helpful comment

vim:

:GoInstallBinaries


.vimrc:

let g:go_gopls_enabled = 0

All 7 comments

This isn't a warning, it's a progress message. Clearly, we should update it to say initializing or initialized.

Ah good to know -- thanks!

how to disable to run gopls

I have the same question. I'd like to run without gopls.

Bump that it's annoying, lingering on my terminal's stdout after I close vim (using neovim)

how to disable to run gopls

let g:go_gopls_enabled = 0

vim:

:GoInstallBinaries


.vimrc:

let g:go_gopls_enabled = 0
Was this page helpful?
0 / 5 - 0 ratings

Related issues

SirmaXX picture SirmaXX  路  3Comments

Michael-F-Ellis picture Michael-F-Ellis  路  3Comments

korjavin picture korjavin  路  4Comments

svanharmelen picture svanharmelen  路  3Comments

jongillham picture jongillham  路  3Comments