Skip to content

Commit 03d9fe5

Browse files
committed
:LanguageClientInstallBinaries to download client from vim
1 parent a7d3456 commit 03d9fe5

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
@@ -596,11 +596,21 @@ function! LanguageClient#binaryPath() abort
596596
return l:path . l:filename
597597
endfunction
598598

599+
function! LanguageClient#installBinaries()
600+
let l:installsh = 'cd ' . s:root . ' && ./install.sh'
601+
let l:output = split(system(l:installsh), '\n')
602+
for l:line in l:output
603+
echomsg l:line
604+
endfor
605+
echomsg "Success."
606+
endfunction
607+
599608
function! s:Launch() abort
600609
let l:binpath = LanguageClient#binaryPath()
601610

602611
if executable(l:binpath) != 1
603-
call s:Echoerr('LanguageClient: binary (' . l:binpath . ') doesn''t exists! Please check installation guide.')
612+
call s:Echoerr('LanguageClient: binary (' . l:binpath . ') doesn''t exists!')
613+
call s:Echoerr('Run :LanguageClientInstallBinaries or check installation guide.')
604614
return 0
605615
endif
606616

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ name=languageclient
1111

1212
try_curl() {
1313
command -v curl > /dev/null && \
14-
curl --fail --location "$1" --output bin/$name
14+
curl --fail --silent --show-error --location "$1" --output bin/$name
1515
}
1616

1717
try_wget() {

plugin/LanguageClient.vim

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

113113
command! -nargs=* LanguageClientStart :call LanguageClient#startServer(<f-args>)
114114
command! LanguageClientStop :call LanguageClient#exit()
115+
command! LanguageClientInstallBinaries :call LanguageClient#installBinaries()
115116

116117
augroup languageClient
117118
autocmd!

0 commit comments

Comments
 (0)