Don't try to expand variables that are not expandable

This commit is contained in:
Ben Jackson 2018-05-27 23:59:36 +01:00
commit 0a19048311
2 changed files with 17 additions and 8 deletions

View file

@ -39,7 +39,7 @@ class DebugSession( object ):
self._uiTab = None
self._threadsBuffer = None # TODO: Move to stack trace
self._outputBuffer = None
self._outputBuffer = None # TODO: Need something less terrible here
self._stackTraceView = None
self._variablesView = None

View file

@ -140,16 +140,25 @@ class VariablesView( object ):
return
variable = self._line_to_variable[ current_line ]
if '_variables' in variable:
# Collapse
del variable[ '_variables' ]
self._DrawScopesAndWatches()
else:
self._connection.DoRequest( partial( self._ConsumeVariables, variable ), {
'command': 'variables',
'arguments': {
'variablesReference': variable[ 'variablesReference' ]
},
} )
return
# Expand. (only if there is anything to expand)
if 'variablesReference' not in variable:
return
if variable[ 'variablesReference' ] <= 0:
return
self._connection.DoRequest( partial( self._ConsumeVariables, variable ), {
'command': 'variables',
'arguments': {
'variablesReference': variable[ 'variablesReference' ]
},
} )
def _DrawVariables( self, variables, indent ):
for variable in variables: