Coder Social home page Coder Social logo

Comments (7)

aik099 avatar aik099 commented on May 25, 2024

The format of URLs you're generating in your app is incorrect.

It should be:

phpstorm://open?file=/path/to/file.php&line=15

You're using:

phpstorm://open?url=file://path/to/file.php&line=15

.

from phpstormprotocol.

tmiecz avatar tmiecz commented on May 25, 2024

Thanks for the reply @aik099 - I appreciate it!

I tried the alternative style link:
phpstorm://open?file=W:/index.php&line=15

It's the same issue with prompt:
Cannot find file 'C:\Windows\system32\W

Once I click "OK" the actual index.php opens up.
Hmm... maybe I need to tweak the run_editor.js some more. I'll keep looking. If I find a solution I will post it here.

from phpstormprotocol.

aik099 avatar aik099 commented on May 25, 2024

Strange. I wasn't having such an issue when developing & testing this on Windows 7. People using Window 10 also reported it to be working out of the box (once you configure where PhpStorm is located).

What is the Windows version you're using?

from phpstormprotocol.

tmiecz avatar tmiecz commented on May 25, 2024

It's Windows 10 Home version 20H2.
Maybe it's an issue because the drive is a network drive... so maybe it's trying to locate actual drive (no match, but still the path is valid so it opens it up)? I'll test it on the computer that has the code tomorrow, but I've already added to all of my debug pages online - it's a true game changer. Thanks for doing this.

from phpstormprotocol.

aik099 avatar aik099 commented on May 25, 2024

Try installing some JavaScript debugger or use the free app (if available on Windows) so do real-time debugging of the run_editor.js file. This way you can find where it fails exactly.

My guess would be the ActiveX component registration problem.

You can also run wscript ... command (from the run_editor.reg file) by hand with the actual path put instead of %1 and see what happens.

from phpstormprotocol.

tmiecz avatar tmiecz commented on May 25, 2024

Hmm, I wouldn't know how to begin debugging windows JS, I'll just deal with the issue.
After I updated PhpStorm to newest version, instead of throwing an error it opens up a path that doesn't exist:
C:\Windows\system32\W
Honestly no clue where to begin fixing that, so I'll just leave it and perhaps someone else comes around with a solution.


On another note, I looked through your code and found shell.AppActivate call that never worked for me. When PhpStorm has a specific project open, the window title becomes the name of the project. So in my case, I named the project "whois" and then I hardcoded that value to the window switching call: "shell.AppActivate('whois');" - that opens up the file and switches to my project.

The problem now is that I will have another PhpStorm window open with bunch of empty W files that I will need to keep closing every now and then. :)

My suggestion for window switching would be to allow another parameter to be passed in the URL for the project name... would be great if we could have 2 projects open and the link would know which project to open this file in, i.e:

phpstorm://open?file=/path/to/file.php&line=15&project=whois

from phpstormprotocol.

aik099 avatar aik099 commented on May 25, 2024

Hmm, I wouldn't know how to begin debugging windows JS, I'll just deal with the issue.
After I updated PhpStorm to newest version, instead of throwing an error it opens up a path that doesn't exist:
C:\Windows\system32\W
Honestly no clue where to begin fixing that, so I'll just leave it and perhaps someone else comes around with a solution.

Agreed.

My suggestion for window switching would be to allow another parameter to be passed in the URL for the project name... would be great if we could have 2 projects open and the link would know which project to open this file in, i.e:

phpstorm://open?file=/path/to/file.php&line=15&project=whois

For me window title is:

project name [/path/to/project] - .../relative/path/to/opened/file.php

I'm on Mac though. Maybe the window title on Windows is different and more static.

Anyway the shell.AppActivate('... call is only activating window as configured. For example:

  • either you either use JetBrains Toolbox integration and it guesses window title
  • or you define "window_title" setting upfront

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.