-
Notifications
You must be signed in to change notification settings - Fork 798
debug: custom string of custom types #3749
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
Comments
When you say "string() representation" do you mean "the result of evaluating a string(...) expression"? If so, that would have to be implemented by delve because expressions are evaluated by delve. Also, that seems like the wrong behavior to me. When the debugger evaluates a Go expression, I expect it to have the same effect as that expression would if it were part of my program. And Also vscode-go has no clue if the result of an expression is a value that implements
Putting aside how Unless delve's ability to call methods becomes significantly more reliable, the only path forward I can see is to find some way around executing code in the debuggee, such as delve simulating executing String() or GoString() (which might require an external source to provide the source of the method). But that would be a major undertaking, and also that's a feature request for delve, not vscode-go. |
Ah, I see, that makes more sense. Currently I'm pretty sure the To be clear, I agree that showing the output of
To the best of my knowledge, yes, what is shown there is directly controlled by delve's response to the Variables DAP request. I haven't read through the relevant code in detail so I could be wrong, but I have written my own DAP-based debugger extension and essentially the extension says, "Hey vscode, launch this DAP-compatible executable", and the extension has very little control over what happens after that.
Maybe "DAP variables request response"? The code is here: |
As @firelizzard18 points out, this is not an issue of the VS Code Go extension, but of the underlying debugging tooling. I suggest you report the issue at https://github.com/go-delve/delve/issues. |
Is your feature request related to a problem? Please describe.
I have a custom type which internally uses an array of numbers, you can think UUID identifier. I would like it to be displayed in variables pane in VSCode in standard UUID format instead of current hex format I see in
string()
.Describe the solution you'd like
I would expect that
string()
representation really callsString()
or at leastGoString()
on the value.Describe alternatives you've considered
It seems there was some work on this done in #158, but I have not seen it really working now, so I am opening a new issue.
The text was updated successfully, but these errors were encountered: