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

Better debugging support for variables #15407

Closed
erenturkm opened this issue Aug 7, 2023 · 3 comments
Closed

Better debugging support for variables #15407

erenturkm opened this issue Aug 7, 2023 · 3 comments
Labels
C-feature Category: feature request

Comments

@erenturkm
Copy link

Hi,

I am relatively new to Rust, coming from C# and Visual Studio. I am using the rust-analyzer v0.3.1615 inside Visual Studio Code 1.80.2 Current variables support seems lot to be desired and slowing me down so much so that I had to come up with specific structs that converts these types to observable ones inside debuging window.

Examples:
This is how I see enum variables, I was hoping to see enum1 and the current value of the enum not all possibilities.
enum1
    Variant0:
        Value {_0:true}
    Variant1:
        Value:{_0:""}

I have a similar situation with Paths and OsStrs where I cant see the value:
path1: {length 5}
     length:5

I am hoping there is a way to see them, if not when are we planning to address this?

Thanks in advance

@erenturkm erenturkm added the C-feature Category: feature request label Aug 7, 2023
@lnicola
Copy link
Member

lnicola commented Aug 7, 2023

Generally, C# in VS and Java will have the best debugging experience out of all languages. Native ones will never compete to that, although VS at least has Edit and Continue for C++.

There are three components here:

  • rust-analyzer only triggers the debugging extension
  • the debugging extension is an interface over a native debugger like cdb, gdb or lldb
  • the native debugger generally won't understand high-level language idioms
  • the program itself can contain debugger-specific visualizer scripts or pretty-printers to improve the debug-printing experience, e.g. https://rust-lang.github.io/rfcs/3191-debugger-visualizer.html

You can find some open issues about this, like rust-lang/rust#111868, rust-lang/rust#43334, rust-lang/rust#48462 or rust-lang/rust#36503.

But rust-analyzer has nothing to do with debugging, so it's out of scope for us.

@lnicola lnicola closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2023
@erenturkm
Copy link
Author

Thanks for the explanation, I think we need to provide a beginner friendly version of which package/project is responsible for the different developer experiences in Rust at high level with links to drill down further. Since this is provided by a single source in .NET. it can easily be mistaken to be a single package doing everything. Maybe I missed, do we have such a documentation?

@lnicola
Copy link
Member

lnicola commented Aug 8, 2023

Since this is provided by a single source in .NET. it can easily be mistaken to be a single package doing everything.

We suggest installing a debugging extension if one is not available, perhaps you already had one or missed the implications.

Maybe I missed, do we have such a documentation?

The manual doesn't specifically mention this, but it's so large it would be easy to miss anyway. But improvements are welcome, if you're thinking of something specific in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: feature request
Projects
None yet
Development

No branches or pull requests

2 participants