xdebug / vscode-php-debug

PHP Debug Adapter for Visual Studio Code 🐞⛔
MIT License
768 stars 175 forks source link

feat: support clipboard context on variable copy operation #917

Open zobo opened 1 year ago

zobo commented 1 year ago

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

codecov[bot] commented 1 year ago

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%) :arrow_up:
src/phpDebug.ts 62.93% <100.00%> (+0.41%) :arrow_up:
zobo commented 1 year ago

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

eduwass commented 2 months ago

I'd love to see this implemented. 👀