Skip to content

Commit 735a279

Browse files
keremcprabirshrestha
authored andcommitted
Show details (type info, etc.) in completion menu (#229)
1 parent 07b9fc6 commit 735a279

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

autoload/lsp/omni.vim

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,14 @@ function! lsp#omni#get_vim_completion_item(item) abort
164164
let l:menu = lsp#omni#get_kind_text(a:item)
165165
let l:completion = { 'word': l:word, 'abbr': l:abbr, 'menu': l:menu, 'info': '', 'icase': 1, 'dup': 1 }
166166

167-
if has_key(a:item, 'detail')
168-
let l:completion['info'] .= a:item['detail'] . ' '
169-
endif
167+
if has_key(a:item, 'detail') && !empty(a:item['detail'])
168+
if empty(l:menu)
169+
let l:completion['menu'] = a:item['detail']
170+
else
171+
let l:completion['menu'] = '[' . l:menu . '] ' . a:item['detail']
172+
endif
173+
let l:completion['info'] .= a:item['detail'] . ' '
174+
endif
170175

171176
if has_key(a:item, 'documentation')
172177
if type(a:item['documentation']) == type('')

0 commit comments

Comments
 (0)