From f9ff34e235a9bdffceee14e5cebae6c57e729fbf Mon Sep 17 00:00:00 2001 From: Sarthak Khattar Date: Wed, 9 Jun 2021 22:21:18 +0530 Subject: [PATCH] rebased with small changes --- client/commands/v2/pysa_server.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/commands/v2/pysa_server.py b/client/commands/v2/pysa_server.py index 98d3ce5ed84..26c13376757 100644 --- a/client/commands/v2/pysa_server.py +++ b/client/commands/v2/pysa_server.py @@ -29,6 +29,7 @@ _read_lsp_request, try_initialize, _log_lsp_event, + _publish_diagnostics, InitializationExit, InitializationSuccess, InitializationFailure, @@ -139,9 +140,7 @@ async def show_model_errors_to_client( self, diagnostics: Dict[Path, List[lsp.Diagnostic]] ) -> None: for path, diagnostic in diagnostics.items(): - await _publish_diagnostics(self.output_channel, path, []) - if diagnostic is not None: - await _publish_diagnostics(self.output_channel, path, diagnostic) + await _publish_diagnostics(self.output_channel, path, diagnostic or []) async def wait_for_exit(self) -> int: while True: