From 483192d51d44c39938087b1a6849f47717e59578 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Jun 2026 08:24:11 +0000 Subject: [PATCH 1/5] Initial plan From a674bd7da57752225f1ee524afc3dbde3924e5b5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Jun 2026 08:31:13 +0000 Subject: [PATCH 2/5] Increase Rust diagnostics wait on Windows --- src/solidlsp/language_servers/rust_analyzer.py | 7 +++++++ test/solidlsp/rust/test_rust_analyzer_detection.py | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/solidlsp/language_servers/rust_analyzer.py b/src/solidlsp/language_servers/rust_analyzer.py index 2e222b5a85..e75340aa74 100644 --- a/src/solidlsp/language_servers/rust_analyzer.py +++ b/src/solidlsp/language_servers/rust_analyzer.py @@ -210,6 +210,13 @@ def _create_dependency_provider(self) -> LanguageServerDependencyProvider: def is_ignored_dirname(self, dirname: str) -> bool: return super().is_ignored_dirname(dirname) or dirname in ["target"] + @override + def _get_published_diagnostics_wait_timeout(self, pull_diagnostics_failed: bool) -> float: + timeout = super()._get_published_diagnostics_wait_timeout(pull_diagnostics_failed) + if platform.system() == "Windows": + return max(timeout, 8.0) + return timeout + @staticmethod def _get_initialize_params(repository_absolute_path: str) -> InitializeParams: """ diff --git a/test/solidlsp/rust/test_rust_analyzer_detection.py b/test/solidlsp/rust/test_rust_analyzer_detection.py index fea2bb0e50..9859a39fd6 100644 --- a/test/solidlsp/rust/test_rust_analyzer_detection.py +++ b/test/solidlsp/rust/test_rust_analyzer_detection.py @@ -518,6 +518,19 @@ def test_auto_install_success_but_binary_not_found_falls_through(self): assert "searched locations" in error_message.lower() # Should show what was checked +class TestRustAnalyzerDiagnosticsTimeout: + @pytest.mark.rust + def test_windows_uses_longer_diagnostics_wait_timeout(self): + from solidlsp.language_servers.rust_analyzer import RustAnalyzer + + analyzer = RustAnalyzer.__new__(RustAnalyzer) + + with patch("platform.system", return_value="Windows"): + timeout = analyzer._get_published_diagnostics_wait_timeout(False) + + assert timeout >= 8.0 + + class TestRustAnalyzerDetectionIntegration: """ Integration tests that verify detection works on the current system. From ccafe53b53e0460a5c3539143869e335a7b0c1f6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Jun 2026 08:32:55 +0000 Subject: [PATCH 3/5] Fix timeout test patch target --- test/solidlsp/rust/test_rust_analyzer_detection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/solidlsp/rust/test_rust_analyzer_detection.py b/test/solidlsp/rust/test_rust_analyzer_detection.py index 9859a39fd6..8797646aac 100644 --- a/test/solidlsp/rust/test_rust_analyzer_detection.py +++ b/test/solidlsp/rust/test_rust_analyzer_detection.py @@ -525,7 +525,7 @@ def test_windows_uses_longer_diagnostics_wait_timeout(self): analyzer = RustAnalyzer.__new__(RustAnalyzer) - with patch("platform.system", return_value="Windows"): + with patch("solidlsp.language_servers.rust_analyzer.platform.system", return_value="Windows"): timeout = analyzer._get_published_diagnostics_wait_timeout(False) assert timeout >= 8.0 From a589e666bbd0168addffc8be785e8db838c58858 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Jun 2026 08:35:32 +0000 Subject: [PATCH 4/5] Add non-Windows Rust timeout coverage --- test/solidlsp/rust/test_rust_analyzer_detection.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/solidlsp/rust/test_rust_analyzer_detection.py b/test/solidlsp/rust/test_rust_analyzer_detection.py index 8797646aac..8de3794078 100644 --- a/test/solidlsp/rust/test_rust_analyzer_detection.py +++ b/test/solidlsp/rust/test_rust_analyzer_detection.py @@ -530,6 +530,17 @@ def test_windows_uses_longer_diagnostics_wait_timeout(self): assert timeout >= 8.0 + @pytest.mark.rust + def test_non_windows_uses_default_diagnostics_wait_timeout(self): + from solidlsp.language_servers.rust_analyzer import RustAnalyzer + + analyzer = RustAnalyzer.__new__(RustAnalyzer) + + with patch("solidlsp.language_servers.rust_analyzer.platform.system", return_value="Linux"): + timeout = analyzer._get_published_diagnostics_wait_timeout(False) + + assert timeout == 2.5 + class TestRustAnalyzerDetectionIntegration: """ From eaa930795c4659348f14aca063b76a3f1f7e4e67 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Jun 2026 09:23:23 +0000 Subject: [PATCH 5/5] Extend Rust diagnostics wait timeout across all platforms --- src/solidlsp/language_servers/rust_analyzer.py | 6 +++--- .../rust/test_rust_analyzer_detection.py | 16 +++------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/solidlsp/language_servers/rust_analyzer.py b/src/solidlsp/language_servers/rust_analyzer.py index e75340aa74..cb059f6936 100644 --- a/src/solidlsp/language_servers/rust_analyzer.py +++ b/src/solidlsp/language_servers/rust_analyzer.py @@ -213,9 +213,9 @@ def is_ignored_dirname(self, dirname: str) -> bool: @override def _get_published_diagnostics_wait_timeout(self, pull_diagnostics_failed: bool) -> float: timeout = super()._get_published_diagnostics_wait_timeout(pull_diagnostics_failed) - if platform.system() == "Windows": - return max(timeout, 8.0) - return timeout + # Rust diagnostics are often published asynchronously after the pull-diagnostics request, + # so keep a wider fallback wait window across all platforms. + return max(timeout, 8.0) @staticmethod def _get_initialize_params(repository_absolute_path: str) -> InitializeParams: diff --git a/test/solidlsp/rust/test_rust_analyzer_detection.py b/test/solidlsp/rust/test_rust_analyzer_detection.py index 8de3794078..925fb11c7b 100644 --- a/test/solidlsp/rust/test_rust_analyzer_detection.py +++ b/test/solidlsp/rust/test_rust_analyzer_detection.py @@ -520,27 +520,17 @@ def test_auto_install_success_but_binary_not_found_falls_through(self): class TestRustAnalyzerDiagnosticsTimeout: @pytest.mark.rust - def test_windows_uses_longer_diagnostics_wait_timeout(self): + @pytest.mark.parametrize("os_name", ["Windows", "Linux"]) + def test_all_platforms_use_longer_diagnostics_wait_timeout(self, os_name: str): from solidlsp.language_servers.rust_analyzer import RustAnalyzer analyzer = RustAnalyzer.__new__(RustAnalyzer) - with patch("solidlsp.language_servers.rust_analyzer.platform.system", return_value="Windows"): + with patch("solidlsp.language_servers.rust_analyzer.platform.system", return_value=os_name): timeout = analyzer._get_published_diagnostics_wait_timeout(False) assert timeout >= 8.0 - @pytest.mark.rust - def test_non_windows_uses_default_diagnostics_wait_timeout(self): - from solidlsp.language_servers.rust_analyzer import RustAnalyzer - - analyzer = RustAnalyzer.__new__(RustAnalyzer) - - with patch("solidlsp.language_servers.rust_analyzer.platform.system", return_value="Linux"): - timeout = analyzer._get_published_diagnostics_wait_timeout(False) - - assert timeout == 2.5 - class TestRustAnalyzerDetectionIntegration: """