From 54263fdd02256bad9f289a91a768b870055dd87c Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Thu, 5 Oct 2023 12:11:18 +0800 Subject: [PATCH] Notice user if got error message from lsp server. --- core/lspserver.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/lspserver.py b/core/lspserver.py index 3d67e6374f..9747b9ec07 100755 --- a/core/lspserver.py +++ b/core/lspserver.py @@ -559,6 +559,14 @@ def handle_recv_message(self, message: dict): if self.enable_diagnostics and is_in_path_dict(self.files, filepath): get_from_path_dict(self.files, filepath).record_diagnostics(message["params"]["diagnostics"], self.server_info["name"]) + # Notice user if got error message from lsp server. + if "method" in message and message["method"] == "window/logMessage": + try: + if "error" in message["params"]["message"].lower(): + message_emacs("{} ({}): {}".format(self.project_name, self.server_info["name"], message["params"]["message"])) + except: + pass + logger.debug(json.dumps(message, indent=3)) if "id" in message: