Handle boolean responses from ycmd

Fix ServerReady, ServerRunning, and ServerTerminated subcommands from
C♯ completer.
This commit is contained in:
micbou 2015-11-28 16:20:51 +01:00
parent 2de2f0df8d
commit 13aeaa37a8

View File

@ -60,17 +60,23 @@ class CommandRequest( BaseRequest ):
def RunPostCommandActionsIfNeeded( self ):
if not self.Done() or not self._response:
if not self.Done() or self._response is None:
return
if isinstance( self._response, bool ):
return self._HandleBooleanResponse()
if self._is_goto_command:
self._HandleGotoResponse()
elif self._is_fixit_command:
self._HandleFixitResponse()
elif 'message' in self._response:
self._HandleMessageResponse()
elif 'detailed_info' in self._response:
self._HandleDetailedInfoResponse()
return self._HandleGotoResponse()
if self._is_fixit_command:
return self._HandleFixitResponse()
if 'message' in self._response:
return self._HandleMessageResponse()
if 'detailed_info' in self._response:
return self._HandleDetailedInfoResponse()
def _HandleGotoResponse( self ):
@ -97,6 +103,12 @@ class CommandRequest( BaseRequest ):
+ " changes" )
def _HandleBooleanResponse( self ):
if self._response:
return vimsupport.EchoText( 'Yes' )
vimsupport.EchoText( 'No' )
def _HandleMessageResponse( self ):
vimsupport.EchoText( self._response[ 'message' ] )