nette / tracy

😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.
https://tracy.nette.org
Other
1.75k stars 218 forks source link

Helpers: Autodetection of PhpStorm in Linux environment for Editor URI. #544

Closed janbarasek closed 1 year ago

janbarasek commented 2 years ago

In a Linux environment or on a Mac, the default disk path to PhpStorm is always /usr/local/bin/phpstorm. This allows us to detect that PhpStorm is available and set the default path to the editor.

At the same time, on a Mac, all we have to do is set the URI and the click-through works immediately.

This feature was inspired by the implementation in PhpStan Pro.

Snímek obrazovky 2022-05-23 v 8 44 31

dg commented 2 years ago

This is a BC break, then file creation etc stops working.

janbarasek commented 2 years ago

@dg I fixed the editor URI string.

dg commented 2 years ago

PhpStorm can do this?

janbarasek commented 2 years ago

Yes.

https://user-images.githubusercontent.com/4738758/170044971-d0dc5c2c-a55d-4ba5-a240-f1650e1eb516.mp4

dg commented 2 years ago

Sure, you open an existing file. But it stops the file creation, editing and source mapping features of open-editor.js.

Or what it's good for &search=%search&replace=%replace inside $editor = 'phpstorm://%action?file=%file&line=%line&search=%search&replace=%replace';?

janbarasek commented 2 years ago

Sorry for the slower reply, I needed to thoroughly test all scenarios.

In the end, it looks like you can only send an action to PhpStorm via URL to open a file. So what about replacing the URI to only do the open action? Even so, this will solve most of the common cases when working with dump data.