Open mtaran opened 3 weeks ago
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 https://github.com/golang/vscode-go/issues/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.