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

detect GOPATH before starting gopls #2255

Merged
merged 1 commit into from
May 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ftplugin/go.vim
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ endif
augroup vim-go-buffer
autocmd! * <buffer>

" The file is registered (textDocument/DidOpen) with gopls in in
" plugin/go.vim on the FileType event.
" The file is registered (textDocument/DidOpen) with gopls in plugin/go.vim
" on the FileType event.
" TODO(bc): handle all the other events that may be of interest to gopls,
" too (e.g. BufFilePost , CursorHold , CursorHoldI, FileReadPost,
" StdinReadPre, BufWritePost, TextChange, TextChangedI)
Expand Down
2 changes: 2 additions & 0 deletions plugin/go.vim
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ function! s:register()
return
endif

let l:RestoreGopath = go#util#SetEnv('GOPATH', go#path#Detect())
call go#lsp#DidOpen(expand('<afile>:p'))
call call(l:RestoreGopath, [])
endfunction

augroup vim-go
Expand Down