Support for xdebug.file_link_format?

Hi,

before starting to use PhpStorm, I used (and still use) BBEdit on Mac OS X, which supports the “txmt://” URL scheme which was introduced by TextMate. Therefore, I can configure Xdebug like this:
xdebug.file_link_format = "txmt://open?url=file://%f&line=%l"
This will have the effect that whenever Xdebug encounters a problem and displays a callstack, the filenames and line numbers are links which can be clicked to directly get to precise location in the code. Question: is there an URL scheme which is supported by PhpStorm to get this behaviour? If not, it would be a great addition.

Carsten

4 comments
Comment actions Permalink

Thanks for your answer. Probably I am a bit slow, but: “vote”? Even after signing in into Youtrack, I don’t see anything like voting.

For the time being, I use an AppleScript-based workaround which might be interesting for other Mac users as well. Nothing exciting, just the typical approach for custom URL handling:


on open location (theURL)
 set oldTID to AppleScript's text item delimiters
 set AppleScript's text item delimiters to "://"
 
 if text item 1 of theURL is not "x-phpstorm" then
 -- Theoretically, this can never happen
 activate
display dialog "Unsupported URL scheme \"" & text item 1 of theURL & "\""
 return
 end if
 
 set remainURL to text item 2 of theURL
 set AppleScript's text item delimiters to ":"
 set urlParts to every text item of remainURL
 set AppleScript's text item delimiters to oldTID
 
 try
do shell script "/Applications/PhpStorm.app/Contents/MacOS/idea --line " & (item 2 of urlParts) & " " & item 1 of urlParts
 on error
 -- For some reason PhpStorm will return an exit status other than 0
 end try
tell application "PhpStorm" to activate
end open location


Paste this into script editor, save it as an application, go into the application bundle and add the following lines in the Info.plist file:

 <array>
    <dict>
    <key>CFBundleURLSchemes</key>
    <array>
    <string>x-phpstorm</string>
    </array>
    </dict>
 </array>


That’s it. In case your path to PhpStorm differs or you prefer a different link scheme, you can certainly modify it as you like. It also wouldn’t be hard to do it in Cocoa, but AS is definitely simpler.

Carsten
0
Comment actions Permalink

Hello C B,

Sorry for delay.

Thanks for sharing!

Thanks for your answer. Probably I am a bit slow, but: “vote”? Even after signing in into Youtrack, I don’t see anything like voting.

vote_button.png

Thank you for feedback!

0
Comment actions Permalink

Hi,

a few days ago, I finally found it ;-)  (and voted, of course).
Nevertheless, thanks for your answer.

Carsten

0

Please sign in to leave a comment.