AntonShuvaev / jet-client-support

JetClient is an advanced REST API Client plugin for JetBrains IDEs
https://plugins.jetbrains.com/plugin/21173-jetclient
100 stars 0 forks source link

XDebug Toggle #33

Open marshallthornton opened 1 year ago

marshallthornton commented 1 year ago

Is your feature request related to a problem?

No

Describe the solution you'd like

An option that could be enabled in the plugin settings to add a toggle for sending the XDebug header on requests. Other REST clients tend to support this via plugins or settings so it would be nice if Jet Client did as well.

Additional context

Functionality-wise, it would just need to add a XDEBUG_SESSION cookie to the request it sends. The value for this cookie could also be something set inside the plugin settings so that it could be customized for each project if needed.

Having the toggle itself be a button or checkbox near the Send button to enable/disable including this cookie would make life a lot easier when working with PHP APIs.

AntonShuvaev commented 1 year ago

Hi @marshallthornton,

I'm not familiar with XDebug, but if I understand correctly, you can use it by utilizing the cookies functionality of the plugin or the headers functionality. Headers of requests are inherited from parent folder headers, so you can manually add the XDEBUG_SESSION cookie to the desired request or root folder. This should allow you to achieve the behavior you described.

marshallthornton commented 1 year ago

Yeah, it would just be a nice quality of life enhancement to have it be a toggle button to add/remove that cookie on the request itself.

Typically you don't want to always be sending that cookie since it slows down the actual execution of the code when remote debugging is turned on. So 90+% of the time it would be toggled off while just testing things during development and only enabled when I need to setup breakpoints and step through some code to debug an issue.

It isn't the end of the world to not have it since, like you said, I could just add the cookie manually. It would just be nice to have a quick and easy toggle to enable/disable it that could potentially only show up if you enable the option in plugin settings so other people who aren't working in PHP don't have to see it.