barbushin / php-console

Handle PHP errors, dump variables, execute PHP code remotely in Google Chrome
https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef
MIT License
1.34k stars 283 forks source link

Jump to file #62

Closed joseadrian closed 10 years ago

joseadrian commented 10 years ago

I "jump to file" using Sublime Text 3 on OSX. I have configured sublime text protocol but I'm not sure where to put the editor variable from:

https://github.com/barbushin/php-console/wiki/Jump-to-file#mac-os-x

Is it possible?

barbushin commented 10 years ago

Hi

I'm not 100% author of this instructions, and I don't have Mac OS installed. Check https://www.google.ru/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=mac%20os%20protocol%20handler

Finally you just need to bind links like editor://open/?file=%file&line=%line to execute editor command line like "C:\Program Files\PhpStorm\PhpStorm.exe" --line "%line%" "%file%".

If you get luck with it, please contact me again, I'll update instructions for Mac OS users. Thank you!!!

joseadrian commented 10 years ago

Hi. Thanks for the response.

I edited the plist file of sublime text and then set it as default using RCDefaultApp. Sublime is opened but the file is not shown and I'm not sure if its not working because of this:

Imgur

It looks like the ampersand (&) is missing. Or is that ok?

joseadrian commented 10 years ago

Nevermind. I thought it was a missing character.

I made it work but only for Sublime text and using an script because ST doesn't support URL Schemes. It only has a command line tool. Well, here is the script I used.

Would it be possible to add an option to set a custom URL Scheme inside the extension? Lets say when the user checks "Jump to file" it shows a field where the default URL appears:

example

barbushin commented 10 years ago

Would it be possible to add an option to set a custom URL Scheme inside the extension?

It's possible to implement, but I'm not sure. Why do you need it? You think editor:// scheme can be used by some another application?

joseadrian commented 10 years ago

I don't need it anymore and well... the editor:// scheme is not used by any application as far as I know. I just thought it could be easier for everyone to set the url protocol and the format of their code editor. but is just an idea.

And thanks for creating the extension!

barbushin commented 10 years ago

Usually it's system wide configuration how to handle different URL schemes in browsers. For example when you click torrent link your OS run some executable file with some arguemnts. In the same way implemented Jump to file in php-console: run editor executable with file & line arguments to open.

Also on Jump to file page there is a URL template editor://open.... describing how it works. So everybody can setup any OS in his own way to make it works. Unfortunly, for now, there is no another way to run some executable file from Chrome. I tried everything :)

So, anyway, I hope extension will fork fine on your Mac OS with Sublime, and you'll enjoy it :)

Chears!

Kind Regards

Sergey Barbushin

Skype barbushin.sergey Web http://linkedin.com/in/barbushin

On Thu, Aug 28, 2014 at 11:20 AM, Joseadrian Ochoa <notifications@github.com

wrote:

I don't need it and the editor:// scheme is not used by any application as far as I know. I just thought it could be easier for everyone to set the url protocol and the format of their code editor. but is just an idea.

And thanks for creating the extension!

— Reply to this email directly or view it on GitHub https://github.com/barbushin/php-console/issues/62#issuecomment-53681802 .