1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 06:00:05 +08:00

Update coc.nvim installation (#3564)

* Fix coc.nvim installation.

The installation scripts for coc.nvim have been removed.

We also need to update the plugin install script to properly checkout
the branch specified in the 'rev' attribute. This can be moved out of
a separate git command into the initial clone.

* Fix coc.vim installation

* Change coc build command

Co-authored-by: Theodore Ni <3806110+tjni@users.noreply.github.com>
Co-authored-by: ChocoPowwwa <chocopowwwa@gmail.com>
This commit is contained in:
Wang Shidong 2020-06-01 21:50:27 +08:00 committed by GitHub
parent 337bc6f765
commit f0d4ab2f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 16 deletions

View File

@ -26,8 +26,6 @@
" directory is `~/.SpaceVim/snippets/`. If `g:spacevim_force_global_config = 1`, " directory is `~/.SpaceVim/snippets/`. If `g:spacevim_force_global_config = 1`,
" SpaceVim will not append `./.SpaceVim/snippets` as default snippets directory. " SpaceVim will not append `./.SpaceVim/snippets` as default snippets directory.
let s:SYS = SpaceVim#api#import('system')
function! SpaceVim#layers#autocomplete#plugins() abort function! SpaceVim#layers#autocomplete#plugins() abort
let plugins = [ let plugins = [
\ ['honza/vim-snippets', { 'on_event' : 'InsertEnter', 'loadconf_before' : 1}], \ ['honza/vim-snippets', { 'on_event' : 'InsertEnter', 'loadconf_before' : 1}],
@ -64,10 +62,10 @@ function! SpaceVim#layers#autocomplete#plugins() abort
\ 'loadconf' : 1, \ 'loadconf' : 1,
\ }]) \ }])
elseif g:spacevim_autocomplete_method ==# 'coc' elseif g:spacevim_autocomplete_method ==# 'coc'
if s:SYS.isWindows if executable('yarn')
call add(plugins, ['neoclide/coc.nvim', {'merged': 0, 'build': './install.cmd'}]) call add(plugins, ['neoclide/coc.nvim', {'merged': 0, 'build': 'yarn install --frozen-lockfile'}])
else else
call add(plugins, ['neoclide/coc.nvim', {'merged': 0, 'build': './install.sh'}]) call add(plugins, ['neoclide/coc.nvim', {'merged': 0, 'rev': 'release'}])
endif endif
elseif g:spacevim_autocomplete_method ==# 'deoplete' elseif g:spacevim_autocomplete_method ==# 'deoplete'
call add(plugins, ['Shougo/deoplete.nvim', { call add(plugins, ['Shougo/deoplete.nvim', {

View File

@ -361,11 +361,6 @@ function! s:on_install_stdout(id, data, event) abort
endfunction endfunction
" @vimlint(EVL103, 0, a:event) " @vimlint(EVL103, 0, a:event)
function! s:lock_revision(repo) abort
let cmd = ['git', '--git-dir', a:repo.path . '/.git', 'checkout', a:repo.rev]
call s:VIM_CO.system(cmd)
endfunction
function! s:on_build_exit(id, data, event) abort function! s:on_build_exit(id, data, event) abort
if a:id == -1 if a:id == -1
let id = s:jobpid let id = s:jobpid
@ -401,9 +396,6 @@ function! s:on_install_exit(id, data, event) abort
call s:add_to_failed_list(s:pulling_repos[id].name) call s:add_to_failed_list(s:pulling_repos[id].name)
call s:msg_on_install_failed(s:pulling_repos[id].name) call s:msg_on_install_failed(s:pulling_repos[id].name)
endif endif
if get(s:pulling_repos[id], 'rev', '') !=# ''
call s:lock_revision(s:pulling_repos[id])
endif
if !empty(get(s:pulling_repos[id], 'build', '')) && a:data == 0 if !empty(get(s:pulling_repos[id], 'build', '')) && a:data == 0
call s:build(s:pulling_repos[id]) call s:build(s:pulling_repos[id])
else else
@ -463,10 +455,9 @@ function! s:install(repo) abort
let s:pct += 1 let s:pct += 1
let s:ui_buf[a:repo.name] = s:pct let s:ui_buf[a:repo.name] = s:pct
let url = s:get_uri(a:repo) let url = s:get_uri(a:repo)
if get(a:repo, 'rev', '') !=# ''
let argv = ['git', 'clone', '--recursive', '--progress', url, a:repo.path]
else
let argv = ['git', 'clone', '--depth=1', '--recursive', '--progress', url, a:repo.path] let argv = ['git', 'clone', '--depth=1', '--recursive', '--progress', url, a:repo.path]
if get(a:repo, 'rev', '') !=# ''
let argv = argv + ['-b', a:repo.rev]
endif endif
if s:JOB.vim_job || s:JOB.nvim_job if s:JOB.vim_job || s:JOB.nvim_job
let jobid = s:JOB.start(argv,{ let jobid = s:JOB.start(argv,{