Пример #1
0
  def OnFileReadyToParse( self, request_data ):
    solutioncompleter = self._GetSolutionCompleter( request_data )

    # Only start the server associated to this solution if the option to
    # automatically start one is set and no server process is already running.
    if ( self.user_options[ 'auto_start_csharp_server' ]
         and not solutioncompleter._ServerIsRunning() ):
      solutioncompleter._StartServer()
      return

    # Bail out if the server is unresponsive. We don't start or restart the
    # server in this case because current one may still be warming up.
    if not solutioncompleter.ServerIsHealthy():
      return

    errors = solutioncompleter.CodeCheck( request_data )

    diagnostics = [ self._QuickFixToDiagnostic( request_data, x ) for x in
                    errors[ "QuickFixes" ] ]

    self._diagnostic_store = DiagnosticsToDiagStructure( diagnostics )

    return responses.BuildDiagnosticResponse( diagnostics,
                                              request_data[ 'filepath' ],
                                              self.max_diagnostics_to_display )
Пример #2
0
    def OnFileReadyToParse(self, request_data):
        self._Reload(request_data)

        diagnostics = self.GetDiagnosticsForCurrentFile(request_data)
        filepath = request_data['filepath']
        with self._latest_diagnostics_for_file_lock:
            self._latest_diagnostics_for_file[filepath] = diagnostics
        return responses.BuildDiagnosticResponse(
            diagnostics, filepath, self.max_diagnostics_to_display)
Пример #3
0
    def OnFileReadyToParse(self, request_data):
        # Only load the extra conf. We don't need it for anything but Format.
        extra_conf_store.ModuleFileForSourceFile(request_data['filepath'])
        self._Reload(request_data)

        diagnostics = self.GetDiagnosticsForCurrentFile(request_data)
        filepath = request_data['filepath']
        with self._latest_diagnostics_for_file_lock:
            self._latest_diagnostics_for_file[filepath] = diagnostics
        return responses.BuildDiagnosticResponse(
            diagnostics, filepath, self.max_diagnostics_to_display)
Пример #4
0
    def OnFileReadyToParse(self, request_data):
        flags, filename = self._FlagsForRequest(request_data)
        if not flags:
            raise ValueError(NO_COMPILE_FLAGS_MESSAGE)

        with self._files_being_compiled.GetExclusive(filename):
            diagnostics = self._completer.UpdateTranslationUnit(
                filename, self.GetUnsavedFilesVector(request_data), flags)

        diagnostics = _FilterDiagnostics(diagnostics)
        self._diagnostic_store = DiagnosticsToDiagStructure(diagnostics)
        return responses.BuildDiagnosticResponse(
            diagnostics, request_data['filepath'],
            self.max_diagnostics_to_display)