Skip to content

Commit 9f5b6b5

Browse files
committed
:LanguageClientInstallBinaries to download client from vim
1 parent 50c4bbd commit 9f5b6b5

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
@@ -785,11 +785,21 @@ function! LanguageClient#binaryPath() abort
785785
return l:path . l:filename
786786
endfunction
787787

788+
function! LanguageClient#installBinaries()
789+
let l:installsh = 'cd ' . s:root . ' && ./install.sh'
790+
let l:output = split(system(l:installsh), '\n')
791+
for l:line in l:output
792+
echomsg l:line
793+
endfor
794+
echomsg "Success."
795+
endfunction
796+
788797
function! s:Launch() abort
789798
let l:binpath = LanguageClient#binaryPath()
790799

791800
if executable(l:binpath) != 1
792-
call s:Echoerr('LanguageClient: binary (' . l:binpath . ') doesn''t exists! Please check installation guide.')
801+
call s:Echoerr('LanguageClient: binary (' . l:binpath . ') doesn''t exists!')
802+
call s:Echoerr('Run :LanguageClientInstallBinaries or check installation guide.')
793803
return 0
794804
endif
795805

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)