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

Copy variables not really working well #400

Open
flip111 opened this issue Apr 17, 2020 · 6 comments
Open

Copy variables not really working well #400

flip111 opened this issue Apr 17, 2020 · 6 comments

Comments

@flip111
Copy link

flip111 commented Apr 17, 2020

In the "Variables" pane where all the variables are listed in local scope (and a bunch of other scopes), when i have an array there and right click Copy Value i get

array(42)

When i click Copy as Expression i get

$forum_data_ary

These two options are somewhat useful. The "copy as expression" is more useful than "copy as value" though. Instead of just these two options could the following there be the following entries in the right click menu:

Copy as PHP (copies runnable PHP code to construct the variable)
Copy as JSON (copies JSON representation of variables)
Copy name (new name for "copy as expression")
Copy type  (new name for "copy as value")

Please put upvotes on microsoft/vscode#188604 as it blocks this ticket. See screenshot below on how to do an upvote

image

@zobo
Copy link
Contributor

zobo commented Jul 23, 2023

Related to #917 but does not solve the issue, as currently one one option is possible, not a list of options. Opened an issue with VSCode.

@zobo
Copy link
Contributor

zobo commented Nov 10, 2024

For reference, the needed feature on VSCode side was not implemented microsoft/vscode#188604 so I can't yet implement this.

@flip111
Copy link
Author

flip111 commented Nov 10, 2024

@zobo thanks for looking into this!

I saw in the linked issue

Yeah, that is not exposed right now. I guess it should be on that context object, or exposed as in microsoft/vscode#63943

And in the referred issue (7 may 2024):

This API has been finalized and will in tomorrow's Insiders and the next stable release. Please refer to https://github.com/microsoft/vscode/pull/212190/files#diff-0a75aed19c118603eb96332bc0b9c2d7867f4182346d16d18b7fc31b6ceeb321 for the final API.

Is that enough to implement it or is more needed?

@zobo
Copy link
Contributor

zobo commented Nov 10, 2024

No. The linked issue is talking about threads and stacks. This are elements in "CALL STACK" window. I'd need something similar for the "VARIABLES" windows. Only then could I implement extra menu items for all "Copy as ..." variants.

I'm going to finish implementing #917 one of this days, that will make a tree traversal when copying a variable with sub nodes and present it like "var_export"...

For my reference: I just found https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.debugVisualization.d.ts but that would probably not be a good solution also...

Semi unrelated note: Have you seen the new "debug.showVariableTypes" ?

@flip111
Copy link
Author

flip111 commented Nov 10, 2024

Have you seen the new "debug.showVariableTypes" ?

No i hadn't seen it yet. Reference: https://code.visualstudio.com/updates/v1_92#_show-variable-types-while-debugging

@flip111
Copy link
Author

flip111 commented Nov 10, 2024

@ljubadr @cDonut @dracula-property @m10 @sylver @shaneparsons i saw that you upvoted this issue, thanks for that!

However it's blocked on this microsoft/vscode#188604 which got closed because not enough upvotes. Perhaps with 20 votes we can ask a mod to reopen this ticket. Please see my first post how to upvote the ticket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants