Merge pull request #213 from puremourning/install-bang
Add bang versions of install commands to leave the output open
This commit is contained in:
commit
7acf6ab45c
5 changed files with 33 additions and 12 deletions
21
README.md
21
README.md
|
|
@ -16,9 +16,12 @@ For a tutorial and usage overview, take a look at the
|
||||||
* [Windows differences](#windows-differences)
|
* [Windows differences](#windows-differences)
|
||||||
* [Clone the plugin](#clone-the-plugin)
|
* [Clone the plugin](#clone-the-plugin)
|
||||||
* [Install some gadgets](#install-some-gadgets)
|
* [Install some gadgets](#install-some-gadgets)
|
||||||
|
* [VimspectorInstall and VimspectorUpdate commands](#vimspectorinstall-and-vimspectorupdate-commands)
|
||||||
|
* [install_gadget.py](#install_gadgetpy)
|
||||||
* [Manual gadget installation](#manual-gadget-installation)
|
* [Manual gadget installation](#manual-gadget-installation)
|
||||||
* [The gadget directory](#the-gadget-directory)
|
* [The gadget directory](#the-gadget-directory)
|
||||||
* [Trying it out](#trying-it-out)
|
* [Trying it out](#trying-it-out)
|
||||||
|
* [Upgrade](#upgrade)
|
||||||
* [About](#about)
|
* [About](#about)
|
||||||
* [Background](#background)
|
* [Background](#background)
|
||||||
* [Status](#status)
|
* [Status](#status)
|
||||||
|
|
@ -71,7 +74,7 @@ For a tutorial and usage overview, take a look at the
|
||||||
* [License](#license)
|
* [License](#license)
|
||||||
* [Sponsorship](#sponsorship)
|
* [Sponsorship](#sponsorship)
|
||||||
|
|
||||||
<!-- Added by: ben, at: Wed 22 Jul 2020 12:38:39 BST -->
|
<!-- Added by: ben, at: Wed 22 Jul 2020 22:10:50 BST -->
|
||||||
|
|
||||||
<!--te-->
|
<!--te-->
|
||||||
|
|
||||||
|
|
@ -307,9 +310,23 @@ To install the tested debug adapter for a language, run:
|
||||||
| Supported and experimental adapters | `./install_gadget.py --all --force-all` | `:VimspectorInstall --all` |
|
| Supported and experimental adapters | `./install_gadget.py --all --force-all` | `:VimspectorInstall --all` |
|
||||||
| Adapter for specific debug config | | Suggested by Vimspector when starting debugging |
|
| Adapter for specific debug config | | Suggested by Vimspector when starting debugging |
|
||||||
|
|
||||||
`"VimspectorInstall` runs `install_gadget.py` in the background with some of
|
### VimspectorInstall and VimspectorUpdate commands
|
||||||
|
|
||||||
|
`:VimspectorInstall` runs `install_gadget.py` in the background with some of
|
||||||
the options defaulted.
|
the options defaulted.
|
||||||
|
|
||||||
|
`:VimspectorUpdate` runs `install_gadget.py` to re-install (i.e. update) any
|
||||||
|
gadgets already installed in your `.gadgets.json`.
|
||||||
|
|
||||||
|
The output is minimal, to see the full output add `--verbose` to the command, as
|
||||||
|
in `:VimspectorInstall --verbose ...` or `:VimspectorUpdate --verbose ...`.
|
||||||
|
|
||||||
|
If the installation is successful, the output window is closed (and the output
|
||||||
|
lost forever). Use a `!` to keep it open (e.g. `:VimspectorInstall! --verbose
|
||||||
|
--all` or `:VimspectorUpdate!` (etc.).
|
||||||
|
|
||||||
|
### install\_gadget.py
|
||||||
|
|
||||||
By default `install_gadget.py` will overwrite your `.gadgets.json` with the set
|
By default `install_gadget.py` will overwrite your `.gadgets.json` with the set
|
||||||
of adapters just installed, whereas `:VimspectorInstall` will _update_ it,
|
of adapters just installed, whereas `:VimspectorInstall` will _update_ it,
|
||||||
overwriting only newly changed or installed adapters.
|
overwriting only newly changed or installed adapters.
|
||||||
|
|
|
||||||
|
|
@ -232,7 +232,7 @@ function! vimspector#CompleteExpr( ArgLead, CmdLine, CursorPos ) abort
|
||||||
\ "\n" )
|
\ "\n" )
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! vimspector#Install( ... ) abort
|
function! vimspector#Install( bang, ... ) abort
|
||||||
if !s:enabled
|
if !s:enabled
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
@ -243,6 +243,7 @@ function! vimspector#Install( ... ) abort
|
||||||
py3 __import__( 'vimspector',
|
py3 __import__( 'vimspector',
|
||||||
\ fromlist = [ 'installer' ] ).installer.RunInstaller(
|
\ fromlist = [ 'installer' ] ).installer.RunInstaller(
|
||||||
\ vim.eval( 'prefix' ),
|
\ vim.eval( 'prefix' ),
|
||||||
|
\ vim.eval( 'a:bang' ) == '!',
|
||||||
\ *vim.eval( 'a:000' ) )
|
\ *vim.eval( 'a:000' ) )
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
@ -256,7 +257,7 @@ function! vimspector#CompleteInstall( ArgLead, CmdLine, CursorPos ) abort
|
||||||
\ . ')' )
|
\ . ')' )
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! vimspector#Update( ... ) abort
|
function! vimspector#Update( bang, ... ) abort
|
||||||
if !s:enabled
|
if !s:enabled
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
@ -265,6 +266,7 @@ function! vimspector#Update( ... ) abort
|
||||||
py3 __import__( 'vimspector',
|
py3 __import__( 'vimspector',
|
||||||
\ fromlist = [ 'installer' ] ).installer.RunUpdate(
|
\ fromlist = [ 'installer' ] ).installer.RunUpdate(
|
||||||
\ vim.eval( 'prefix' ),
|
\ vim.eval( 'prefix' ),
|
||||||
|
\ vim.eval( 'a:bang' ) == '!',
|
||||||
\ *vim.eval( 'a:000' ) )
|
\ *vim.eval( 'a:000' ) )
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,12 +99,12 @@ command! -bar
|
||||||
\ call vimspector#Reset()
|
\ call vimspector#Reset()
|
||||||
|
|
||||||
" Installer commands
|
" Installer commands
|
||||||
command! -bar -nargs=* -complete=custom,vimspector#CompleteInstall
|
command! -bar -bang -nargs=* -complete=custom,vimspector#CompleteInstall
|
||||||
\ VimspectorInstall
|
\ VimspectorInstall
|
||||||
\ call vimspector#Install( <f-args> )
|
\ call vimspector#Install( <q-bang>, <f-args> )
|
||||||
command! -bar -nargs=*
|
command! -bar -bang -nargs=*
|
||||||
\ VimspectorUpdate
|
\ VimspectorUpdate
|
||||||
\ call vimspector#Update( <f-args> )
|
\ call vimspector#Update( <q-bang>, <f-args> )
|
||||||
command! -bar -nargs=0
|
command! -bar -nargs=0
|
||||||
\ VimspectorAbortInstall
|
\ VimspectorAbortInstall
|
||||||
\ call vimspector#AbortInstall()
|
\ call vimspector#AbortInstall()
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,7 @@ class DebugSession( object ):
|
||||||
|
|
||||||
installer.RunInstaller(
|
installer.RunInstaller(
|
||||||
self._api_prefix,
|
self._api_prefix,
|
||||||
|
False, # Don't leave open
|
||||||
*shlex.split( response ),
|
*shlex.split( response ),
|
||||||
then = lambda: self.Start( new_launch_variables ) )
|
then = lambda: self.Start( new_launch_variables ) )
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ def PathToAnyWorkingPython3():
|
||||||
raise RuntimeError( "Unable to find a working python3" )
|
raise RuntimeError( "Unable to find a working python3" )
|
||||||
|
|
||||||
|
|
||||||
def RunInstaller( api_prefix, *args, **kwargs ):
|
def RunInstaller( api_prefix, leave_open, *args, **kwargs ):
|
||||||
from vimspector import utils, output, settings
|
from vimspector import utils, output, settings
|
||||||
import vim
|
import vim
|
||||||
|
|
||||||
|
|
@ -125,7 +125,8 @@ def RunInstaller( api_prefix, *args, **kwargs ):
|
||||||
|
|
||||||
def handler( exit_code ):
|
def handler( exit_code ):
|
||||||
if exit_code == 0:
|
if exit_code == 0:
|
||||||
_ResetInstaller()
|
if not leave_open:
|
||||||
|
_ResetInstaller()
|
||||||
utils.UserMessage( "Vimspector gadget installation complete!" )
|
utils.UserMessage( "Vimspector gadget installation complete!" )
|
||||||
vim.command( 'silent doautocmd User VimspectorInstallSuccess' )
|
vim.command( 'silent doautocmd User VimspectorInstallSuccess' )
|
||||||
if 'then' in kwargs:
|
if 'then' in kwargs:
|
||||||
|
|
@ -143,7 +144,7 @@ def RunInstaller( api_prefix, *args, **kwargs ):
|
||||||
OUTPUT_VIEW.ShowOutput( 'Installer' )
|
OUTPUT_VIEW.ShowOutput( 'Installer' )
|
||||||
|
|
||||||
|
|
||||||
def RunUpdate( api_prefix, *args ):
|
def RunUpdate( api_prefix, leave_open, *args ):
|
||||||
from vimspector import utils
|
from vimspector import utils
|
||||||
Configure( vimspector_base = utils.GetVimspectorBase() )
|
Configure( vimspector_base = utils.GetVimspectorBase() )
|
||||||
|
|
||||||
|
|
@ -153,7 +154,7 @@ def RunUpdate( api_prefix, *args ):
|
||||||
args.extend( FindGadgetForAdapter( adapter_name ) )
|
args.extend( FindGadgetForAdapter( adapter_name ) )
|
||||||
|
|
||||||
if args:
|
if args:
|
||||||
RunInstaller( api_prefix, *args )
|
RunInstaller( api_prefix, leave_open, *args )
|
||||||
|
|
||||||
|
|
||||||
def _ResetInstaller():
|
def _ResetInstaller():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue