diff options
Diffstat (limited to 'autoload/ale/completion.vim')
-rw-r--r-- | autoload/ale/completion.vim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/autoload/ale/completion.vim b/autoload/ale/completion.vim index efbf0fd5..39bfc094 100644 --- a/autoload/ale/completion.vim +++ b/autoload/ale/completion.vim @@ -606,17 +606,21 @@ function! ale#completion#ParseLSPCompletions(response) abort let l:doc = l:doc.value endif + " Collapse whitespaces and line breaks into a single space. + let l:detail = substitute(get(l:item, 'detail', ''), '\_s\+', ' ', 'g') + let l:result = { \ 'word': l:word, \ 'kind': ale#completion#GetCompletionSymbols(get(l:item, 'kind', '')), \ 'icase': 1, - \ 'menu': get(l:item, 'detail', ''), + \ 'menu': l:detail, \ 'info': (type(l:doc) is v:t_string ? l:doc : ''), \} " This flag is used to tell if this completion came from ALE or not. let l:user_data = {'_ale_completion_item': 1} if has_key(l:item, 'additionalTextEdits') + \ && l:item.additionalTextEdits isnot v:null let l:text_changes = [] for l:edit in l:item.additionalTextEdits |