Print server capabilities in a readable way

This commit is contained in:
Ben Jackson 2021-03-05 21:19:37 +00:00
commit af57d2dbdb
2 changed files with 6 additions and 2 deletions

View file

@ -1049,6 +1049,10 @@ class DebugSession( object ):
#
def handle_initialize_response( msg ):
self._server_capabilities = msg.get( 'body' ) or {}
self._outputView.Print(
'server',
'Server Capabilities:\n' + json.dumps( self._server_capabilities,
indent = 2 ) )
self._breakpoints.SetServerCapabilities( self._server_capabilities )
self._variablesView.SetServerCapabilities( self._server_capabilities )
self._Launch()

View file

@ -64,8 +64,8 @@ class OutputView( object ):
self._api_prefix = api_prefix
VIEWS.add( self )
def Print( self, categroy, text ):
self._Print( 'server', text.splitlines() )
def Print( self, category, text ):
self._Print( category, text.splitlines() )
def OnOutput( self, event ):
category = CategoryToBuffer( event.get( 'category' ) or 'output' )