def get_diagnostics(self, response):
     """ Get diagnostics in the json from response from YCMD.
     This function raises the exceptions that YCMD may have or resulted from
     the requests future.
     The dialog if YCMD wants to load an .ycm_extra_conf.py file is also
     handled here.
     """
     try:
         return YCMDRequest.json_from_response(response)
     except responses.UnknownExtraConf as error:
         if sublime.ok_cancel_dialog("Do you want to load {0}?".format(
                 error.extra_conf_file)):
             YCMDEventNotification.load_extra_conf_file(
                 error.extra_conf_file) #This is a blocking call
             # Parse the file again, because YCMD does not do it.
             view = sublime_support.find_view_by_buffer_id(
                 self._sublime_buffer_id)
             YCMDEventNotification("FileReadyToParse", sublime_view=view)
         else:
             YCMDEventNotification.ignore_extra_conf_file(
                 error.extra_conf_file)
         return []
 def get_diagnostics(self, response):
     """ Get diagnostics in the json from response from YCMD.
     This function raises the exceptions that YCMD may have or resulted from
     the requests future.
     The dialog if YCMD wants to load an .ycm_extra_conf.py file is also
     handled here.
     """
     try:
         return YCMDRequest.json_from_response(response)
     except responses.UnknownExtraConf as error:
         if sublime.ok_cancel_dialog("Do you want to load {0}?".format(
                 error.extra_conf_file)):
             YCMDEventNotification.load_extra_conf_file(
                 error.extra_conf_file)  #This is a blocking call
             # Parse the file again, because YCMD does not do it.
             view = sublime_support.find_view_by_buffer_id(
                 self._sublime_buffer_id)
             YCMDEventNotification("FileReadyToParse", sublime_view=view)
         else:
             YCMDEventNotification.ignore_extra_conf_file(
                 error.extra_conf_file)
         return []
 def handle_FileReadyToParse_response(self, response):
     """ Display the diagnostics returned by YCMD. """
     view = sublime_support.find_view_by_buffer_id(self._sublime_buffer_id)
     if view:
         sublime_support.show_ycmd_diagnostics(view,
             self.get_diagnostics(response))
 def handle_FileReadyToParse_response(self, response):
     """ Display the diagnostics returned by YCMD. """
     view = sublime_support.find_view_by_buffer_id(self._sublime_buffer_id)
     if view:
         sublime_support.show_ycmd_diagnostics(
             view, self.get_diagnostics(response))