Add :VimspectorUpdate
This commit is contained in:
parent
8275d2fafb
commit
4144631d03
4 changed files with 33 additions and 0 deletions
|
|
@ -453,6 +453,11 @@ which can be used to check everything is working. This is used by the regression
|
||||||
tests in CI so should always work, and is a good way to check if the problem is
|
tests in CI so should always work, and is a good way to check if the problem is
|
||||||
your configuration rather than a bug.
|
your configuration rather than a bug.
|
||||||
|
|
||||||
|
## Upgrade
|
||||||
|
|
||||||
|
After updating the Vimspector code (either via `git pull` or whatever pacakge
|
||||||
|
manager), run `:VimspectorUpdate` to update any already-installed gadets.
|
||||||
|
|
||||||
# About
|
# About
|
||||||
|
|
||||||
## Background
|
## Background
|
||||||
|
|
|
||||||
|
|
@ -256,6 +256,17 @@ function! vimspector#CompleteInstall( ArgLead, CmdLine, CursorPos ) abort
|
||||||
\ . ')' )
|
\ . ')' )
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! vimspector#Update() abort
|
||||||
|
if !s:enabled
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
let prefix = vimspector#internal#state#GetAPIPrefix()
|
||||||
|
py3 __import__( 'vimspector',
|
||||||
|
\ fromlist = [ 'installer' ] ).installer.RunUpdate(
|
||||||
|
\ vim.eval( 'prefix' ) )
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Boilerplate {{{
|
" Boilerplate {{{
|
||||||
let &cpoptions=s:save_cpo
|
let &cpoptions=s:save_cpo
|
||||||
unlet s:save_cpo
|
unlet s:save_cpo
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,10 @@ command! -bar
|
||||||
command! -bar -nargs=* -complete=custom,vimspector#CompleteInstall
|
command! -bar -nargs=* -complete=custom,vimspector#CompleteInstall
|
||||||
\ VimspectorInstall
|
\ VimspectorInstall
|
||||||
\ call vimspector#Install( <f-args> )
|
\ call vimspector#Install( <f-args> )
|
||||||
|
command! -bar -nargs=0
|
||||||
|
\ VimspectorUpdate
|
||||||
|
\ call vimspector#Update()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" Dummy autocommands so that we can call this whenever
|
" Dummy autocommands so that we can call this whenever
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,19 @@ def RunInstaller( api_prefix, *args, **kwargs ):
|
||||||
OUTPUT_VIEW.ShowOutput( 'Installer' )
|
OUTPUT_VIEW.ShowOutput( 'Installer' )
|
||||||
|
|
||||||
|
|
||||||
|
def RunUpdate( api_prefix ):
|
||||||
|
from vimspector import utils
|
||||||
|
Configure( vimspector_base = utils.GetVimspectorBase() )
|
||||||
|
|
||||||
|
current_adapters = ReadAdapters( read_existing = True )
|
||||||
|
adapters = []
|
||||||
|
for adapter_name in current_adapters.keys():
|
||||||
|
adapters.extend( FindGadgetForAdapter( adapter_name ) )
|
||||||
|
|
||||||
|
if adapters:
|
||||||
|
RunInstaller( api_prefix, *adapters )
|
||||||
|
|
||||||
|
|
||||||
def GadgetListToInstallerArgs( *gadget_list ):
|
def GadgetListToInstallerArgs( *gadget_list ):
|
||||||
installer_args = []
|
installer_args = []
|
||||||
for name in gadget_list:
|
for name in gadget_list:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue