Implement command line completion for watch/eval

This commit is contained in:
Ben Jackson 2020-01-17 00:02:24 +00:00
commit 355f0f0e0c
4 changed files with 53 additions and 3 deletions

View file

@ -406,6 +406,26 @@ class DebugSession( object ):
def GetOutputBuffers( self ):
return self._outputView.GetCategories()
def GetCompletionsSync( self, text_line, column_in_bytes ):
if not self._server_capabilities.get( 'supportsCompletionsRequest' ):
return []
response = self._connection.DoRequestSync( {
'command': 'completions',
'arguments': {
'frameId': self._stackTraceView.GetCurrentFrame()[ 'id' ],
# TODO: encoding ? bytes/codepoints
'text': text_line,
'column': column_in_bytes
}
} )
# TODO:
# - start / length
# - sortText
return [ i.get( 'text' ) or i[ 'label' ]
for i in response[ 'body' ][ 'targets' ] ]
def _SetUpUI( self ):
vim.command( 'tabnew' )
self._uiTab = vim.current.tabpage