

def run(self):
    _logger.info('starting ResponseHandler')
    response_maker = ResponseMaker(self.server)
    try:
        for resp in response_maker.make():
            if (resp is None):
                continue
            if isinstance(resp, dict):
                if (resp.get('_internal') == _SIGNAL_STOP):
                    _logger.info('ResponseHandler exiting by internal request.')
                    return
            if isinstance(resp, Notification):
                if isinstance(resp.params, AnalysisErrorsParams):
                    after(0, actions.show_errors, AnalysisErrorsParams.from_json(resp.params.to_json().copy()))
                    continue
                if isinstance(resp.params, AnalysisNavigationParams):
                    after(0, actions.handle_navigation_data, AnalysisNavigationParams.from_json(resp.params.to_json().copy()))
                    continue
                if isinstance(resp.params, CompletionResultsParams):
                    with editor_context.autocomplete_context as actx:
                        if (actx.request_id or (resp.params.id != actx.id)):
                            actx.invalidate_results()
                            continue
                    after(0, actions.handle_completions, CompletionResultsParams.from_json(resp.params.to_json().copy()))
            if isinstance(resp, Response):
                if isinstance(resp.result, ServerGetVersionResult):
                    print('Dart: Running analysis server version', self.result.version)
                    continue
                if isinstance(resp.result, CompletionGetSuggestionsResult):
                    with editor_context.autocomplete_context as actx:
                        if (resp.id != actx.request_id):
                            continue
                        actx.id = resp.result.id
                        actx.request_id = None
                if isinstance(resp.result, EditFormatResult):
                    after(0, actions.handle_formatting, EditFormatResult.from_json(resp.result.to_json().copy()))
                    continue
    except Exception as e:
        msg = (('error in thread' + self.name) + '\n')
        msg += str(e)
        _logger.error(msg)

dataset/ETHPy150Open guillermooo/dart-sublime-bundle/lib/analyzer/analyzer.py ResponseHandler.run/VarMisuse@286/383 `resp`->`self`