-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Can't copy the values of debugging elements such as exception messages #10210
Comments
Ive been told to raise the issue in the two repos so I don't know where it belongs to |
@chuckries Sounds like a problem of the C# debug extension because it generates the "error CS1012:...". |
@chuckries saw your comment on dotnet/vscode-csharp#639. So what exactly is the problem with VS Code that results in the CS1012 error on your side? |
VSCode will try to evaluate the variable before it copies it's value to the clipboard here So the bottom line issue here is that the debug adapter can not evalute the long string that is trying to be copied over. |
I'll take a look at this from the debugger side. I didn't realize an evaluation was performed on copy. |
I think we need some way to opt out doing an evaluation on 'Copy Value' and just hand back the value sitting in the UI. As it stands, for copying @gregg-miskelly @caslan @wesrupert for visibility. Wes did the type annotating work on our side. I'm not sure if this is something we need to scrape back out or if VS Code can give us the identifier without providing the type annotation. |
Another option would to pass a token to the variable that needs to be re-evaluated rather than sending a raw string. My understanding is that this token approach is used other places in the debugger UI. |
If VS Code wants to perform this evaluation, the best method I see for giving us the context would be to give us the same data as we get for the setVariable command, i.e. a context (stackframe or variablesReference) and the name, and we can handle it from there. |
Seeing as the underlying behavior is from a desire to get a "better" string out of the value, it would also be nice to have a separate context for this evaluate command, e.g. |
Passing a |
Personally I don't think 'context' is enough -- VS Code shouldn't attempt to concatenate children together to build the name of an expression as this isn't language-agnostic. As Wes suggested, I think the clean way to handle this problem is to add a new request (GetFullValue?) which works the same as |
Assigning first to @weinand to investigate how to solve this on the debug protocl level, and once we come to a conclusion I can implement it on the vscode side. |
In the October release we've introduced a new attribute @isidorn please use this new (optional) attribute when copying values to the clipboard. |
Currently if the evaluateName is passed we will respect it on the vscode. If it is not passed we will still use our ugly heuristic for figuring out the evaluateName here I propose that in October we support both but in the november release we drop the support for not specifiying the evaluateName. In that case if the evaluateName is not passed we will simply use the name of the variable. No critical feature is dependent on this and I would like to get rid of that ugly code thus I am all in for droping this in november. |
@weinand is it fine if I drop our ugly heuristic for figuring out the evalute name of a variable this milestone. This will break the following scenarios for adapters that do not support
I am +1 for dropping it since this is not a major breakage imho and each adapter can start supporting |
Since we did not even mention |
@weinand makes perfect sense. In the future let me know when node-debug or node-debug2 implement this so we can drop the hack. |
I've created this issue for the adoption work. |
From @CarlosTorrecillas on August 5, 2016 8:24
Environment data
dotnet --info
output:.NET Command Line Tools (1.0.0-preview2-003121)
Product Information:
Version: 1.0.0-preview2-003121
Commit SHA-1 hash: 1e9d529bc5
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.11
OS Platform: Darwin
RID: osx.10.11-x64
VS Code version: 1.3.1
C# Extension version: 1.3
Steps to reproduce
Expected behavior
Actual behavior
Copied from original issue: dotnet/vscode-csharp#639
The text was updated successfully, but these errors were encountered: