From dbda7ad8ae5e64bb044f16b448b497ff821f83b1 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sun, 9 Nov 2025 11:25:17 +0100 Subject: [PATCH] lsp-rust: Append --no-run flag for debugging Change the logic of lsp-rust-analyzer-debug to append --no-run when it's not already in cargo-args, not the other way round. The result is used only for obtaining the compiler-artifact, no need to run the tests to obtain it. --- CHANGELOG.org | 1 + clients/lsp-rust.el | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index 04ab4d9419..2ff94d0d7b 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -47,6 +47,7 @@ * Fix bug in lsp-odin where ~f-join~ collapses double slashes. Using ~format~ instead. * Fix missing gopls inlay hints when ~lsp-use-plist~ is true * Fix bug where persist was attempted when lsp-session-file is nil + * Debugging tests in Rust no longer runs all the tests prior to launching debug session. ** 9.0.0 * Add language server config for QML (Qt Modeling Language) using qmlls. diff --git a/clients/lsp-rust.el b/clients/lsp-rust.el index 7066081c96..4baba60312 100644 --- a/clients/lsp-rust.el +++ b/clients/lsp-rust.el @@ -1561,7 +1561,7 @@ and run a compilation" :label) runnable)) (pcase (aref cargo-args 0) ("run" (aset cargo-args 0 "build")) - ("test" (when (-contains? (append cargo-args ()) "--no-run") + ("test" (unless (-contains? (append cargo-args ()) "--no-run") (cl-callf append cargo-args (list "--no-run"))))) (->> (append (list (executable-find "cargo")) cargo-args