Skip to content

Commit

Permalink
Update to PHPStorm8+
Browse files Browse the repository at this point in the history
  • Loading branch information
hason committed Sep 30, 2016
1 parent 833cc2b commit 9d63e18
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion LinCastor.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Since PhpStormProtocol doesn't work as expected on OS X 10.9 (Mavericks), then I
2. unpack and move to __Applications__ folder
3. create new protocol handler using configuration from below:
![LinCastor Configuration](LinCastorConfig.png)
4. specify `pstorm://open/?url=file://%f&line=%l` in your debugger configuration (e.g. in the `xdebug.file_link_format` setting in the `php.ini`)
4. specify `phpstorm://open?url=file://%f&line=%l` in your debugger configuration (e.g. in the `xdebug.file_link_format` setting in the `php.ini`)
5. you maybe need to use different file and line placeholders (instead of `%f` and `%l`) depending on which debugger you're configuring:
* `%F` and `%L` - for [In-Portal Debugger](http://www.in-portal.org/)
* `%file` and `%line` - for [Nette Debugger](http://pla.nette.org/en/how-open-files-in-ide-from-debugger)
Expand Down
2 changes: 1 addition & 1 deletion PhpStorm Protocol (Win)/run_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var settings = {

// don't change anything below this line, unless you know what you're doing
var url = WScript.Arguments(0),
match = /^pstorm:\/\/open\/\?url=file:\/\/(.+)&line=(\d+)$/.exec(url),
match = /^phpstorm:\/\/open\?url=file:\/\/(.+)&line=(\d+)$/.exec(url),
project = '',
editor = '"C:\\' + (settings.x64 ? 'Program Files (x86)' : 'Program Files') + '\\JetBrains\\' + settings.folder_name + '\\bin\\PhpStorm.exe"';

Expand Down
4 changes: 2 additions & 2 deletions PhpStorm Protocol.app/Contents/bin/parse_url.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
URL="$1"
REGEX="^pstorm://open/\?url=file://(.*)&line=(.*)$"
REGEX="^phpstorm://open\?url=file://(.*)&line=(.*)$"

if [[ $URL =~ $REGEX ]]; then
/usr/local/bin/pstorm "${BASH_REMATCH[1]}:${BASH_REMATCH[2]}"
fi
fi
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@

Overview
========
This app allows to use ```pstorm://``` protocol to open a file in a [PhpStorm IDE](http://www.jetbrains.com/phpstorm/) the same way as it's done in [TextMate, (section 21.2)](http://manual.macromates.com/en/using_textmate_from_terminal.html).
This app allows to use ```phpstorm://``` protocol to open a file in a [PhpStorm IDE](http://www.jetbrains.com/phpstorm/) the same way as it's done in [TextMate, (section 21.2)](http://manual.macromates.com/en/using_textmate_from_terminal.html).

NOTE: Built-in ``idea://`` and ``phpstorm://`` protocols are supported in PhpStorm 8 EAP 138.190+
according to this [comment](https://youtrack.jetbrains.com/oauth?state=%2Fissue%2FIDEA-65879#comment=27-736256).

Following string must be specified as an editor in your app:
```bash
pstorm://open/?url=file://%f&line=%l
phpstorm://open?url=file://%f&line=%l
```
If something doesn't work, then feel free to [submit an issue](https://github.com/aik099/PhpStormProtocol/issues/new) on GitHub.

Expand Down

5 comments on commit 9d63e18

@King2500
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you forget to update the run_editor.reg file? (still pstorm registered there)

My current PhpStorm 2016.2 installation (Windows) does not have a built-in support for phpstorm://

@aik099
Copy link
Owner

@aik099 aik099 commented on 9d63e18 Nov 4, 2016

Choose a reason for hiding this comment

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

Did you forget to update the run_editor.reg file? (still pstorm registered there)

The run_editor.reg file doesn't contain PhpStorm version. It's the run_editor.js that has it and it's up to date as far as I can see.

My current PhpStorm 2016.2 installation (Windows) does not have a built-in support for phpstorm://

Sad. The project is specially designed to fill the gap and allow any PhpStorm (or other JetBrains IDE) to emulate url handling capabilities.

@King2500
Copy link
Contributor

Choose a reason for hiding this comment

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

.reg and .js don't fit together here. If you change from pstorm: to phpstorm: you have to update the .reg file as well.

@aik099
Copy link
Owner

@aik099 aik099 commented on 9d63e18 Nov 4, 2016

Choose a reason for hiding this comment

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

Ah. I thought version of PhpStorm was incorrect. Then yes, please send PR for correcting that.

@hason
Copy link
Contributor Author

@hason hason commented on 9d63e18 Nov 4, 2016

Choose a reason for hiding this comment

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

@King2500 Thanks! See #21

Please sign in to comment.