Skip to content

Commit cb506f5

Browse files
add line in codelens (#1015)
1 parent 7d15d0f commit cb506f5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

autoload/lsp/ui/vim/code_lens.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ function! s:chooseCodeLens(items, bufnr) abort
7272
return lsp#callbag#throwError('No codelens found')
7373
endif
7474
let l:index = inputlist(map(copy(a:items), {i, value ->
75-
\ printf('%s - [%s] %s', i + 1, value['server'], value['codelens']['command']['title'])
75+
\ printf("%s - [%s] %s\t| L%s:%s", i + 1, value['server'], value['codelens']['command']['title'],
76+
\ lsp#utils#position#lsp_line_to_vim(a:bufnr, value['codelens']['range']['start']),
77+
\ getbufline(a:bufnr, lsp#utils#position#lsp_line_to_vim(a:bufnr, value['codelens']['range']['start']))[0][:50])
7678
\ }))
7779
if l:index > 0 && l:index <= len(a:items)
7880
let l:selected = a:items[l:index - 1]

0 commit comments

Comments
 (0)