Preserve expand/collapse state of variables and watches

This is starting to get horribly hacky and needs refactoring into
proper classes. Expandable variables now have the following additional
magic properties:

- '_expanded': True (expanded), False (collapsed), none = no preference
- '_variables': Current of child variables
- '_old_variables': The previous state of the '_variables' list when
                    refreshing

Remember that '_result' (the magic property of a watch expression) is
also treated like an expandable variable, so also has these magic
parameters.
This commit is contained in:
Ben Jackson 2018-06-05 21:49:29 +01:00
commit 1f4f1a1fcc
2 changed files with 83 additions and 12 deletions

View file

@ -304,7 +304,8 @@ class DebugSession( object ):
self.SetCurrentFrame( None )
def SetCurrentFrame( self, frame ):
ret = self._codeView.SetCurrentFrame( frame )
if not self._codeView.SetCurrentFrame( frame ):
return False
if frame:
self._variablesView.LoadScopes( frame )
@ -313,7 +314,7 @@ class DebugSession( object ):
self._stackTraceView.Clear()
self._variablesView.Clear()
return ret
return True
def _StartDebugAdapter( self ):
self._logger.info( 'Starting debug adapter with: {0}'.format( json.dumps(