Skip to content

fix error handling when gopls is disabled #3090

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

Merged
merged 1 commit into from
Nov 13, 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
3 changes: 2 additions & 1 deletion autoload/go/calls.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ set cpo&vim

function! go#calls#Callers() abort
if !go#config#GoplsEnabled()
call go#util#EchoError("go_referrers_mode is 'gopls', but gopls is disabled")
call go#util#EchoError("gopls is disabled")
return
endif
let [l:line, l:col] = getpos('.')[1:2]
let [l:line, l:col] = go#lsp#lsp#Position(l:line, l:col)
Expand Down
1 change: 1 addition & 0 deletions autoload/go/referrers.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function! go#referrers#Referrers(selected) abort
elseif l:mode == 'gopls'
if !go#config#GoplsEnabled()
call go#util#EchoError("go_referrers_mode is 'gopls', but gopls is disabled")
return
endif
let [l:line, l:col] = getpos('.')[1:2]
let [l:line, l:col] = go#lsp#lsp#Position(l:line, l:col)
Expand Down