You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
call plug#begin('~/.vim/plugged')
Plug 'fatih/vim-go'
call plug#end()
let g:go_bin_path=$HOME."/.local/bin"
let g:go_def_mode='gopls'
let g:go_info_mode='gopls'
Vim version (first three lines from :version):
VIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 30 2019 09:57:35)
Included patches: 1-1239
Modified by [email protected]
Go version (go version): go version go1.11.5 linux/amd64
This is working as intended for now. When you open the first Go file, your working directory should be either within $GOPATH or in a Go module directory. You can make sure that's the case by doing cd or lcd to change to your Go module's directory before opening a Go file.
This may change in the future; I'm considering making it so that each tab in Vim can use its own gopls server and probably autodetect the module directory when in module mode.
bhcleek
changed the title
gopls code completion doesn't work in multi-language project
gopls code completion doesn't work in module mode when the current working directory at or below a module root
May 4, 2019
bhcleek
added a commit
to bhcleek/vim-go
that referenced
this issue
May 4, 2019
Set the working directory of gopls based on the value of GOMOD. When in
GOPATH mode, the value of Vim's working directory will be used.
Fixesfatih#2263
bhcleek
changed the title
gopls code completion doesn't work in module mode when the current working directory at or below a module root
gopls code completion doesn't work in module mode when the current working directory is at or below a module root
May 4, 2019
Set the working directory of gopls based on the value of GOMOD. When in
GOPATH mode, the value of Vim's working directory will be used.
Fixesfatih#2263
What did you do?
Issue described here: microsoft/vscode-go#2490
vim-go
also has it.What did you expect to happen?
Working code completion with
gopls
in multi-language project.What happened instead?
Code completion only works when I start vim session from the folder with
go.mod/go.sum
files.Configuration:
vim-go version: 2c1a85b
vimrc
you used to reproduce::version
):Go version (
go version
):go version go1.11.5 linux/amd64
Go environment (
go env
):The text was updated successfully, but these errors were encountered: