Skip to content

Commit 929cf4c

Browse files
committed
:LanguageClientInstallBinaries to download client from vim
1 parent 1cb8bb5 commit 929cf4c

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

autoload/LanguageClient.vim

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,11 +794,21 @@ function! LanguageClient#binaryPath() abort
794794
return l:path . l:filename
795795
endfunction
796796

797+
function! LanguageClient#installBinaries()
798+
let l:installsh = 'cd ' . s:root . ' && ./install.sh'
799+
let l:output = split(system(l:installsh), '\n')
800+
for l:line in l:output
801+
echomsg l:line
802+
endfor
803+
echomsg "Success."
804+
endfunction
805+
797806
function! s:Launch() abort
798807
let l:binpath = LanguageClient#binaryPath()
799808

800809
if executable(l:binpath) != 1
801-
call s:Echoerr('LanguageClient: binary (' . l:binpath . ') doesn''t exists! Please check installation guide.')
810+
call s:Echoerr('LanguageClient: binary (' . l:binpath . ') doesn''t exists!')
811+
call s:Echoerr('Run :LanguageClientInstallBinaries or check installation guide.')
802812
return 0
803813
endif
804814

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ arch=$(uname -sm)
1313

1414
try_curl() {
1515
command -v curl > /dev/null && \
16-
curl --fail --location "$1" --output bin/$name
16+
curl --fail --silent --show-error --location "$1" --output bin/$name
1717
}
1818

1919
try_wget() {

plugin/LanguageClient.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ endfunction
156156

157157
command! -nargs=* LanguageClientStart :call LanguageClient#startServer(<f-args>)
158158
command! LanguageClientStop call LanguageClient#shutdown()
159+
command! LanguageClientInstallBinaries :call LanguageClient#installBinaries()
159160

160161
function! s:OnBufEnter()
161162
if !LanguageClient#HasCommand(&filetype)

0 commit comments

Comments
 (0)