8000 Add support for the PhpStorm Mac scheme by harcod · Pull Request #22 · aik099/PhpStormProtocol · GitHub
[go: up one dir, main page]

Skip to content

Add support for the PhpStorm Mac scheme #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 1, 2017
Merged

Conversation

harcod
Copy link
Contributor
@harcod harcod commented Feb 27, 2017

PhpStorm 8 (Mac) provided native support for the "phpstorm:" protocol. However, they implemented a different format for the the URL.

PhpStorm Mac uses: phpstorm://open?file=@file&line=@line
This handler uses phpstorm://open?url=file://@file&line=@line

symfony/symfony#21712 is going to change the default format to be the Macintosh format.

This PR contains the necessary modifications to support both formats simultaneously. This would standardize the system so that you would not need two different configurations if you are working on different platforms (i.e. Windows vs Mac)

@harcod
Copy link
Contributor Author
harcod commented Feb 27, 2017

I have also submitted a similar PR for the Linux version of the handler in sanduhrs/phpstorm-url-handler#2

@aik099
Copy link
Owner
aik099 commented Feb 27, 2017

PhpStorm 8 you say. This was how much years ago considering latest PhpStorm version is 2016.3?

@aik099
Copy link
Owner
aik099 commented Feb 27, 2017

If you're using PhpStorm 8+ Mac, then you don't need to use this url handler at all. Isn't that right?

Why we need to support url format, that is already handled by PhpStorm itself and therefore create alternative url handler for same url format, that would conflict with PhpStorm's one?

@harcod
Copy link
Contributor Author
harcod commented Feb 27, 2017

According to the comment referenced in the README of this project it was in June 2014.

The issues lies in the fact that symfony/symfony#21712 is going to prioritize the Macintosh version of the URL scheme since it is the "native" format from the publisher of PhpStorm.

@aik099
Copy link
Owner
aik099 commented Feb 27, 2017

That is reply to both my comments or only to #22 (comment) ?

@harcod
Copy link
Contributor Author
harcod commented Feb 27, 2017

Correct -- If you are using Mac, then you don't need this handler.

However, symfony/symfony#21712 is going to have to support both format on their end and the user will have to choose the correct one. In addition, they are changing the "default" format from the version that you currently support to the one that JetBrains created for the Mac. This will cause a backwards-compatibility break for all symfony users of your handler as they will have to change phpstorm to phpstorm-protocol.

If you accept this PR, then symfony will probably just choose to eliminate (or deprecate) the 'phpstorm-protocol' selector below.

Old symfony setting was:
'phpstorm' => 'phpstorm://open?url=file://%%f&line=%%l'

New symfony settings are:
'phpstorm' => 'phpstorm://open?file=%%f&line=%%l'
'phpstorm-protocol' => 'phpstorm://open?url=file://%%f&line=%%l',

@aik099
Copy link
Owner
aik099 commented Feb 27, 2017

Now I see the whole picture. Thanks for explaining.

One more thing though. Seems that there is support for PhpStorm < v8 and https://github.com/aik099/PhpStormProtocol/blob/master/PhpStorm%20Protocol.app/Contents/bin/parse_url.sh needs to be updated to have support for both link formats as well.

@harcod
Copy link
Contributor Author
harcod commented Feb 27, 2017

I added the regex change to the parse_url.sh script noted above. I should point out that I don't have a Macintosh to test this particular change.

@aik099
Copy link
Owner
aik099 commented Feb 27, 2017

I added the regex change to the parse_url.sh script noted above. I should point out that I don't have a Macintosh to test this particular change.

You can test it on Linux, because it's Bash script.

@harcod
Copy link
Contributor Author
harcod commented Mar 1, 2017

The update to parse_url.sh works on Linux

@aik099 aik099 merged commit e4a8c01 into aik099:master Mar 1, 2017
@aik099
Copy link
Owner
aik099 commented Mar 1, 2017

Merging, thanks you @harcod .

@harcod harcod deleted the patch-1 branch March 1, 2017 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0