php-console icon indicating copy to clipboard operation
php-console copied to clipboard

Jump to file

Open joseadrian opened this issue 12 years ago • 6 comments

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?

joseadrian avatar Aug 27 '14 03:08 joseadrian

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!!!

barbushin avatar Aug 27 '14 06:08 barbushin

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 avatar Aug 27 '14 21:08 joseadrian

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

joseadrian avatar Aug 27 '14 22:08 joseadrian

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?

barbushin avatar Aug 28 '14 06:08 barbushin

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!

joseadrian avatar Aug 28 '14 07:08 joseadrian

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 <[email protected]

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 .

barbushin avatar Aug 28 '14 07:08 barbushin