AnWeber / vscode-httpyac

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=anweber.vscode-httpyac
MIT License
224 stars 20 forks source link

Possibility to copy variable values #169

Closed woolfas closed 1 year ago

woolfas commented 1 year ago

New feature request.

During the http file lifecycle, there can be created a lot of variables, which are displayed in the VSCode Httpyac plugin. And that way Httpyac plugin actually provides a very convenient way (which I use a lot) to inspect most important data, which is created/received during complex http file execution.

What I miss is a possibility to copy variable name and value (or at least only value). If variable is an object, then its value should be copied as a JSON string.

Please consider implementing this feature.

AnWeber commented 1 year ago

Should already work on click ( https://github.com/AnWeber/vscode-httpyac/blob/main/src/provider/objectTreeItem.ts#L37). Will take a look at it.

woolfas commented 1 year ago

That actually works. Intuitively I expected a popup menu on the right click of a mouse and the ability to select "copy attribute name" and "copy value" commands. But its really good to know about this feature. Thank you for explanation.

AnWeber commented 1 year ago

Vscode does not allow to open a context menu. Alternative is to implement a discrete Action icon at the end of the line to indicate copy feature. I test if both options work simultaneously.

AnWeber commented 1 year ago

I added icon inline to the value to indicate copy feature.