default to using quickpick for codelens (#1053)

This commit is contained in:
Prabir Shrestha
2021-01-18 09:54:59 -08:00
committed by GitHub
parent 17180038a8
commit 51a566c878
2 changed files with 1 additions and 17 deletions

View File

@@ -71,21 +71,7 @@ function! s:chooseCodeLens(items, bufnr) abort
if empty(a:items) if empty(a:items)
return lsp#callbag#throwError('No codelens found') return lsp#callbag#throwError('No codelens found')
endif endif
if g:lsp_experimental_quickpick_ui
return lsp#callbag#create(function('s:quickpick_open', [a:items, a:bufnr])) return lsp#callbag#create(function('s:quickpick_open', [a:items, a:bufnr]))
else
let l:index = inputlist(map(copy(a:items), {i, value ->
\ printf("%s - [%s] %s\t| L%s:%s", i + 1, value['server'], value['codelens']['command']['title'],
\ lsp#utils#position#lsp_line_to_vim(a:bufnr, value['codelens']['range']['start']),
\ getbufline(a:bufnr, lsp#utils#position#lsp_line_to_vim(a:bufnr, value['codelens']['range']['start']))[0][:50])
\ }))
if l:index > 0 && l:index <= len(a:items)
let l:selected = a:items[l:index - 1]
return lsp#callbag#of(l:selected)
else
return lsp#callbag#empty()
endif
endif
endfunction endfunction
function! s:quickpick_open(items, bufnr, next, error, complete) abort function! s:quickpick_open(items, bufnr, next, error, complete) abort

View File

@@ -63,8 +63,6 @@ let g:lsp_work_done_progress_enabled = get(g:, 'lsp_work_done_progress_enabled',
let g:lsp_get_supported_capabilities = get(g:, 'lsp_get_supported_capabilities', [function('lsp#default_get_supported_capabilities')]) let g:lsp_get_supported_capabilities = get(g:, 'lsp_get_supported_capabilities', [function('lsp#default_get_supported_capabilities')])
let g:lsp_experimental_quickpick_ui = get(g:, 'lsp_experimental_quickpick_ui', 0)
if g:lsp_auto_enable if g:lsp_auto_enable
augroup lsp_auto_enable augroup lsp_auto_enable
autocmd! autocmd!