Skip to content

Commit

Permalink
Merge pull request #2329 from bhcleek/lsp/by-default
Browse files Browse the repository at this point in the history
make gopls the default for g:go_info_mode and g:go_def_mode
  • Loading branch information
bhcleek committed Jun 4, 2019
2 parents d034e5f + 4da1524 commit ac86078
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
4 changes: 2 additions & 2 deletions autoload/go/config.vim
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function! go#config#ListAutoclose() abort
endfunction

function! go#config#InfoMode() abort
return get(g:, 'go_info_mode', 'gocode')
return get(g:, 'go_info_mode', 'gopls')
endfunction

function! go#config#GuruScope() abort
Expand Down Expand Up @@ -183,7 +183,7 @@ function! go#config#DefReuseBuffer() abort
endfunction

function! go#config#DefMode() abort
return get(g:, 'go_def_mode', 'guru')
return get(g:, 'go_def_mode', 'gopls')
endfunction

function! go#config#DeclsIncludes() abort
Expand Down
8 changes: 8 additions & 0 deletions autoload/go/def_test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,16 @@ func! Test_Jump_leaves_lists() abort

let l:bufnr = bufnr('%')
call cursor(6, 7)

if !go#util#has_job()
let g:go_def_mode='godef'
endif
call go#def#Jump('', 0)

if !go#util#has_job()
unlet g:go_def_mode
endif

let start = reltime()
while bufnr('%') == l:bufnr && reltimefloat(reltime(start)) < 10
sleep 100m
Expand Down
19 changes: 10 additions & 9 deletions doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1275,11 +1275,11 @@ updated. By default it's disabled. The delay can be configured with the
*'g:go_info_mode'*

Use this option to define the command to be used for |:GoInfo|. By default
`gocode` is being used as it's the fastest option. But one might also use
`gopls` or `guru` as they cover more cases and are more accurate. Current
valid options are: `[gocode, guru, gopls]` >
let g:go_info_mode = 'gocode'
`gopls` is used, because it is the fastest and is known to be highly accurate.
One might also use `guru` for its accuracy or `gocode` for its performance.
Valid options are `gocode`, `gopls`, and `guru`.
>
let g:go_info_mode = 'gopls'
<
*'g:go_auto_sameids'*

Expand Down Expand Up @@ -1391,10 +1391,11 @@ a private internal service. Default is 'https://godoc.org'.
*'g:go_def_mode'*

Use this option to define the command to be used for |:GoDef|. By default
`guru` is being used as it covers all edge cases. But one might also use
`godef` as it's faster. Current valid options are: `[guru, godef, gopls]` >
let g:go_def_mode = 'guru'
`gopls` is used, because it is the fastest. One might also use `guru` for its
accuracy or `godef` for its performance. Valid options are `godef`, `gopls`,
and `guru`.
>
let g:go_def_mode = 'gopls'
<
*'g:go_def_mapping_enabled'*

Expand Down

0 comments on commit ac86078

Please sign in to comment.