From e38d145a47bb692bfd89d5d80e0f71e3ec68f9a6 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Fri, 27 Sep 2013 17:26:14 -0700 Subject: [PATCH] Added debug info about the server Location where running + logfiles location --- python/ycm/server/ycmd.py | 7 +++++-- python/ycm/youcompleteme.py | 14 +++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/python/ycm/server/ycmd.py b/python/ycm/server/ycmd.py index 609243d7..2730e56f 100755 --- a/python/ycm/server/ycmd.py +++ b/python/ycm/server/ycmd.py @@ -143,8 +143,11 @@ def DebugInfo(): output.append( ycm_core.ClangVersion() ) request_data = request.json - output.append( - _GetCompleterForRequestData( request_data ).DebugInfo( request_data) ) + try: + output.append( + _GetCompleterForRequestData( request_data ).DebugInfo( request_data) ) + except: + pass return _JsonResponse( '\n'.join( output ) ) diff --git a/python/ycm/youcompleteme.py b/python/ycm/youcompleteme.py index 44146ec1..78ee83cf 100644 --- a/python/ycm/youcompleteme.py +++ b/python/ycm/youcompleteme.py @@ -84,7 +84,7 @@ class YouCompleteMe( object ): self._server_popen = subprocess.Popen( command, stdout = fstdout, stderr = fstderr, - shell = False ) + shell = True ) def CreateCompletionRequest( self ): @@ -202,8 +202,16 @@ class YouCompleteMe( object ): def DebugInfo( self ): - return BaseRequest.PostDataToHandler( BuildRequestData(), - 'debug_info' ) + debug_info = BaseRequest.PostDataToHandler( BuildRequestData(), + 'debug_info' ) + debug_info += '\nServer running at: {}'.format( + BaseRequest.server_location ) + if self._server_stderr or self._server_stdout: + debug_info += '\nServer logfiles:\n {}\n {}'.format( + self._server_stdout, + self._server_stderr ) + + return debug_info def CurrentFiletypeCompletionEnabled( self ):