removing old balloon code

This commit is contained in:
dsych 2021-02-07 16:41:05 -05:00 committed by Ben Jackson
commit ae137ecdd0
3 changed files with 2 additions and 75 deletions

View file

@ -541,11 +541,11 @@ class DebugSession( object ):
@IfConnected()
def ShowTooltip( self, winnr, expression, is_hover ):
"""Proxy: ballonexpr -> variables.ShowBallon"""
"""Proxy: ballonexpr -> variables.ShowTooltip"""
frame = self._stackTraceView.GetCurrentFrame()
# Check if RIP is in a frame
if frame is None:
self._logger.debug( 'Balloon: Not in a stack frame' )
self._logger.debug( 'Tooltip: Not in a stack frame' )
return ''
# Check if cursor in code window
@ -561,25 +561,6 @@ class DebugSession( object ):
def _CleanUpTooltip( self ):
return self._variablesView._CleanUpTooltip()
@IfConnected()
def ShowBalloon( self, winnr, expression ):
"""Proxy: ballonexpr -> variables.ShowBallon"""
frame = self._stackTraceView.GetCurrentFrame()
# Check if RIP is in a frame
if frame is None:
self._logger.debug( 'Balloon: Not in a stack frame' )
return ''
# Check if cursor in code window
if winnr != int( self._codeView._window.number ):
self._logger.debug( 'Winnr %s is not the code window %s',
winnr,
self._codeView._window.number )
return ''
# Return variable aware function
return self._variablesView.ShowBalloon( frame, expression )
@IfConnected()
def ExpandFrameOrThread( self ):
self._stackTraceView.ExpandFrameOrThread()

View file

@ -616,43 +616,6 @@ class VariablesView( object ):
draw()
def ShowBalloon( self, frame, expression ):
"""Callback to display variable under cursor `:h ballonexpr`"""
if not self._connection:
return ''
def handler( message ):
# TODO: this result count be expandable, but we have no way to allow the
# user to interact with the balloon to expand it, unless we use a popup
# instead, but even then we don't really want to trap the cursor.
body = message[ 'body' ]
result = body[ 'result' ]
if result is None:
result = 'null'
display = [
'Type: ' + body.get( 'type', '<unknown>' ),
'Value: ' + result
]
utils.DisplayBalloon( self._is_term, display )
def failure_handler( reason, message ):
display = [ reason ]
utils.DisplayBalloon( self._is_term, display )
# Send async request
self._connection.DoRequest( handler, {
'command': 'evaluate',
'arguments': {
'expression': expression,
'frameId': frame[ 'id' ],
'context': 'hover',
}
}, failure_handler )
# Return working (meanwhile)
return '...'
def SetSyntax( self, syntax ):
# TODO: Switch to View.syntax
self._current_syntax = utils.SetSyntax( self._current_syntax,