Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
chew351 opened this issue May 9, 2019 · 3 comments
Closed

Comments

@chew351
Copy link

chew351 commented May 9, 2019

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 c4b419d (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
Copy link
Author

chew351 commented May 9, 2019

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

Thanks

@bhcleek
Copy link
Collaborator

bhcleek commented May 9, 2019

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)

@bhcleek bhcleek closed this as completed May 9, 2019
@chew351
Copy link
Author

chew351 commented May 10, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants