8000 feat: support clipboard context on variable copy operation by zobo · Pull Request #917 · xdebug/vscode-php-debug · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@zobo
8000 Copy link
Contributor
@zobo zobo commented Jul 22, 2023

When the IDE requests evaluation with clipboard context use var_export to format the response

@codecov
Copy link
codecov bot commented Jul 22, 2023

Codecov Report

Merging #917 (1773ad8) into main (4df70ce) will increase coverage by 0.27%.
The diff coverage is 91.30%.

@@            Coverage Diff             @@
##             main     #917      +/-   ##
==========================================
+ Coverage   67.00%   67.28%   +0.27%     
==========================================
  Files          14       14              
  Lines        1982     2005      +23     
  Branches      389      395       +6     
==========================================
+ Hits         1328     1349      +21     
- Misses        654      656       +2     
Impacted Files Coverage Δ
src/xdebugConnection.ts 82.03% <86.66%> (+0.17%) ⬆️
src/phpDebug.ts 62.93% <100.00%> (+0.41%) ⬆️

@zobo
Copy link
Contributor Author
zobo commented Jul 24, 2023

Using eval here causes issues, for example, when accessing private properties. Also it does not have support for stack depth. https://bugs.xdebug.org/view.php?id=1342
A correct implementation would be to implement var_export in JS and fetch data via property_get/property_value

@zobo zobo mentioned this pull request Nov 7, 2023
2 tasks
@eduwass
Copy link
eduwass commented May 28, 2024

I'd love to see this implemented. 👀

@zobo zobo mentioned this pull request Jul 16, 2024
8 tasks
@almadorx
Copy link

Are there any updates on this? It would be definitely great to export all data while debugging

@zobo
Copy link
Contributor Author
zobo commented Feb 11, 2025

Sorry about letting this one fall through the cracks... I'll find some time to implement this asap.

@zobo zobo self-assigned this Feb 11, 2025
@almadorx
Copy link

Are there any updates on this? I'm still looking for the possibility of copying all variable values (array, not a single value). Also, it would be great to copy all debug output to a file or clipboard.

@zobo
Copy link
Contributor Author
zobo commented Mar 21, 2025

Not yet, but will get to it. How would you prefer the "copy" operation on a variable would work?

  • var_export style?
  • json_encode style?
  • other?

Edit: There are a bunch of issues related to this, and I think I decided to go in the direction of var_export for arrays and objects.

@almadorx
Copy link
almadorx commented Mar 21, 2025

It doesn't matter, any variant would be useful.

p.s. I see that you've decided to go with var_export already! Thank you!

p.s.2 related #issue

@konigprinz
Copy link

Please add this feature

@zobo zobo merged commit 8c82f65 into main Apr 19, 2025
8 checks passed
@zobo zobo deleted the clipboard-context branch April 19, 2025 18:49
@zobo zobo mentioned this pull request Apr 19, 2025
3 tasks
@github-actions
Copy link

🎉 This PR is included in version 1.36.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@almadorx
Copy link

Identifier: xdebug.php-debug
Version: 1.36.1
Last Updated: 2025-07-15, 17:52:46
Size: 5.12MB

Can't find any difference.

Copy value: returns an array(12), but not the entire array data.

var_export ($rows, true)
can not get property

Am I doing something wrong?

@zobo
Copy link
Contributor Author
zobo commented Jul 17, 2025

Hi. Can you open a new issue with some example code and most important, the debug log. I could not reproduce the problem you are describing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: add advanced copy variable values

6 participants

0