Remember user choices
There are 2 things we ask for input for: - input variables - exception breakpoints It's irritating to have to repeat yourself when going through the edit/debug loop. Howver, cacheing has some quirks and disadvantages - they key one being when to clear the cache. To resolve this we take two slightly different approaches: 1. For input variables, we remember the choice of the user, but present that only as the default, so they can just hit enter to accept it. We already rememeber the choices for the length of the debug session (i.e. across 'restart' calls). 2. For exception breakpoints, we remember the choices for as long as the current session is running. This allows users to hit the 'restart' button without being prompted at all. Meanwhile, we also remove the (broken) support for exception breakpoint matchers and state the server default for exception breakpoint filters.
This commit is contained in:
parent
f29c5ae902
commit
b64946e34c
4 changed files with 69 additions and 50 deletions
|
|
@ -34,6 +34,9 @@ VIMSPECTOR_HOME = os.path.abspath( os.path.join( os.path.dirname( __file__ ),
|
|||
'..',
|
||||
'..' ) )
|
||||
|
||||
# cache of what the user entered for any option we ask them
|
||||
USER_CHOICES = {}
|
||||
|
||||
|
||||
class DebugSession( object ):
|
||||
def __init__( self ):
|
||||
|
|
@ -148,14 +151,26 @@ class DebugSession( object ):
|
|||
}
|
||||
self._variables.update(
|
||||
utils.ParseVariables( adapter.get( 'variables', {} ),
|
||||
self._variables ) )
|
||||
self._variables,
|
||||
USER_CHOICES ) )
|
||||
self._variables.update(
|
||||
utils.ParseVariables( configuration.get( 'variables', {} ),
|
||||
self._variables ) )
|
||||
self._variables,
|
||||
USER_CHOICES ) )
|
||||
|
||||
# Pretend that vars passed to the launch command were typed in by the user
|
||||
# (they may have been in theory)
|
||||
# TODO: Is it right that we do this _after_ ParseVariables, rather than
|
||||
# before ?
|
||||
USER_CHOICES.update( launch_variables )
|
||||
self._variables.update( launch_variables )
|
||||
|
||||
utils.ExpandReferencesInDict( configuration, self._variables )
|
||||
utils.ExpandReferencesInDict( adapter, self._variables )
|
||||
utils.ExpandReferencesInDict( configuration,
|
||||
self._variables,
|
||||
USER_CHOICES )
|
||||
utils.ExpandReferencesInDict( adapter,
|
||||
self._variables,
|
||||
USER_CHOICES )
|
||||
|
||||
if not adapter:
|
||||
utils.UserMessage( 'No adapter configured for {}'.format(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue