From e23dd667b0a8944eba5e73c8b3070c3b1b710e4a Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Mon, 11 May 2026 16:27:52 +0200 Subject: [PATCH] Clean up: Minor improvements in logging/docstrings --- src/solidlsp/ls_process.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/solidlsp/ls_process.py b/src/solidlsp/ls_process.py index a1eeb447..8bbf6d02 100644 --- a/src/solidlsp/ls_process.py +++ b/src/solidlsp/ls_process.py @@ -193,6 +193,8 @@ class LanguageServerInterface(ABC): return self._is_stopping = True + + log.info(f"Initiating shutdown with a {timeout}s timeout...") self._stop(timeout) @abstractmethod @@ -236,7 +238,7 @@ class LanguageServerInterface(ABC): def _handle_body(self, body: bytes) -> None: """ - Parse the body text received from the language server process and invoke the appropriate handler + Parses the body text received from the language server process and invokes the appropriate handler """ try: self._receive_payload(json.loads(body)) @@ -497,11 +499,6 @@ class StdioLanguageServer(LanguageServerInterface): ).start() def _stop(self, timeout: float) -> None: - """ - A robust shutdown process designed to terminate cleanly on all platforms, including Windows, - by explicitly closing all I/O pipes. - """ - log.info(f"Initiating final robust shutdown with a {timeout}s timeout...") if self.process is None: log.debug("Server process is None, cannot shutdown.") return @@ -514,7 +511,6 @@ class StdioLanguageServer(LanguageServerInterface): except Exception as e: log.debug(f"Exception during graceful shutdown: {e}") # Ignore errors here, we are proceeding to terminate anyway. - # terminate the process terminate_process_tree_with_kill_fallback(self.process, terminate_timeout=timeout, process_name=f"LS[{self.language.value}]") finally: @@ -610,9 +606,6 @@ class StdioLanguageServer(LanguageServerInterface): log.info("Language server stderr reader thread has terminated") def _send_payload(self, payload: StringDict) -> None: - """ - Send the payload to the server by writing to its stdin asynchronously. - """ if not self.process or not self.process.stdin: return self._trace("solidlsp", "ls", payload)