Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lsp: add suppport for gopls' local option #2821

Merged
merged 1 commit into from
Apr 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions autoload/go/config.vim
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,10 @@ function! go#config#GoplsAnalyses() abort
return get(g:, 'go_gopls_analyses', 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 @@ -268,6 +268,7 @@ function! go#lsp#message#ConfigurationResult(items) abort
let l:usePlaceholder = go#config#GoplsUsePlaceholders()
let l:tempModfile = go#config#GoplsTempModfile()
let l:analyses = go#config#GoplsAnalyses()
let l:local = go#config#GoplsLocal()

if l:deepCompletion isnot v:null
if l:deepCompletion
Expand Down Expand Up @@ -317,6 +318,10 @@ function! go#lsp#message#ConfigurationResult(items) abort
let l:config.analyses = l:analyses
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 @@ -1836,6 +1836,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