Skip to content

unable to make gopls autocompletion work #2193

@yerden

Description

@yerden

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

To reproduce this issue, created test user, upgraded to latest vim-go and created vimrc from scratch.

Created sample code, imported net package, typed net. in code and tried to see autocompletion alternatives with C-x C-o.

What did you expect to happen?

To see net package's autocompletion selection subwindow.

What happened instead?

Nothing. At first it printed vim-go: [gopls] SUCCESS and no autocompletion results.
vim's log shows these lines among others:

finished sourcing /home/test/.vim/plugged/vim-go/autoload/go/statusline.vim
continuing in function go#complete#Complete[10]..go#lsp#Completion[1]..go#lsp#DidChange[9]..6[10]..<SNR>42_start
vim-go: [gopls] SUCCESS
vim-go: [completion] FAIL
vim-go: no file information for file:///home/test/go/test/test.go
vim-go: no matches-- INSERT --

Configuration (MUST fill this out):

  • vim-go version:
    40fa2df

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

call plug#begin('~/.vim/plugged')                                              
Plug 'fatih/vim-go'                                                            
let g:go_def_mode = "gopls"                                                    
call plug#end()     
  • Vim version (first three lines from :version):
    VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 10 2018 21:31:58)
    Included patches: 1-1453
    Modified by [email protected]

  • Go version (go version):
    go version go1.12.1 linux/amd64

  • Go environment (go env):

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/test/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/test/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build348581429=/tmp/go-build -gno-record-gcc-switches"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions