From f4ecb1a5bd6ce7ac9da51ac3076a1d5a1d1ef1e3 Mon Sep 17 00:00:00 2001 From: arimu1 <19286898+arimu1@users.noreply.github.com> Date: Sat, 1 Aug 2026 16:56:41 +0700 Subject: [PATCH] fix(ls): re-raise LS termination from pull-diagnostics fallback request_text_document_diagnostics swallowed all SolidLSPException from textDocument/diagnostic and fell back to published diagnostics. When the process had already died, that bypassed tools_base restart-and-retry and silently returned empty diagnostics. Re-raise when is_language_server_terminated(); keep the published- diagnostics fallback for other pull-diagnostics failures. Fixes #1770 --- CHANGELOG.md | 3 +++ src/solidlsp/ls.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8284b3e2..cf014908 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,9 @@ Status of the `main` branch. Changes prior to the next official version change w and the request used to map diagnostics onto owning symbols just threw. `AnsibleLanguageServer` now overrides that request to return `None` directly, so diagnostics fall back to being grouped under the file-level path as already documented #1758 + - Fix: pull-diagnostics fallback in `request_text_document_diagnostics` no longer swallows + `LanguageServerTerminatedException`, so a crash during a diagnostics pull triggers the existing + language-server restart path instead of silently returning no diagnostics #1770 - Fix: F#'s `module ` declarations reported a `selectionRange` pointing at the `module` keyword instead of at ``, so looking up hover/references from a module symbol's position returned the keyword's own docs instead of the module's #925 diff --git a/src/solidlsp/ls.py b/src/solidlsp/ls.py index f76bb5fe..1d117dba 100644 --- a/src/solidlsp/ls.py +++ b/src/solidlsp/ls.py @@ -966,6 +966,11 @@ class SolidLanguageServer(ABC): } ) except SolidLSPException as ex: + # Termination must propagate so tools_base can restart the LS and retry. + # Other pull-diagnostics failures (e.g. unsupported method without crash) + # still fall back to published diagnostics. + if ex.is_language_server_terminated(): + raise log.debug("Falling back to published diagnostics for %s due to pull-diagnostics error: %s", relative_file_path, ex) response = None pull_diagnostics_failed = True