Skip to content

Commit

Permalink
lsp: add suppport for gopls' local option
Browse files Browse the repository at this point in the history
  • Loading branch information
bhcleek committed Apr 11, 2020
1 parent 766d778 commit dfd5f23
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions autoload/go/config.vim
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,10 @@ function! go#config#GoplsTempModfile() abort
return get(g:, 'go_gopls_temp_modfile', v:null)
endfunction

function! go#config#GoplsLocal() abort
return get(g:, 'go_gopls_local', v:null)
endfunction

function! go#config#GoplsEnabled() abort
return get(g:, 'go_gopls_enabled', 1)
endfunction
Expand Down
5 changes: 5 additions & 0 deletions autoload/go/lsp/message.vim
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ function! go#lsp#message#ConfigurationResult(items) abort
let l:staticcheck = go#config#GoplsStaticCheck()
let l:usePlaceholder = go#config#GoplsUsePlaceholders()
let l:tempModfile = go#config#GoplsTempModfile()
let l:local = go#config#GoplsLocal()

if l:deepCompletion isnot v:null
if l:deepCompletion
Expand Down Expand Up @@ -312,6 +313,10 @@ function! go#lsp#message#ConfigurationResult(items) abort
endif
endif

if l:local isnot v:null
let l:config.local = l:local
endif

let l:result = add(l:result, l:config)
endfor

Expand Down
9 changes: 9 additions & 0 deletions doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1828,6 +1828,15 @@ will be used. By default it is `v:null`.
let g:go_gopls_temp_modfile = v:null
<

*'g:go_gopls_local'*

Specifies the prefix for imports that `gopls` should consider group
separately. When it is `v:null`, `gopls`' default will be used. By default it
is `v:null`.
>
let g:go_gopls_local = v:null
<

*'g:go_diagnostics_enabled'*

Specifies whether `gopls` diagnostics are enabled. Only the diagnostics for
Expand Down

0 comments on commit dfd5f23

Please sign in to comment.