In the VS Code Debugger UI we have a "Variables" panel where we can see the values of the current variables. And pretty often we want to copy the value to the clipboard. For that we can right-click on the variable and choose "Copy Value" menu item.

But if we try to copy the string value, it will be wrapped in quotes for some reason.

So, for example, if we have a string value $json with a JSON like this {"status":"success") - it will be copied as invalid JSON value because of those quotes, like this:

"{"status":"success"}"

Seems this behavior relates to the Debugger extension itself, not to the VS Code core.

So, could you please fix this and make the copied value without quotes? Thanks!

Thank you for the feedback!

This behavior is handled by VS Code itself rather than the debugger extension. The variable values are sent to VS Code for display, and the copy action is managed by the editor. We don’t have a way to differentiate how the value is copied, and sending it without quotes would be undesirable as it could lead to confusing or misleading output.

There was a related discussion in the VS Code repo https://github.com/microsoft/vscode/issues/81051. Unfortunately, the issue was closed, but it might be worth re-engaging.

Write a Reply...