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
{{ message }}
Repository navigation
Copy value from the Debug view adds " around the string content #1990
When trying to copy the value from a String variable / field from the Variable or Watch view and you paste it somewhere the content of the value is surrounded by double quotation marks ".
This is especially annoying if you want to copy an url from a variable to the web browser.
Hmm, I'm not sure what to do here. The behaviour is consistent with other languages like TypeScript. It copies the same value that it shows in the watch list, and that has quotes so you can tell the difference between a string and a number (for example):
Someone opened a PR in VS Code for "Copy Raw Value" but it was closed as something extensions should do, once an API has been implemented to support it:
So I think it would probably be better to implement an additional option once that's provided (it also would allow literal newlines instead of \n etc.).
We don't do the copying, it's all VS Code. We tell it the value (which we've wrapped in quotes) and it uses it both for display and copying. A lot of VS Code is like that - we don't really get to control behaviour in the UI, VS code just asks us for data and we provide it, and it controls things like this (which is good in many ways, but also limiting in others!).
It probably wouldn't hurt, but based on microsoft/vscode#71666 I suspect it'd be rejected as something for us to do in the extension once they add an API for us to add custom commands to the context menu there (where we could add a "Copy raw value" or similar).
Activity
DanTup commentedon Sep 17, 2019
Hmm, I'm not sure what to do here. The behaviour is consistent with other languages like TypeScript. It copies the same value that it shows in the watch list, and that has quotes so you can tell the difference between a string and a number (for example):
Someone opened a PR in VS Code for "Copy Raw Value" but it was closed as something extensions should do, once an API has been implemented to support it:
microsoft/vscode#71666
So I think it would probably be better to implement an additional option once that's provided (it also would allow literal newlines instead of
\netc.).escamoteur commentedon Sep 17, 2019
It makes sense in the display to add quotation marks but not when you want the value. Could you not just strip the quotes when copying?
DanTup commentedon Sep 17, 2019
We don't do the copying, it's all VS Code. We tell it the value (which we've wrapped in quotes) and it uses it both for display and copying. A lot of VS Code is like that - we don't really get to control behaviour in the UI, VS code just asks us for data and we provide it, and it controls things like this (which is good in many ways, but also limiting in others!).
escamoteur commentedon Sep 17, 2019
DanTup commentedon Sep 17, 2019
It probably wouldn't hurt, but based on microsoft/vscode#71666 I suspect it'd be rejected as something for us to do in the extension once they add an API for us to add custom commands to the context menu there (where we could add a "Copy raw value" or similar).