Skip to content

Commit 62f2a74

Browse files
committed
add option to propose from source
1 parent b334fc0 commit 62f2a74

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

autoload/go/complete.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ function! s:gocodeCommand(cmd, args) abort
1414
let cmd = extend(cmd, ['-builtin'])
1515
endif
1616

17+
if go#config#GocodeProposeSource()
18+
let cmd = extend(cmd, ['-source'])
19+
endif
20+
1721
let cmd = extend(cmd, [a:cmd])
1822
let cmd = extend(cmd, a:args)
1923

autoload/go/config.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ function! go#config#GocodeProposeBuiltins() abort
144144
return get(g:, 'go_gocode_propose_builtins', 1)
145145
endfunction
146146

147+
function! go#config#GocodeProposeSource() abort
148+
return get(g:, 'go_gocode_propose_source', 0)
149+
endfunction
150+
147151
function! go#config#EchoCommandInfo() abort
148152
return get(g:, 'go_echo_command_info', 1)
149153
endfunction

doc/vim-go.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,6 +1550,14 @@ Specifies whether `gocode` should add built-in types, functions and constants
15501550
to an autocompletion proposals. By default it is enabled.
15511551
>
15521552
let g:go_gocode_propose_builtins = 1
1553+
<
1554+
*'g:go_gocode_propose_source'*
1555+
1556+
Specifies whether `gocode` should use source files instead of binary packages
1557+
for autocompletion proposals. By default it is disabled because it is
1558+
currently much slower.
1559+
>
1560+
let g:go_gocode_propose_source = 0
15531561
<
15541562
*'g:go_gocode_socket_type'*
15551563

0 commit comments

Comments
 (0)