When I am stepping through the code in the debugger, I've noticed that certain variables don't show values in the variables pane:
Local variables (e.g., String, u64) show values normally.
Is this by design, or is there a way to view these values to make debugging easier? Thanks!

Being able to see variables depends a lot on whether the compiler and the debugger fit together.
For example, if you run CodeLLDB, you want to make sure that your code is compiled with the GDB backend, not with the MSVC backend.
On the other hand, if you do compile with the MSVC backend, the ms-vscode.cpptools debugger might work better for you.
You can choose the debugger that rust-analyzer uses at:
Settings -> Extensions -> rust-analyzer -> debug -> Debug: Engine
You can switch the compiler toolchain by calling (assuming you are on windows):
rustup default stable-x86_64-pc-windows-msvcrustup default stable-x86_64-pc-windows-gnu(followed by cargo clean)
On Windows 11, I got the best results with:
x86_64-pc-windows-gnu + vadimcn.vscode-lldb (CodeLLDB)x86_64-pc-windows-msvc + ms-vscode.cpptoolsIn those configurations, both were able to resolve the content of a HashMap.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With