Esempio n. 1
0
 def DebugInfo(self):
     debug_info = ''
     if self._client_logfile:
         debug_info += 'Client logfile: {0}\n'.format(self._client_logfile)
     extra_data = {}
     self._AddExtraConfDataIfNeeded(extra_data)
     debug_info += FormatDebugInfoResponse(SendDebugInfoRequest(extra_data))
     debug_info += 'Server running at: {0}\n'.format(
         BaseRequest.server_location)
     if self._server_popen:
         debug_info += 'Server process ID: {0}\n'.format(
             self._server_popen.pid)
     if self._server_stdout and self._server_stderr:
         debug_info += ('Server logfiles:\n'
                        '  {0}\n'
                        '  {1}'.format(self._server_stdout,
                                       self._server_stderr))
     return debug_info
Esempio n. 2
0
 def test_FormatDebugInfoResponse_Completer_ServerNotRunningWithNoLogfiles(
     self ):
   response = deepcopy( GENERIC_RESPONSE )
   response[ 'completer' ][ 'servers' ][ 0 ].update( {
     'is_running': False,
     'logfiles': []
   } )
   assert_that(
     FormatDebugInfoResponse( response ),
     contains_string(
       'Completer name completer debug information:\n'
       '  Server name not running\n'
       '  Server name executable: /path/to/executable\n'
       '  No logfiles available\n'
       '  Server name key: value\n'
       '  Key: value\n'
     )
   )
Esempio n. 3
0
 def test_FormatDebugInfoResponse_Completer_ServerRunningWithoutHost( self ):
   response = deepcopy( GENERIC_RESPONSE )
   response[ 'completer' ][ 'servers' ][ 0 ].update( {
     'address': None,
     'port': None
   } )
   assert_that(
     FormatDebugInfoResponse( response ),
     contains_string(
       'Completer name completer debug information:\n'
       '  Server name running\n'
       '  Server name process ID: 12345\n'
       '  Server name executable: /path/to/executable\n'
       '  Server name logfiles:\n'
       '    /path/to/stdout/logfile\n'
       '    /path/to/stderr/logfile\n'
       '  Server name key: value\n'
       '  Key: value\n'
     )
   )
Esempio n. 4
0
 def DebugInfo( self ):
   debug_info = ''
   if self._client_logfile:
     debug_info += f'Client logfile: { self._client_logfile }\n'
   extra_data = {}
   self._AddExtraConfDataIfNeeded( extra_data )
   debug_info += FormatDebugInfoResponse( SendDebugInfoRequest( extra_data ) )
   debug_info += f'Server running at: { BaseRequest.server_location }\n'
   if self._server_popen:
     debug_info += f'Server process ID: { self._server_popen.pid }\n'
   if self._server_stdout and self._server_stderr:
     debug_info += ( 'Server logfiles:\n'
                     f'  { self._server_stdout }\n'
                     f'  { self._server_stderr }' )
   debug_info += ( '\nSemantic highlighting supported: ' +
                   str( not vimsupport.VimIsNeovim() ) )
   debug_info += ( '\nVirtual text supported: ' +
                   str( vimsupport.VimSupportsVirtualText() ) )
   debug_info += ( '\nPopup windows supported: ' +
                   str( vimsupport.VimSupportsPopupWindows() ) )
   return debug_info
def FormatDebugInfoResponse_NoExtraConf_test():
    response = deepcopy(GENERIC_RESPONSE)
    response['extra_conf'].update({'is_loaded': False, 'path': None})
    assert_that(FormatDebugInfoResponse(response),
                contains_string('No extra configuration file found\n'))
def FormatDebugInfoResponse_NoResponse_test():
    assert_that(FormatDebugInfoResponse(None),
                equal_to('Server errored, no debug info from server\n'))