Skip to content

Commit

Permalink
add option to propose from source
Browse files Browse the repository at this point in the history
  • Loading branch information
bhcleek committed Aug 26, 2018
1 parent b334fc0 commit 62f2a74
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions autoload/go/complete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ function! s:gocodeCommand(cmd, args) abort
let cmd = extend(cmd, ['-builtin'])
endif

if go#config#GocodeProposeSource()
let cmd = extend(cmd, ['-source'])
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 @@ -144,6 +144,10 @@ function! go#config#GocodeProposeBuiltins() abort
return get(g:, 'go_gocode_propose_builtins', 1)
endfunction

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

function! go#config#EchoCommandInfo() abort
return get(g:, 'go_echo_command_info', 1)
endfunction
Expand Down
8 changes: 8 additions & 0 deletions doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1550,6 +1550,14 @@ Specifies whether `gocode` should add built-in types, functions and constants
to an autocompletion proposals. By default it is enabled.
>
let g:go_gocode_propose_builtins = 1
<
*'g:go_gocode_propose_source'*

Specifies whether `gocode` should use source files instead of binary packages
for autocompletion proposals. By default it is disabled because it is
currently much slower.
>
let g:go_gocode_propose_source = 0
<
*'g:go_gocode_socket_type'*

Expand Down

0 comments on commit 62f2a74

Please sign in to comment.