0

PhpStorm doesn't open files via xdebug.file_link_format.

I tried different formats, and still doesn't work. I open link in new tab and nothing happens. Path is writing correct in address bar

xdebug.file_link_format = "phpstorm://open?file=%f&line=%l"
3
  • It was working. Maybe because my disk name is BOOTCAMP (C:\). Or phpstorm not in PATH? Or PhpStorm removed this feature? Commented Oct 14, 2019 at 17:50
  • Can I create my custom protocol for phpstorm, what can open file and line? Commented Oct 14, 2019 at 21:14
  • 1
    It's only supported for macOS out-of-the-box, for Windows, you need a 3rd party solution: github.com/aik099/PhpStormProtocol youtrack.jetbrains.com/issue/IDEA-65879 Commented Oct 17, 2019 at 9:58

1 Answer 1

1

I created my own protocol and custom program to open file in phpstorm

myproto.reg:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\myproto]
@="phpstorm"
"URL Protocol"=""

[HKEY_CURRENT_USER\Software\Classes\myproto\shell]

[HKEY_CURRENT_USER\Software\Classes\myproto\shell\open]

[HKEY_CURRENT_USER\Software\Classes\myproto\shell\open\command]
@="\"C:\\Program Files\\nodejs\\node.exe\" \"C:\\Users\\Alexander\\Desktop\\web\\ahk\\phpstorm.js\" \"%1\""

phpstorm.js:

const child_process = require('child_process');
const fs = require('fs')

let path = process.argv[2]
path = path.replace('myproto://','')
path = decodeURIComponent(path)
path = path.replace(/\/$/,'')

ls = child_process.exec('"C:\\Program Files\\JetBrains\\PhpStorm 2019.1.1\\bin\\phpstorm64.exe" ' + path + '')

php.ini:

xdebug.file_link_format = "myproto://%f:%l"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.