Skip to content
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

Why are string values when copied from the debug pane surounded with quotation marks? #81051

Closed
escamoteur opened this issue Sep 17, 2019 · 8 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code
Milestone

Comments

@escamoteur
Copy link

Hi,

currently when I select copy value from the context menu of the debug pane on a String variable it adds a " at the beginning and end of the real value.
For me this is wrong behavior because the value of the variable is just the string and nothing else.
Especially if you copy an url and paste it into the browser/postman you always have to remove the quotes.

Can this be changed?
Cheers
Thomas

Dart-Code/Dart-Code#1990

@kieferrm kieferrm added the debug Debug viewlet, configurations, breakpoints, adapter issues label Sep 17, 2019
@isidorn
Copy link
Contributor

isidorn commented Sep 18, 2019

We are not adding " at the begging and end of the real value. We are simply copying what the debug adapter is giving us.
In this case it seems the debug adapter is giving the value with the quotes thus we write the quotes.
Code pointer if you want to investigate more https://github.com/Microsoft/vscode/blob/9c85ca3757812664246e009403320ea54bbdd89c/src/vs/workbench/contrib/debug/browser/debugActions.ts#L401

Point being, I disagree and I think the value should be full as presetned by the debug adapter. The copy value should not massage it.

@isidorn isidorn added the under-discussion Issue is under discussion for relevance, priority, approach label Sep 18, 2019
@isidorn isidorn added this to the Backlog milestone Sep 18, 2019
@escamoteur
Copy link
Author

@DanTup What do you think?

@DanTup
Copy link
Contributor

DanTup commented Sep 18, 2019

It is the Dart extension adding these quotes, however the behaviour is exactly the same in TypeScript. The issue is that VS Code doesn't allow "Copy Value" to have a different representation from what's shown in the watch/variables window.

It is good that debug adapters wrap quotes around them, so you can see when they are strings:

Screenshot 2019-09-18 at 5 24 17 pm

However if the user chooses "Copy Value" from the context menu, the quotes (and any escaping, like \n instead of literal newlines) are probably unwanted.

I think this is what #71666 was trying to solve, but it was rejected as something to fix in extensions when they can contribute their own commands to the menu.

Personally I think it is a gap in Code - I think having quotes wrapped around in the watch window but copying the value without them is something that all languages would probably like and not something that should be implementing ad-hoc (and potentially differently) by them all.

@isidorn how about allowing the DA to return two strings, or some additional metadata that would allow VS Code to better present the data without affecting copying the value (for example allowing us to declare it's a string and should be wrapped in quotes)?

@isidorn
Copy link
Contributor

isidorn commented Sep 19, 2019

fyi @weinand for DA request for two strings.
This is a fair feature request, however not currently on the plan, thus assigning to backlog.

@isidorn isidorn added feature-request Request for new features or functionality and removed under-discussion Issue is under discussion for relevance, priority, approach labels Sep 19, 2019
@isidorn isidorn added the *out-of-scope Posted issue is not in scope of VS Code label Oct 9, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 9, 2019

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@vscodebot vscodebot bot closed this as completed Oct 9, 2019
@escamoteur
Copy link
Author

@isidorn why do close this? I still think an absolute reasonable request.
Would it be so difficult to implement this?

@isidorn
Copy link
Contributor

isidorn commented Oct 9, 2019

Hi. We close this since we have no plans to address it in the forseable future.
Just because something might be easy to implement does not mean we want it to be part of VS Code.
I do not think this should be in the core functionality, however we might reconsider and reopen this in the future.
Hope that makes sense

@escamoteur
Copy link
Author

The problem is that plugins like Dart Code cannot address this without infrastructure from code like @DantuB explained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

4 participants