そのままではありませんが、リンクを機能させることは可能です。これは Windows 7、Firefox、および PhpStorm 10 で動作します。この例では、 protocol を使用していますphpstorm://
が、これは名前に関係なく動作します。
// note: edit the path, with backslashes escaped
var editor = '"c:\\Program Files (x86)\\JetBrains\\PhpStorm 143.434\\bin\\PhpStorm.exe" nosplash --line %line% "%file%"';
var url = WScript.Arguments(0);
var match = /^phpstorm:\/\/open\/\?file=(.+)&line=(\d+)$/.exec(url);
if (match) {
var file = decodeURIComponent(match[1]).replace(/\+/g, ' ');
var command = editor.replace(/%line%/g, match[2]).replace(/%file%/g, file);
var shell = new ActiveXObject("WScript.Shell");
shell.Exec(command.replace(/\\/g, '\\\\'));
}
- レジストリにプロトコルを作成します。次のように作成し、レジストリ
editor.reg
にインポートします。上記のファイルへのパスをダブルエスケープし、ファイルが保存されている場所に設定する必要があることに注意してください。
REGEDIT4
[HKEY_CLASSES_ROOT\phpstorm]
@="URL:phpstorm Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\phpstorm\shell\open\command]
@="wscript \"C:\\path\\to\\run-editor.js\" \"%1\""