Skip to content

Commit 6be5309

Browse files
committed
add option to propose from source
1 parent a981711 commit 6be5309

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
@@ -1581,6 +1581,14 @@ Specifies whether `gocode` should add built-in types, functions and constants
15811581
to an autocompletion proposals. By default it is enabled.
15821582
>
15831583
let g:go_gocode_propose_builtins = 1
1584+
<
1585+
*'g:go_gocode_propose_source'*
1586+
1587+
Specifies whether `gocode` should use source files instead of binary packages
1588+
for autocompletion proposals. By default it is disabled because it is
1589+
currently much slower.
1590+
>
1591+
let g:go_gocode_propose_source = 0
15841592
<
15851593
*'g:go_gocode_socket_type'*
15861594

0 commit comments

Comments
 (0)