Skip to content

Commit

Permalink
Merge pull request #2640 from bhcleek/config/gopls_enabled/test
Browse files Browse the repository at this point in the history
config: add a test for go_gopls_enabled=0
  • Loading branch information
bhcleek authored Dec 31, 2019
2 parents 6baebfb + 13a899a commit 7f0d635
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions autoload/go/config_test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,26 @@ func! Test_SetBuildTags() abort
endtry
endfunc

func! Test_GoplsEnabled_Clear() abort
if !go#util#has_job()
return
endif

try
let g:go_gopls_enabled = 0

let l:tmp = gotest#write_file('gopls_disabled.go', [
\ 'package example',
\ '',
\ 'func Example() {',
\ "\tprintln(" . '"hello, world!")',
\ '}',
\ ] )

finally
unlet g:go_gopls_enabled
endtry
endfunc
" restore Vi compatibility settings
let &cpo = s:cpo_save
unlet s:cpo_save
Expand Down
3 changes: 2 additions & 1 deletion autoload/go/lsp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ function! s:newlsp() abort
let l:lsp = {
\ 'sendMessage': funcref('s:noop'),
\ 'notificationQueue': {},
\ 'fileVersions': {}
\ 'fileVersions': {},
\ 'workspaceDirectories': [],
\ }

if !go#config#GoplsEnabled()
Expand Down

0 comments on commit 7f0d635

Please sign in to comment.