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

Copying a long value from debug watch results in pasting partial value #97444

Closed
da2r-20 opened this issue May 11, 2020 · 7 comments
Closed

Copying a long value from debug watch results in pasting partial value #97444

da2r-20 opened this issue May 11, 2020 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues on-release-notes Issue/pull request mentioned in release notes verified Verification succeeded
Milestone

Comments

@da2r-20
Copy link

da2r-20 commented May 11, 2020

  • Version: 1.45.0
  • Commit: d69a79b
  • Date: 2020-05-07T15:57:33.467Z
  • Electron: 7.2.4
  • Chrome: 78.0.3904.130
  • Node.js: 12.8.1
  • V8: 7.8.279.23-electron.0
  • OS: Darwin x64 18.7.0

For me it reproduced with C++
But it probably occurs in other languages as well, haven't verified that.

Steps to Reproduce:

  1. Start a debugging session
  2. add an expression that has a long value to watch
    Screen Shot 2020-05-11 at 8 49 26
  3. Copy value
  4. paste it somewhere in a text area
  5. the pasted text appears is limited and ends with '...'
    Screen Shot 2020-05-11 at 8 50 33

Does this issue occur when all extensions are disabled?: Yes

@isidorn
Copy link
Contributor

isidorn commented May 12, 2020

Please file this against the C++ extension and mention the following:
VS COde sents the clipboard context when copying. Their extension should set the capability supportsClipboardContext and respect the clipboard context by evaluation the full thing.

@WardenGnaw
Copy link
Member

@isidorn
In the EvaluateRequest with clipboard as the context, it seems like the expression is set to the value, not the expression. Is this expected?

image

{"command":"evaluate",
"arguments":{
"expression":"\"abcdefghijklmnopqrstuvwxyz0abcdefghijklmnopqrstuvwxyz1abcdefghijklmnopqrstuvwxyz2abcdefghijklmnopqrstuvwxyz3abcdefghijklmnopqrstuvwxyz4abcdefghijklmnopqrstuvwxyz5abcdefghijklmnopqrstuvwxyz6abcdefghijk\"...","
   frameId":1000,
   "context":"clipboard"
},
"type":"request",
"seq":25}

@isidorn
Copy link
Contributor

isidorn commented May 15, 2020

@WardenGnaw yeah this is how we implemented it here

actions.push(this.instantiationService.createInstance(CopyValueAction, CopyValueAction.ID, CopyValueAction.LABEL, expression.value, 'watch'));

Maybe not the best when you do it on a top level wath expression.
We could fix it to make the CopyValue handle both Variable and Expression. But this might be fine for now.

@WardenGnaw
Copy link
Member

Hmm. In the C/C++ debugger, it defaults to displaying up to 200 characters. So the value we would get when stopped, would be the truncated 200 limited value.

I was expecting when a user selects Copy Value, an EvaluateRequest would have its expression field set to the original expression (in the image above it would be "str") so we can re-query the debugger to give the full value.

We would do so by noticing it was a ClipboardContext. Tell the debugger to have unlimited display when evaluating a variable, evaluate a variable, reset the display back to the default and return the full display in the response.

@isidorn
Copy link
Contributor

isidorn commented May 18, 2020

@WardenGnaw you are correct, I have pushed de3e5a4 to tackle this.
Please try it out with vscode insiders from Tuesday and let us know how it works for you.
I have also created this follow up isse for js-debug microsoft/vscode-js-debug#476

@isidorn isidorn added bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues labels May 18, 2020
@isidorn isidorn added this to the May 2020 milestone May 18, 2020
@connor4312 connor4312 added the verified Verification succeeded label Jun 4, 2020
@weinand weinand added the on-release-notes Issue/pull request mentioned in release notes label Jun 8, 2020
@WardenGnaw
Copy link
Member

@isidorn Sorry for the delay, I tested this out and the expression of the evaluate request is what we expect, the variable to evaluate.

Thanks you again!

@isidorn
Copy link
Contributor

isidorn commented Jun 10, 2020

@WardenGnaw thanks for letting us know!

@github-actions github-actions bot locked and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues on-release-notes Issue/pull request mentioned in release notes verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants