Beispiel #1
0
  def RawResponse( self ):
    if not self._response_future:
      return []
    with HandleServerException( truncate = True ):
      response = JsonFromFuture( self._response_future )

      errors = response[ 'errors' ] if 'errors' in response else []
      for e in errors:
        with HandleServerException( truncate = True ):
          raise MakeServerException( e )

      return response[ 'completions' ]
    return []
    def ShowDetailedDiagnostic(self):
        with HandleServerException():
            detailed_diagnostic = BaseRequest.PostDataToHandler(
                BuildRequestData(), 'detailed_diagnostic')

            if 'message' in detailed_diagnostic:
                vimsupport.PostVimMessage(detailed_diagnostic['message'],
                                          warning=False)
Beispiel #3
0
 def Start(self):
     request_data = BuildRequestData()
     if self._extra_data:
         request_data.update(self._extra_data)
     request_data.update({
         'completer_target': self._completer_target,
         'command_arguments': self._arguments
     })
     with HandleServerException():
         self._response = self.PostDataToHandler(request_data,
                                                 'run_completer_command')
    def Response(self):
        if self._cached_response:
            return self._cached_response

        if not self._response_future or self._event_name != 'FileReadyToParse':
            return []

        with HandleServerException(truncate=True):
            self._cached_response = JsonFromFuture(self._response_future)

        return self._cached_response if self._cached_response else []
  def FilterAndSortCandidatesInner( self, candidates, sort_property, query ):
    request_data = {
      'candidates': candidates,
      'sort_property': sort_property,
      'query': query
    }

    with HandleServerException():
      return BaseRequest.PostDataToHandler( request_data,
                                            'filter_and_sort_candidates' )
    return candidates
 def Start( self ):
   request_data = BuildRequestData()
   if self._extra_data:
     request_data.update( self._extra_data )
   with HandleServerException( display = False ):
     self._response = self.PostDataToHandler( request_data, 'debug_info' )
 def GetDefinedSubcommands(self):
     with HandleServerException():
         return BaseRequest.PostDataToHandler(BuildRequestData(),
                                              'defined_subcommands')
     return []
 def IsServerReady(self):
     if not self._server_is_ready_with_cache and self.IsServerAlive():
         with HandleServerException(display=False):
             self._server_is_ready_with_cache = BaseRequest.GetDataFromHandler(
                 'ready')
     return self._server_is_ready_with_cache
 def Start( self ):
   with HandleServerException( display = False ):
     self.PostDataToHandler( {}, 'shutdown', TIMEOUT_SECONDS )
    def _ThreadMain(self):
        while True:
            time.sleep(self._ping_interval_seconds)

            with HandleServerException(display=False):
                BaseRequest.GetDataFromHandler('healthy')
Beispiel #11
0
 def Start(self):
     request_data = BuildRequestData()
     request_data.update({'filetypes': self.filetypes})
     with HandleServerException():
         self._response = self.PostDataToHandler(
             request_data, 'semantic_completion_available')