Frame is not reqiured for evaluation
This commit is contained in:
parent
8d7de7172a
commit
b95fe20845
2 changed files with 14 additions and 10 deletions
|
|
@ -115,10 +115,6 @@ class OutputView( object ):
|
||||||
self._ShowOutput( category )
|
self._ShowOutput( category )
|
||||||
|
|
||||||
def Evaluate( self, frame, expression ):
|
def Evaluate( self, frame, expression ):
|
||||||
if not frame:
|
|
||||||
self.Print( 'Console', 'There is no current stack frame' )
|
|
||||||
return
|
|
||||||
|
|
||||||
console = self._buffers[ 'Console' ].buf
|
console = self._buffers[ 'Console' ].buf
|
||||||
utils.AppendToBuffer( console, 'Evaluating: ' + expression )
|
utils.AppendToBuffer( console, 'Evaluating: ' + expression )
|
||||||
|
|
||||||
|
|
@ -132,14 +128,18 @@ class OutputView( object ):
|
||||||
|
|
||||||
utils.AppendToBuffer( console, ' Result: ' + result )
|
utils.AppendToBuffer( console, ' Result: ' + result )
|
||||||
|
|
||||||
self._connection.DoRequest( print_result, {
|
request = {
|
||||||
'command': 'evaluate',
|
'command': 'evaluate',
|
||||||
'arguments': {
|
'arguments': {
|
||||||
'expression': expression,
|
'expression': expression,
|
||||||
'context': 'repl',
|
'context': 'repl',
|
||||||
'frameId': frame[ 'id' ],
|
|
||||||
}
|
}
|
||||||
} )
|
}
|
||||||
|
|
||||||
|
if frame:
|
||||||
|
request[ 'arguments' ][ 'frameId' ] = frame[ 'id' ]
|
||||||
|
|
||||||
|
self._connection.DoRequest( print_result, request )
|
||||||
|
|
||||||
def _ToggleFlag( self, category, flag ):
|
def _ToggleFlag( self, category, flag ):
|
||||||
if self._buffers[ category ].flag != flag:
|
if self._buffers[ category ].flag != flag:
|
||||||
|
|
|
||||||
|
|
@ -143,10 +143,12 @@ class VariablesView( object ):
|
||||||
|
|
||||||
def AddWatch( self, frame, expression ):
|
def AddWatch( self, frame, expression ):
|
||||||
watch = {
|
watch = {
|
||||||
'expression': expression,
|
'expression': expression,
|
||||||
'frameId': frame[ 'id' ],
|
'context': 'watch',
|
||||||
'context': 'watch',
|
|
||||||
}
|
}
|
||||||
|
if frame:
|
||||||
|
watch[ 'frameId' ] = frame[ 'id' ]
|
||||||
|
|
||||||
self._watches.append( watch )
|
self._watches.append( watch )
|
||||||
self.EvaluateWatches()
|
self.EvaluateWatches()
|
||||||
|
|
||||||
|
|
@ -395,3 +397,5 @@ class VariablesView( object ):
|
||||||
|
|
||||||
with utils.LetCurrentWindow( self._watch.win ):
|
with utils.LetCurrentWindow( self._watch.win ):
|
||||||
vim.command( 'set syntax={}'.format( utils.Escape( syntax ) ) )
|
vim.command( 'set syntax={}'.format( utils.Escape( syntax ) ) )
|
||||||
|
|
||||||
|
# vim: sw=2
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue