Skip to content

autocompletions unavailable for local packages #2018

@danprince

Description

@danprince

What did you do?

Trying to use autocomplete:

  • For a package from the standard library ✅
  • For a variable inside the current package ✅
  • For a remote package installed with go get
  • For a local package in $GOPATH/src

Looks like this is happening because the appropriate package objects under $GOPATH/pkg aren't being generated for some reason.

If I open the same files within vscode (using the vscode-go plugin, which also uses $GOPATH/bin/gocode) it works fine and the $GOPATH/pkg/**/*.a files are generated.

If I switch back into vim at this point, I can use those completions, however, if I update a file outside of the package I have open, then the completions aren't updated.

If I use the <C-x><C-o> binding, then the completion works but it's incredibly slow (> 2s each time). It doesn't generate the $GOPATH/pkg files either.

I've tried the following completion plugins with no luck:

  • deoplete and deoplete-go
  • ncm2 and ncm2-go

Tried with let g:go_gocode_propose_source = 1 but same problem.

Configuration (MUST fill this out):

  • vim-go version: 620e8ac

  • vimrc you used to reproduce:

call plug#begin('~/.vim/plugged')

Plug 'fatih/vim-go'

Plug 'Shougo/deoplete.nvim'
Plug 'zchee/deoplete-go', { 'do': 'make'}

let g:deoplete#enable_at_startup = 1

call plug#end()
  • Vim version (first three lines from :version):
NVIM v0.3.1
Build type: Release
LuaJIT 2.0.5
  • Go version (go version):
go version go1.11.1 darwin/amd64
  • Go environment (go env):
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/dan/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/dan/dev/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11.1/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/1d/fsc7nxn16b35vps3z8rl2h8m0000gn/T/go-build753843243=/tmp/go-build -gno-record-gcc-switches -fno-common"

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