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

Debuggers: Add "copy path" to the context menu in the inspector #19580

Closed
Spown opened this issue Jan 30, 2017 · 17 comments · Fixed by #43423
Closed

Debuggers: Add "copy path" to the context menu in the inspector #19580

Spown opened this issue Jan 30, 2017 · 17 comments · Fixed by #43423
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@Spown
Copy link

Spown commented Jan 30, 2017

  • VSCode Version: 1.8.1
  • OS Version: Win10x64

Currently there is a "Add to Watch" for all items in the variable inspector and "Copy/Set Value" for the primitive fields. Please add a "Copy Path" for all items. Right now the only way to do it is through a watch:

Which is not only tiresome, but also creates a useless watch.

Thank you.

@isidorn isidorn added debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality labels Jan 30, 2017
@isidorn isidorn removed their assignment Jan 30, 2017
@isidorn isidorn added this to the Backlog milestone Jan 30, 2017
@Spown
Copy link
Author

Spown commented Nov 21, 2017

No description provided.

@isidorn
Copy link
Contributor

isidorn commented Nov 21, 2017

@isidorn isidorn added the help wanted Issues identified as good community contribution opportunities label Nov 21, 2017
isidorn added a commit that referenced this issue Feb 14, 2018
Fixes #19580; added copy property path action to debug viewlet
@isidorn isidorn modified the milestones: Backlog, February 2018 Feb 16, 2018
@isidorn isidorn added the verification-needed Verification of issue is requested label Feb 16, 2018
@bpasero bpasero added the verified Verification succeeded label Feb 27, 2018
@bpasero
Copy link
Member

bpasero commented Feb 27, 2018

"Copy Path" is a bit weird, maybe "Copy Name"?

@Spown
Copy link
Author

Spown commented Feb 27, 2018

"Copy Path" is a bit weird, maybe "Copy Name"?

"Copy Name" usually means copying a particular property name, whereаs I need the whole chain from root (global, window, etc) and ending with selected property/variable.

Actually "Copy Name" wouldn't harm to have as well. There is also a scenario when I go into prototype of an object (or even several levels of prototypes deep) and I need the path without __proto__ in between - for this right now I need to do the thing depicted in the gif above and also manually remove any __proto__ in the result (let's call it "Copy Path (inherited)" or something).

But this may wait for another day. Right now it would be nice to have just the own path. Thank you.

@isidorn
Copy link
Contributor

isidorn commented Feb 27, 2018

@bpasero Copy Name does not work imho. We could go with "Copy Full Name", "Copy Evaluate Name"
@weinand thoughts?

Even though copy path sounds a bit weird I think it makes it clear for the user what to expect.

@bpasero
Copy link
Member

bpasero commented Feb 27, 2018

Yeah, up for ideas, "Copy Name" is not ideal either. I am just correlating "Copy Path" with file paths typically.

@Spown
Copy link
Author

Spown commented Feb 27, 2018

@Spown
Copy link
Author

Spown commented Feb 27, 2018

Also copying path means capturing array indexes as well. In case of multidimensional arrays it would mean only indexes - [5][0][1][67][4][0]. "Name" would be highly misleading in this case.

@weinand
Copy link
Contributor

weinand commented Feb 27, 2018

some ideas:
Copy expression
Copy expression path
Copy evaluation
Copy evaluation path
Copy eval expression

@isidorn
Copy link
Contributor

isidorn commented Feb 27, 2018

"Copy expression path" and "Copy evaluation path" work for me

@weinand
Copy link
Contributor

weinand commented Feb 27, 2018

Variants:
Copy as expression path
Copy as evaluation path

@Spown
Copy link
Author

Spown commented Feb 27, 2018

I don't think "evaluation" is a good word for this. You probably use it internally, to get values to dispaly in the inspector. But from the consumption perspective it has nothing to do with eval. Or do I see it wrong?

@Spown
Copy link
Author

Spown commented Feb 27, 2018

Maybe "Copy path as/for expression"?

@weinand
Copy link
Contributor

weinand commented Feb 27, 2018

Any user that uses the REPL (aka debug console) knows what evaluation means because she is using it all the time...

@weinand
Copy link
Contributor

weinand commented Feb 27, 2018

"Copy path as expression" sounds strange because a user has selected a variable not a path.

So my variants from above tried to address this by introducing the "as" but they left out the "variable".
The full name would be:
Copy variable as expression
Or
Copy variable as path expression

@Spown
Copy link
Author

Spown commented Feb 27, 2018

Any user that uses the REPL (aka debug console) knows what evaluation means because she is using it all the time...

I'm not saying the user doesn't know what eval means - I'm saying the user associates evaluation with either evaling in console or through eval() method (if there is one in the language). I'm not speaking for everyone, but I do not associate eval with context inspection.

Copy variable as expression

If I would see such a menu item - I would think it does value stringification or something like that.

@isidorn
Copy link
Contributor

isidorn commented Feb 27, 2018

After a discussion with a team we settled on "Copy as Expression"
Thanks for feedback.

@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants