Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] Add PHPStorm helper link format for Mac #21712

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

Closed
wants to merge 0 commits into from

Conversation

pierredup
Copy link
Contributor

@pierredup pierredup commented Feb 22, 2017

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR symfony/symfony-docs#7513

The current file link format is based on https://github.com/aik099/PhpStormProtocol, but PHPStorm supports the protocol natively using a different syntax (Since PHPStorm 8)

@@ -131,7 +131,7 @@ public function load(array $configs, ContainerBuilder $container)
'macvim' => 'mvim://open?url=file://%%f&line=%%l',
'emacs' => 'emacs://open?url=file://%%f&line=%%l',
'sublime' => 'subl://open?url=file://%%f&line=%%l',
'phpstorm' => 'phpstorm://open?url=file://%%f&line=%%l',
'phpstorm' => 'phpstorm://open?file=%f&line=%l',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

% must stay escaped for DIC parameters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-added the escape characters

@harcod
Copy link

harcod commented Feb 22, 2017

I don't think you should make this modification at all.

The current file link format is based on https://github.com/aik099/PhpStormProtocol, but PHPStorm supports the protocol natively using a different syntax (Since PHPStorm 8)

It appears this is only true for PHPStorm 8 on MacOS. Windows and Linux versions of PHPStorm still require https://github.com/aik099/PhpStormProtocol (or https://github.com/sanduhrs/phpstorm-url-handler on Linux). The documentation even references PhpStormProtocol as a requirements for using the 'phpstorm' value for 'ide'.

Perhaps, there should be a new 'phpstorm-mac' value in the code with the new format ('phpstorm://open?file=%f&line=%l') and the documentation should be changed to have a generic example such as 'myide://open?url=file://%%f&line=%%l' to avoid confusion with phpstorm.

In my particular case, I would have had zero problems if I had just set the value of the 'ide' to 'phpstorm'. My mistake was seeing 'phpstorm://open..." in the example for another editor and using that misleading example instead.

@pierredup
Copy link
Contributor Author

I've updated the PR to only change the value in the case of Mac. I'm not close to a Windows PC at the moment, but I'll double check Windows and Linux tomorrow.

I think the docs should be updated to mention specifically using https://github.com/aik099/PhpStormProtocol and https://github.com/sanduhrs/phpstorm-url-handler on Windows and Linux respectively (instead of just specifying that PhpStormProtocol is needed) and the examples should change to myide like you mentioned

@harcod
Copy link

harcod commented Feb 22, 2017

I updated the docs as suggested into symfony/symfony-docs#7513

@pierredup
Copy link
Contributor Author

I double checked Windows and Linux, and this PR is ready.

Status: Needs Review

@@ -131,7 +131,7 @@ public function load(array $configs, ContainerBuilder $container)
'macvim' => 'mvim://open?url=file://%%f&line=%%l',
'emacs' => 'emacs://open?url=file://%%f&line=%%l',
'sublime' => 'subl://open?url=file://%%f&line=%%l',
'phpstorm' => 'phpstorm://open?url=file://%%f&line=%%l',
'phpstorm' => 'Darwin' === PHP_OS ? 'phpstorm://open?file=%%f&line=%%l' : 'phpstorm://open?url=file://%%f&line=%%l',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if that's really a good idea (useful at all) since this won't work anyway when Symfony is running in a virtual machine, will it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checking the OS will indeed not play well with VMs, as phpstorm will run on the host, not on the VM.
We should have a separate config key IMO

@pierredup
Copy link
Contributor Author

Changed the config to use a separate key to cater for VMs

@pierredup pierredup changed the title [FrameworkBundle] Update PHPStorm helper link format [FrameworkBundle] Add PHPStorm helper link format for Mac Feb 23, 2017
harcod added a commit to harcod/symfony-docs that referenced this pull request Feb 23, 2017
@@ -132,6 +132,7 @@ public function load(array $configs, ContainerBuilder $container)
'emacs' => 'emacs://open?url=file://%%f&line=%%l',
'sublime' => 'subl://open?url=file://%%f&line=%%l',
'phpstorm' => 'phpstorm://open?url=file://%%f&line=%%l',
'phpstorm-mac' => 'phpstorm://open?file=%%f&line=%%l',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure that this will only ever be supported on Mac only? If not, what about phpstorm-official, phpstorm-core, or something along those lines? (I'm not a phpstorm user, so not sure if that makes sense).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted for phpstorm-core

@pierredup
Copy link
Contributor Author

@harcod Can you please make the changes to the docs PR to use phpstorm-core instead

@javiereguiluz
Copy link
Member

I'm probably too late, but ... what if we change these values as follows:

Old New
phpstorm phpstorm-protocol
phpstorm-core phpstorm

The reason is that ultimately PHPStorm will do the right thing and support their correct native format ... so that should be phpstorm and not phpstorm-<something>

@pierredup
Copy link
Contributor Author

pierredup commented Feb 24, 2017

Won't that be a BC break, for everyone using phpstorm currently and now getting a different value?

I agree phpstorm should be the official value that PHPStorm supports, but there is no indication when it will be added to the other platforms. So when that happens, maybe phpstorm-core can be deprecated and removed in the next major with phpstorm holding the official value?

harcod added a commit to harcod/symfony-docs that referenced this pull request Feb 24, 2017
@fabpot
Copy link
Member

fabpot commented Feb 24, 2017

I don't think there is such a thing as BC break for such a parameter. It has no impact on user's code.

@pierredup
Copy link
Contributor Author

It doesn't have an impact on the code, but it has an impact on the current experience and expectations. It would still require a change in the config to keep the current experience. But if you think thats not a problem then I'm happy to make the change

@fabpot
Copy link
Member

fabpot commented Feb 24, 2017

I think that's definitely something we can do in a minor release, with a proper entry in the changelog.

@nicolas-grekas nicolas-grekas added this to the 3.3 milestone Feb 25, 2017
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@harcod
Copy link

harcod commented Feb 27, 2017

I have submitted PRs to the Windows and Linux versions of the phpstorm protocol handlers that would allow them to support both the native PhpStorm Mac scheme as well as their current scheme. If these are incorporated, then this PR could just eliminate the "phpstorm-protocol" completely and only support the native PhpStorm format.

harcod added a commit to harcod/symfony-docs that referenced this pull request Feb 27, 2017
@pierredup
Copy link
Contributor Author

Since both PRs have been merged, we only need to support the official format. I have updated the PR accordingly

@fabpot
Copy link
Member

fabpot commented Mar 1, 2017

So, this new version of the PR should be merged into 2.7 as a bug fix, right?

@pierredup pierredup changed the base branch from master to 2.7 March 1, 2017 14:38
@pierredup pierredup closed this Mar 1, 2017
@pierredup
Copy link
Contributor Author

pierredup commented Mar 1, 2017

@fabpot The phpstorm helper was only added in 3.2.

I stuffed up my branch, so I created a new PR to go as a bugfix against 3.2 #21813

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants