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