Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildBeforeRestart does not trigger rebuild of project in tests #18763

Open
jyliuu opened this issue Dec 26, 2024 · 0 comments
Open

buildBeforeRestart does not trigger rebuild of project in tests #18763

jyliuu opened this issue Dec 26, 2024 · 0 comments
Labels
C-bug Category: bug

Comments

@jyliuu
Copy link

jyliuu commented Dec 26, 2024

rust-analyzer version: rust-analyzer version: 0.3.2228-standalone (fa4a40bbe8 2024-12-22)

rustc version: rustc 1.83.0 (90b35a623 2024-11-26)

editor or extension: VSCode

relevant settings:

{
    "rust-analyzer.debug.buildBeforeRestart": true
}

code snippet to reproduce:

// Run Test | Debug
#[test]
fn my_test() {
   ...
}

Description of the Issue:

When debugging a Rust test in VSCode by clicking the "Debug" button above the test function, and then subsequently hitting the "Restart" button in the debug controls, rust-analyzer does not appear to recompile the code. This means that if changes have been made to the code since the initial debug launch, those changes are not reflected when the debug session is restarted.

The rust-analyzer.debug.buildBeforeRestart setting is set to true, which according to the documentation, should trigger a rebuild before restarting a debug session. However, this is not the observed behavior.

Steps to Reproduce:

  1. Have a Rust project with a test function like the example provided.
  2. Ensure "rust-analyzer.debug.buildBeforeRestart": true is set in your VSCode settings (preferably workspace settings).
  3. Click the "Debug" button above the test function to start a debug session.
  4. Make a change to the code that would affect the test's execution
  5. Click the "Restart" button in the debug controls.
  6. Observe that the debug session starts without recompiling the code, and the changes made in step 4 are not reflected in the restarted debug session.

Expected Behavior:

When the "Restart" button is clicked during a debug session, and rust-analyzer.debug.buildBeforeRestart is set to true, rust-analyzer should trigger a recompilation of the project before starting the new debug session, ensuring that the latest code changes are included.

@jyliuu jyliuu added the C-bug Category: bug label Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

1 participant