rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.21k stars 1.6k forks source link

debug button does not save source code file #15511

Open goradata opened 1 year ago

goradata commented 1 year ago

Hi,

I am using rust-analyzer v0.3.1631 with vscode properties given below: Version: 1.81.1 (system setup) Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794 Date: 2023-08-09T22:22:42.175Z Electron: 22.3.18 ElectronBuildId: 22689846 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.22000 When I press the debug button for the application code, it saves the file and then builds the application. However when I do this on the unit tests, it does not save the file before compiling hence an extra step is needed. I believe this should be classified as a bug.

lnicola commented 1 year ago

Can you show a screenshot with the buttons you're referring to (the one that saves the file and the one that doesn't)?

goradata commented 1 year ago

This case saves the files as expected: ErrorCondition1 Where this one does not ErrorCondition2

dbofmmbt commented 1 year ago

I couldn't reproduce this problem in my machine. RA 0.3.1631-standalone

VS Code about: help
Version: 1.81.1 Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794 Date: 2023-08-09T22:18:39.991Z (2 wks ago) Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.81.1 Chrome/108.0.5359.215 Electron/22.3.18 Safari/537.36

Every time I use the code lens to run either tests or main, I get the file saved here.

goradata commented 1 year ago

I am using this on Windows 11 whereas you are testing it on Linux, can it be the reason?