mirror of
https://github.com/prabirshrestha/vim-lsp.git
synced 2025-12-14 20:35:59 +01:00
default to using quickpick for codelens (#1053)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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!
|
||||||
|
|||||||
Reference in New Issue
Block a user