예제 #1
0
    def ShowDetailedDiagnostic(self):
        detailed_diagnostic = BaseRequest.PostDataToHandler(
            BuildRequestData(), 'detailed_diagnostic')

        if 'message' in detailed_diagnostic:
            vimsupport.PostVimMessage(detailed_diagnostic['message'],
                                      warning=False)
예제 #2
0
 def GetDefinedSubcommands(self):
     if self.IsServerAlive():
         try:
             return BaseRequest.PostDataToHandler(BuildRequestData(),
                                                  'defined_subcommands')
         except ServerError:
             return []
     else:
         return []
예제 #3
0
 def ShowDetailedDiagnostic(self):
     if not self.IsServerAlive():
         return
     try:
         debug_info = BaseRequest.PostDataToHandler(BuildRequestData(),
                                                    'detailed_diagnostic')
         if 'message' in debug_info:
             vimsupport.EchoText(debug_info['message'])
     except ServerError as e:
         vimsupport.PostVimMessage(str(e))
예제 #4
0
    def ShowDetailedDiagnostic(self):
        if not self.IsServerAlive():
            return
        with HandleServerException():
            detailed_diagnostic = BaseRequest.PostDataToHandler(
                BuildRequestData(), 'detailed_diagnostic')

            if 'message' in detailed_diagnostic:
                vimsupport.PostVimMessage(detailed_diagnostic['message'],
                                          warning=False)
예제 #5
0
    def FilterAndSortCandidatesInner(self, candidates, sort_property, query):
        request_data = {
            'candidates': candidates,
            'sort_property': sort_property,
            'query': query
        }

        response = BaseRequest.PostDataToHandler(request_data,
                                                 'filter_and_sort_candidates')
        return response if response is not None else candidates
예제 #6
0
    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
예제 #7
0
    def DebugInfo(self):
        if self.IsServerAlive():
            debug_info = BaseRequest.PostDataToHandler(BuildRequestData(),
                                                       'debug_info')
        else:
            debug_info = 'Server crashed, no debug info from server'
        debug_info += '\nServer running at: {0}'.format(
            BaseRequest.server_location)
        debug_info += '\nServer process ID: {0}'.format(self._server_popen.pid)
        if self._server_stderr or self._server_stdout:
            debug_info += '\nServer logfiles:\n  {0}\n  {1}'.format(
                self._server_stdout, self._server_stderr)

        return debug_info
예제 #8
0
 def GetDefinedSubcommands(self):
     with HandleServerException():
         return BaseRequest.PostDataToHandler(BuildRequestData(),
                                              'defined_subcommands')
     return []
예제 #9
0
def _IgnoreExtraConfFile(filepath):
    BaseRequest.PostDataToHandler({'filepath': filepath},
                                  'ignore_extra_conf_file')
예제 #10
0
def _LoadExtraConfFile(filepath):
    BaseRequest.PostDataToHandler({'filepath': filepath},
                                  'load_extra_conf_file')
예제 #11
0
 def GetDefinedSubcommands(self):
     if self._IsServerAlive():
         return BaseRequest.PostDataToHandler(BuildRequestData(),
                                              'defined_subcommands')
     else:
         return []
예제 #12
0
 def GetDefinedSubcommands( self ):
   request = BaseRequest()
   subcommands = request.PostDataToHandler( BuildRequestData(),
                                            'defined_subcommands' )
   return subcommands if subcommands else []