-
Notifications
You must be signed in to change notification settings - Fork 761
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
debug: variable watcher escapes json inside []byte #1821
Comments
Thanks for the report. From the screenshot, I see: But I see that some users may be annoyed to see the escape character. @suzmue @polinasok is it possible to send unescaped string (not go syntax representation) for this display context? i.e., I don't know if it's still useful to keep the go syntax representation for clipboard context though for users who want to copy the string to go code. |
@polinasok @suzmue reminded that this was discussed in the context of #1321. In particular, the debug variables section don't display multi-line strings well so, if @gudvinr Do you have specific use case where go string representation isn't the best way to represent it? |
JSON inside This is similar to |
Note that from the debugger's point of view, |
@hyangah I mentioned
This is a good question. I had to think about that. |
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Go: Locate Configured Go Tools
command.go-outline: ~/tools/go/path/bin/go-outline: go1.17.1
gotests: ~/tools/go/path/bin/gotests: go1.17.1
gomodifytags: ~/tools/go/path/bin/gomodifytags: go1.17.1
impl: ~/tools/go/path/bin/impl: go1.17.1
goplay: not installed
dlv: ~/tools/go/path/bin/dlv: go1.17.1
dlv-dap: ~/tools/go/path/bin/dlv-dap: go1.17.1
Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.Describe the bug
Variable watcher in debug view applies JSON escaping rules to
string()
if underlying type of variable[]byte
.As you can see on screenshot, byte view shows
123 34 116 34 58 110 117 108 108 44
which is the representation of{"t":null,
in ASCII/UTF-8.But
string()
showing{\"t\":null,
and it is incorrect representation of characters in input byte array.Steps to reproduce the behavior:
[]byte
variable filled with valid JSONScreenshots or recordings
The text was updated successfully, but these errors were encountered: