nvimlsp: do not check for :LspInstallInfo

nvimlsp removed the :LspInstallInfo command. So instead check explicitly
for neovim for enabling the nvimlsp extension.

In the extension itself check that at least one LSP is attached to the
buffer before returning warning and error messages.

closes #2323
This commit is contained in:
Christian Brabandt 2021-02-02 10:07:51 +01:00
parent c7a633ce8f
commit bffa7a4d23
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 3 additions and 3 deletions

View File

@ -338,7 +338,7 @@ function! airline#extensions#load()
endif
if (get(g:, 'airline#extensions#nvimlsp#enabled', 1)
\ && exists(':LspInstallInfo'))
\ && has("nvim"))
call airline#extensions#nvimlsp#init(s:ext)
call add(s:loaded_ext, 'nvimlsp')
endif

View File

@ -5,7 +5,7 @@
scriptencoding utf-8
if !(get(g:, 'airline#extensions#nvimlsp#enabled', 1)
\ && exists(':LspInstallInfo'))
\ && has("nvim"))
finish
endif
@ -14,7 +14,7 @@ function! s:airline_nvimlsp_count(cnt, symbol) abort
endfunction
function! airline#extensions#nvimlsp#get(type) abort
if !exists(':LspInstallInfo')
if vim.lsp.buf_get_clients() == 0
return ''
endif