-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Debugging tests via VSCode Code Lens fails #16010
Comments
I have this issue as well, same versions as listed above. Took me down for an hour during advent of code, trying to figure out what was going on. I was able to revert to the previous release and everything worked fine. Here's the repo I initially noticed in it, but I tried it in a bunch of my repos and none of the tests worked. IIRC I also tried debugging main and that also didn't work. Curious if this PR is involved. |
I've never use typescript before, but based on a quick search it appears that the Would this work? |
Can anyone install the pre-release version that just came out (there's a button in VS Code) and check if this is now working? |
I had the same/similar issue with the LLDB extension and this is now resolved with the pre-release version 🎉 |
Can also confirm the issue is fixed in the pre-release version. Thanks a lot for the quick fix! |
rust-analyzer version: 0.3.1756-standalone (e402c49 2023-12-01)
rustc version: 1.74.0 (79e9716c9 2023-11-13)
cargo version: 1.74.0 (ecb9851af 2023-10-18)
os: Windows 11 Version 10.0.22631 Build 22631
additional vs code extensions: cpptools
Reproduction steps
cargo init
in the directory.Details
Sample main.rs:
Attempting to run a test in debug configuration leads to the following error:
(Dialog box with error "Invalid 'cwd' value 'H:\Projects\test-debug\Cargo.toml'. The directory name is invalid.")
Output in vscode's debug output for the generated launch configuration:
Manually putting this into launch.json results in the same error. Removing the trailing "\\Cargo.toml" from the "cwd" setting solves the issue.
Output of
cargo test --message-format=json --no-run
:Notably, the returned
manifest_path
uses backslashes as path separator.Digging into how the launch configurations are generated, it looks like rust-analyzer currently assumes paths will always use slashes, since it tries to strip the trailing "/Cargo.toml" (note the slash).
If this can alternatively be solved by adjusting my configuration somewhere, guidance would be highly appreciated.
The text was updated successfully, but these errors were encountered: