Coder Social home page Coder Social logo

Comments (28)

aik099 avatar aik099 commented on June 5, 2024

Created what, pstorm file? Yes this was done by IDE and I've explained in manual how to do this too.

from phpstormprotocol.

th3fallen avatar th3fallen commented on June 5, 2024

When im using this handler it just brings my phpstorm to the foreground but doesnt open any files or go to any lines any ideas?

from phpstormprotocol.

aik099 avatar aik099 commented on June 5, 2024

It's good, that PhpStorm is opened at all, because this proves that there is /Applications/PhpStorm.app and you have pstrom script. I personally have 2 of them with different names.

Also note, that links, that you're clicking must have absolute path to file, that will be opened on Mac. For example I have webserver running in Virtual Machine and I need to map paths in my web application to allow building paths to Mac, where PhpStorm will process them.

from phpstormprotocol.

th3fallen avatar th3fallen commented on June 5, 2024

i have absolute paths im trying to use your handler with whoops (nice combo) this is the exact url it has on a dummy example project

pstorm://open/?url=file:///Users/clarktomlinson/Sites/Work/Wordpress-Installs/INSPComposer/wp-content/themes/twentytwelve/index.php&line=18

from phpstormprotocol.

aik099 avatar aik099 commented on June 5, 2024

does pstorm /Users/clarktomlinson/Sites/Work/Wordpress-Installs/INSPComposer/wp-content/themes/twentytwelve/index.php:18 command open the file?

from phpstormprotocol.

th3fallen avatar th3fallen commented on June 5, 2024

yep thats the odd part. running pstorm in the command line works perfectly.

from phpstormprotocol.

aik099 avatar aik099 commented on June 5, 2024

Does pstorm://open/?url=file:///Users/clarktomlinson/Sites/Work/Wordpress-Installs/INSPComposer/wp-content/themes/twentytwelve/index.php&line=18 url (when copy/pasted to browser tab and executed) open PhpStorm with a file?

Maybe it doesn't work in one particular browser and works with others. I've tested with Firefox and Chrome. On first run I presented with a dialog asking me "do you trust PhpStormProtocol.app to open this url". After answering "yes" a file was opened. But what's important is to have project already opened in PhpStorm before trying to use that link.

from phpstormprotocol.

aik099 avatar aik099 commented on June 5, 2024

What happens if you call https://github.com/aik099/PhpStormProtocol/blob/master/PhpStorm%20Protocol.app/Contents/bin/parse_url.sh script with an url given? It surely does something and maybe fails for unknown reason.

from phpstormprotocol.

th3fallen avatar th3fallen commented on June 5, 2024

the project is open and i did get the protesting box about trusting the app which i accepted and no pasting the link in the browser doesnt work either in safari or chrome. Chrome just wants to do a google search.

from phpstormprotocol.

th3fallen avatar th3fallen commented on June 5, 2024

when running that i get this

Clarks-MacBook-Pro:bin clarktomlinson$ ./parse_url.sh pstorm://open/?url=file:///Users/clarktomlinson/Sites/Work/Wordpress-Installs/INSPComposer/wp-content/themes/twentytwelve/index.php&line=18
[1] 8706
Clarks-MacBook-Pro:bin clarktomlinson$ ./parse_url.sh pstorm://open/?url=file:///Users/clarktomlinson/Sites/Work/Wordpress-Installs/INSPComposer/wp-content/themes/twentytwelve/index.php&line=18
[2] 8707
[1] Done ./parse_url.sh pstorm://open/?url=file:///Users/clarktomlinson/Sites/Work/Wordpress-Installs/INSPComposer/wp-content/themes/twentytwelve/index.php
Clarks-MacBook-Pro:bin clarktomlinson$ ./parse_url.sh pstorm://open/?url=file:///Users/clarktomlinson/Sites/Work/Wordpress-Installs/INSPComposer/wp-content/themes/twentytwelve/index.php&line=18
[3] 8708
[2] Done ./parse_url.sh pstorm://open/?url=file:///Users/clarktomlinson/Sites/Work/Wordpress-Installs/INSPComposer/wp-content/themes/twentytwelve/index.php
Clarks-MacBook-Pro:bin clarktomlinson$ ./parse_url.sh pstorm://open/?url=file:///Users/clarktomlinson/Sites/Work/Wordpress-Installs/INSPComposer/wp-content/themes/twentytwelve/index.php&line=18
[4] 8709
[3] Done ./parse_url.sh pstorm://open/?url=file:///Users/clarktomlinson/Sites/Work/Wordpress-Installs/INSPComposer/wp-content/themes/twentytwelve/index.php

thats running it a few times also thanks for your assitance btw

from phpstormprotocol.

aik099 avatar aik099 commented on June 5, 2024

How are you building url (in your app), that is to be processed by PhpStormProtocol? Are you properly escaping url that goes to url parameter? Using urlencode (or rawurlencode) for example?

from phpstormprotocol.

th3fallen avatar th3fallen commented on June 5, 2024

i wasnt but when i attempted to just now i still get nothing

from phpstormprotocol.

aik099 avatar aik099 commented on June 5, 2024

Try using textmate url scheme (http://manual.macromates.com/en/using_textmate_from_terminal.html):

txmt://open/?url=file://~/.bash_profile&line=11&column=2

This way you can test if you properly escaping url.

from phpstormprotocol.

th3fallen avatar th3fallen commented on June 5, 2024

still nothing on my end

from phpstormprotocol.

aik099 avatar aik099 commented on June 5, 2024

Doesn't work even with TextMate?

from phpstormprotocol.

th3fallen avatar th3fallen commented on June 5, 2024

oh no text mate works fine

Clark Tomlinson
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Wednesday, June 19, 2013 at 11:35 AM, Alexander Obuhovich wrote:

Doesn't work even with TextMate?


Reply to this email directly or view it on GitHub (#2 (comment)).

from phpstormprotocol.

aik099 avatar aik099 commented on June 5, 2024

My best bet is on incorrect url escaping. Maybe TextMate solved that problem somehow. I don't have any urls, that doesn't work to test with.

I think, that parse_url.sh isn't really parsing any filename from given url and that's why it doesn't work.

If you wish to debug further you can display parsed filename & line number instead of giving them to pstrom. From there you can either get empty string or some extra symbols, that are in fact preventing pstorm script from working with them.

from phpstormprotocol.

th3fallen avatar th3fallen commented on June 5, 2024

how could i do that my bash skills are all but null but that would be very helpful

from phpstormprotocol.

aik099 avatar aik099 commented on June 5, 2024

Here is what you have now:

#!/bin/sh
URL="$1"
REGEX="^pstorm://open/\?url=file://(.*)&line=(.*)$"

if [[ $URL =~ $REGEX ]]; then
    /usr/local/bin/pstorm "${BASH_REMATCH[1]}:${BASH_REMATCH[2]}"
fi

Here is what you need to have:

#!/bin/sh
URL="$1"
REGEX="^pstorm://open/\?url=file://(.*)&line=(.*)$"
echo "URL: $URL"

if [[ $URL =~ $REGEX ]]; then
    echo "MATCH: ${BASH_REMATCH[1]}:${BASH_REMATCH[2]}"
else
    echo "NO MATCH"
fi

from phpstormprotocol.

th3fallen avatar th3fallen commented on June 5, 2024

Could you give an example that works for you so i can test please

Clark Tomlinson
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Wednesday, June 19, 2013 at 11:48 AM, Alexander Obuhovich wrote:

Here is what you have now:
#!/bin/sh URL="$1" REGEX="^pstorm://open/?url=file://(.)&line=(.)$" if [[ $URL =~ $REGEX ]]; then /usr/local/bin/pstorm "${BASH_REMATCH[1]}:${BASH_REMATCH[2]}" fi

Here is what you need to have:
#!/bin/sh URL="$1" REGEX="^pstorm://open/?url=file://(.)&line=(.)$" echo "URL: $URL" if [[ $URL =~ $REGEX ]]; then echo "MATCH: ${BASH_REMATCH[1]}:${BASH_REMATCH[2]}" else echo "NO MATCH" fi


Reply to this email directly or view it on GitHub (#2 (comment)).

from phpstormprotocol.

aik099 avatar aik099 commented on June 5, 2024

This is copy/pasted from a link, clicking on which opens PhpStorm with that file: pstorm://open/?url=file:///Volumes/web/d/in-portal.52x/core/kernel/application.php&line=303.

In my debugger I have following HTML that makes that link:
<a href="pstorm://open/?url=file:///Volumes/web/d/in-portal.52x/core/kernel/application.php&line=303">application.php:303</a>.

It seems, that even don't escape url at all and it still works :)

from phpstormprotocol.

aik099 avatar aik099 commented on June 5, 2024

@th3fallen, I've found that this no longer works with PhpStorm 6.0.3. But it was working with PhpStorm 5.0.4.

I guess something changed on PhpStorm side.

from phpstormprotocol.

th3fallen avatar th3fallen commented on June 5, 2024

ha! im not crazy! glad to know its not me being incompetent.

from phpstormprotocol.

aik099 avatar aik099 commented on June 5, 2024

Also after upgrading to OSX 10.8.4 I can't get my app to work anymore, because it's throwing an error, when executed by double clicking PhpStorm Protocol in applications.

Any decent applescript debugging tools out there, that you might recommend? When I set file url in a local variable and test it all works. But it comes in reality through protocol handler it doesn't work.

from phpstormprotocol.

lsmith77 avatar lsmith77 commented on June 5, 2024

using OSX 10.9.2 with phpStorm 7.1.3
I installed the app and launched it

on the command line using $ pstorm /Users/lsmith/htdocs/cmf-sandbox/app/AppKernel.php works as expected but opening the URL pstorm://open/?url=file:///Users/lsmith/htdocs/cmf-sandbox/app/AppKernel.php&line=10 nothing happens.

from phpstormprotocol.

lsmith77 avatar lsmith77 commented on June 5, 2024

ok got it working with https://github.com/aik099/PhpStormProtocol/blob/master/LinCastor.md

from phpstormprotocol.

aik099 avatar aik099 commented on June 5, 2024

I guess in my original solution (that doesn't involve LinCastor) something isn't correctly escaped between AppleScript and Shell Script. If you can fix it, then PR is welcome.

from phpstormprotocol.

aik099 avatar aik099 commented on June 5, 2024

Closing because LinCastor solution for Mac users is clearly superior, then current implementation.

from phpstormprotocol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.