fatih / vim-go

Go development plugin for Vim
https://www.patreon.com/bhcleek
Other
16.01k stars 1.45k forks source link

<c+x><c+o>can't block when import a dot package like import "./mypackage" #2281

Closed chew351 closed 5 years ago

chew351 commented 5 years ago

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

project foo a/clnt.go <--- package a b/clnt.go <---- package b main.go

main.go file:

package foo

import "fmt"

import "./a" <--- import a dot package import "./b" <--- import a dot package

func main() { fmt. fmt.Println("vim-go") a.Clnt() b.Clnt() } -- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)

when import a local package like import "./mypackage" <c+x><c+o> was blocked

What did you expect to happen?

when import a local package like import "./mypackage" <c+x><c+o> can autocomplete

What happened instead?

when import a local package like import "./mypackage" <c+x><c+o> cause vim blocked

Configuration (MUST fill this out):

vim-go version:

root@work:~/.vim/bundle/vim-go# git log -p commit c4b419db6c57125e91d6f292daa664b73b155b7b (HEAD -> master, origin/master, origin/HEAD) Author: Billie Cleek bhcleek@gmail.com Date: Mon May 6 18:33:16 2019 -0700

update CHANGELOG.md for #2269 and #2276

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

vimrc
let g:go_disable_autoinstall = 0

"let g:go_def_mode = 'godef'

let g:go_autodetect_gopath = 1

"let g:go_gocode_propose_builtins = 1
"let g:go_gocode_unimported_packages = 1
"let g:go_gocode_propose_source = 1

Vim version (first three lines from :version):

vim8.1 on ubuntu18

Go version (go version):

root@work:~/.vim/bundle/vim-go# go version go version go1.12.4 linux/amd64

Go environment

go env Output:
root@work:~/.vim/bundle/vim-go# go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/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-build056764472=/tmp/go-build -gno-record-gcc-switches"
chew351 commented 5 years ago

Does vim-go autocomplete support import dot package like import "./mypackage"

Thanks

bhcleek commented 5 years ago

relative imports are not supported by gopls at all. The issue this comment is on is for for something different, but the explanation about relative import support is here: https://github.com/golang/go/issues/31837#issuecomment-489769149

chew351 commented 5 years ago

Thanks for the details, I understand now

At 2019-05-10 01:08:07, "Billie Cleek" notifications@github.com wrote:

relative imports are not supported by gopls at all. The issue this comment is on is for for something different, but the explanation about relative import support is here: golang/go#31837 (comment)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.