Skip to content

gocode: Restore support for unimported packages #2030

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

Merged
merged 1 commit into from
Oct 23, 2018
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: 4 additions & 0 deletions autoload/go/complete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ function! s:gocodeCommand(cmd, args) abort
let cmd = extend(cmd, ['-source'])
endif

if go#config#GocodeUnimportedPackages()
let cmd = extend(cmd, ['-unimported-packages'])
endif

let cmd = extend(cmd, [a:cmd])
let cmd = extend(cmd, a:args)

Expand Down
4 changes: 4 additions & 0 deletions autoload/go/config.vim
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ function! go#config#SetGuruScope(scope) abort
endif
endfunction

function! go#config#GocodeUnimportedPackages() abort
return get(g:, 'go_gocode_unimported_packages', 0)
endfunction

let s:sock_type = (has('win32') || has('win64')) ? 'tcp' : 'unix'
function! go#config#GocodeSocketType() abort
return get(g:, 'go_gocode_socket_type', s:sock_type)
Expand Down
8 changes: 8 additions & 0 deletions doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1611,6 +1611,14 @@ package and packages that have been installed will proposed.
>
let g:go_gocode_propose_source = 1
<
*'g:go_gocode_unimported_packages'*

Specifies whether `gocode` should include suggestions from unimported
packages. By default it is disabled.
>
let g:go_gocode_unimported_packages = 0
<

*'g:go_gocode_socket_type'*

Specifies whether `gocode` should use a different socket type. By default
Expand Down