Skip to content

Commit b334fc0

Browse files
committed
restore support for proposing builtins
1 parent 2c7f30a commit b334fc0

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

autoload/go/complete.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ function! s:gocodeCommand(cmd, args) abort
99
let cmd = [bin_path]
1010
let cmd = extend(cmd, ['-sock', socket_type])
1111
let cmd = extend(cmd, ['-f', 'vim'])
12+
13+
if go#config#GocodeProposeBuiltins()
14+
let cmd = extend(cmd, ['-builtin'])
15+
endif
16+
1217
let cmd = extend(cmd, [a:cmd])
1318
let cmd = extend(cmd, a:args)
1419

autoload/go/config.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ function! go#config#GocodeSocketType() abort
140140
return get(g:, 'go_gocode_socket_type', s:sock_type)
141141
endfunction
142142

143+
function! go#config#GocodeProposeBuiltins() abort
144+
return get(g:, 'go_gocode_propose_builtins', 1)
145+
endfunction
146+
143147
function! go#config#EchoCommandInfo() abort
144148
return get(g:, 'go_echo_command_info', 1)
145149
endfunction

doc/vim-go.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,13 @@ same.
15441544
\ '? go#util#pascalcase(expand("<cword>"))' .
15451545
\ ': go#util#camelcase(expand("<cword>"))'
15461546
<
1547+
*'g:go_gocode_propose_builtins'*
15471548

1549+
Specifies whether `gocode` should add built-in types, functions and constants
1550+
to an autocompletion proposals. By default it is enabled.
1551+
>
1552+
let g:go_gocode_propose_builtins = 1
1553+
<
15481554
*'g:go_gocode_socket_type'*
15491555

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

0 commit comments

Comments
 (0)