Skip to content

Commit c0e20c5

Browse files
authored
Merge pull request #2907 from bhcleek/completion/echo-go-info
completion: do not show documentation at command-line
2 parents 8e72eef + bec9b93 commit c0e20c5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

autoload/go/auto.vim

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ function! s:echo_go_info()
5757
endif
5858
let item = v:completed_item
5959

60-
if !has_key(item, "info")
60+
if !has_key(item, "user_data")
6161
return
6262
endif
6363

64-
if empty(item.info)
64+
if empty(item.user_data)
6565
return
6666
endif
6767

68-
redraws! | echo "vim-go: " | echohl Function | echon item.info | echohl None
68+
redraws! | echo "vim-go: " | echohl Function | echon item.user_data | echohl None
6969
endfunction
7070

7171
let s:timer_id = 0

autoload/go/lsp.vim

+2-1
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ function! s:completionHandler(next, msg) abort dict
703703
for l:item in a:msg.items
704704
let l:start = l:item.textEdit.range.start.character
705705

706-
let l:match = {'abbr': l:item.label, 'word': l:item.textEdit.newText, 'info': '', 'kind': go#lsp#completionitemkind#Vim(l:item.kind)}
706+
let l:match = {'abbr': l:item.label, 'word': l:item.textEdit.newText, 'info': '', 'kind': go#lsp#completionitemkind#Vim(l:item.kind), 'user_data': ''}
707707
if has_key(l:item, 'detail')
708708
let l:match.menu = l:item.detail
709709
if go#lsp#completionitemkind#IsFunction(l:item.kind) || go#lsp#completionitemkind#IsMethod(l:item.kind)
@@ -721,6 +721,7 @@ function! s:completionHandler(next, msg) abort dict
721721
endif
722722
endif
723723

724+
let l:match.user_data = l:match.info
724725
if has_key(l:item, 'documentation')
725726
let l:match.info .= "\n\n" . l:item.documentation
726727
endif

0 commit comments

Comments
 (0)