You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm always frustrated when I am debugging and want to look at some multi-line input, but only get to see it squished to a single line with explicit \ns in it.
Describe the solution you'd like
I would like either a user preference for whether to escape newlines or not, or for them to be shown in escaped/unescaped forms in different parts of the UI, e.g. in the variables panel vs. on hover. Right now all the UIs show them with explicit \ns.
Describe alternatives you've considered
It would also be fine if I could use the debug console to print out the string, turning \ns into newlines. But call fmt.Println(...) errors out, and I couldn't find some alternative that would actually unescape the newlines.
Additional context #1321 asked for the current behavior, but really the escaped/unescaped forms are useful in different contexts, so it'd be nice to have easy access to them both.
The text was updated successfully, but these errors were encountered:
mtaran
changed the title
Newlines in debugger show up as "\n"
Show strings with newlines across multiple lines in debugger
Nov 5, 2024
This is a delve issue. Unless you're using the legacy adapter, vscode-go does not control the presentation of variables. If delve adds a flag to control this behavior (whether to escape newlines/etc), vscode-go can add a setting to set that flag.
Hi mtaran, thanks for raising this issue. I believe firelizzard18 is correct. Thanks firelizzard18.
VSCode-Go delegates the debugging functionality via DAP to delv. VSCode-Go is responsible of figuring out the right configuration to delv and launching delv for debugging session.
From VSCode-Go side, we can certainly add a configuration field and pass this field eventually to delv to reach your desired behavior.
Is your feature request related to a problem? Please describe.
I'm always frustrated when I am debugging and want to look at some multi-line input, but only get to see it squished to a single line with explicit
\n
s in it.Describe the solution you'd like
I would like either a user preference for whether to escape newlines or not, or for them to be shown in escaped/unescaped forms in different parts of the UI, e.g. in the variables panel vs. on hover. Right now all the UIs show them with explicit
\n
s.Describe alternatives you've considered
It would also be fine if I could use the debug console to print out the string, turning
\n
s into newlines. Butcall fmt.Println(...)
errors out, and I couldn't find some alternative that would actually unescape the newlines.Additional context
#1321 asked for the current behavior, but really the escaped/unescaped forms are useful in different contexts, so it'd be nice to have easy access to them both.
The text was updated successfully, but these errors were encountered: