Comments (23)
Are you using the latest codebase (from master
branch) of this project? I'm asking because there were Windows 10 related fixes recently.
from phpstormprotocol.
To be sure, I copied all the code there :
https://github.com/aik099/PhpStormProtocol/blob/master/PhpStorm%20Protocol%20(Win)/run_editor.js
So yes, it is the latest
I added my config.yml
from phpstormprotocol.
Then I have no idea unfortunately. I know it worked in Windows 7, where I originally tested it upon and some fixes were applied to work on Windows 8 as well.
If you find out what causing it to malfunction, then PR would be welcome.
from phpstormprotocol.
Ok, do you know how I can have a log or something to help me to know that is wrong?
from phpstormprotocol.
No idea. Probably there are some methods on WScript.
object that can be used. The Google/MSDN would know better.
from phpstormprotocol.
Same issue here, I had to align the url a bit:
phpstorm://open/?file={file}&line={line}
note the additional /
after open
from phpstormprotocol.
@buddh4 , so if you change phpstorm://open?file={file}&line={line}
with phpstorm://open/?file={file}&line={line}
in code, that is building links for you (not this protocol listener project), then it works for you?
from phpstormprotocol.
Yes, otherwise the regex does not match and the scripts exits without any errors
/^phpstorm:\/\/open\/\?(url=file:\/\/|file=)(.+)&line=(\d+)$/
from phpstormprotocol.
@buddh4 , please post actual link you click on Windows (working and non-working ones). I want to see how the path with all slashes looks like in there.
from phpstormprotocol.
Ha, it looks like change made in #25 replaced regex by making /
after open
a requirement. Before it wasn't needed at all. And now URL in README.md doesn't actually work :(
from phpstormprotocol.
What if you use phpstorm://
link as in README.md (no /
after open
) and change regular expression in run_editor.js
file from /^phpstorm:\/\/open\/\?(url=file:\/\/|file=)(.+)&line=(\d+)$/
to /^phpstorm:\/\/open\/?\?(url=file:\/\/|file=)(.+)&line=(\d+)$/
(replaced open\/
with open\/?
)?
Will it work then as well?
from phpstormprotocol.
for me the #25 is working on win 10 without doing any others edit
the only edit I made was about the exe path, because I'm using Jetbrains Toolbox
from phpstormprotocol.
Sorry for the confusion, had to do some debugging before it worked and thought it was the regex, but there probably was another issue regarding my url, now it works also without the slash.
My actual problem was, that if I set the x64: true
it searches in Program Files (x86)
, but I have a 64 bit installation in Program Files
. I also had to change from phpstorm.exe
to phpstorm64.exe
So in my case the following path is valid:
"C:\\Program Files\\JetBrains\\' + settings.folder_name + '\\bin\\phpstorm64.exe"'
from phpstormprotocol.
Nice to know. Then I'm closing this because changing binary path in config solves the problem.
from phpstormprotocol.
Hello,
I did the change with
(replaced open\/ with open\/?)
match = /^phpstorm:\/\/open\/?\?(url=file:\/\/|file=)(.+)&line=(\d+)$/.exec(url),
in the run_editor.js
And I adapt the config.yml of Symfony 3 :
ide: 'phpstorm://open/?url=file://%%f&line=%%l'
Error : File is not found
Is it the same issue or another one?
from phpstormprotocol.
I don't know, I can't easily translate French text on the images 😉
from phpstormprotocol.
Oups sorry :
"Line : 55"
Char (not sure what it is?) : 2
Error : File is not found
But May I have to create new issue?
Here the full JS :
var settings = {
// Set to 'true' (without quotes) if run on Windows 64bit. Set to 'false' (without quotes) otherwise.
x64: false,
// Set to folder name, where PhpStorm was installed to (e.g. 'PhpStorm')
folder_name: 'PhpStorm 2016.3',
// Set to window title (only text after dash sign), that you see, when switching to running PhpStorm instance
window_title: 'PhpStorm 2017.2.1',
// In case your file is mapped via a network share and paths do not match.
// eg. /var/www will can replaced with Y:/
projects_basepath: '',
projects_path_alias: ''
};
// don't change anything below this line, unless you know what you're doing
var url = WScript.Arguments(0),
match = /^phpstorm:\/\/open\/?\?(url=file:\/\/|file=)(.+)&line=(\d+)$/.exec(url),
project = '',
editor = '"C:\\' + (settings.x64 ? 'Program Files (x86)' : 'Program Files') + '\\JetBrains\\' + settings.folder_name + '\\bin\\phpstorm.exe"';
if (match) {
var shell = new ActiveXObject('WScript.Shell'),
file_system = new ActiveXObject('Scripting.FileSystemObject'),
file = decodeURIComponent(match[2]).replace(/\+/g, ' '),
search_path = file.replace(/\//g, '\\');
if (settings.projects_basepath != '' && settings.projects_path_alias != '') {
file = file.replace(new RegExp('^' + settings.projects_basepath), settings.projects_path_alias);
}
while (search_path.lastIndexOf('\\') != -1) {
search_path = search_path.substring(0, search_path.lastIndexOf('\\'));
if(file_system.FileExists(search_path+'\\.idea\\.name')) {
project = search_path;
break;
}
}
if (project != '') {
editor += ' "%project%"';
}
editor += ' --line %line% "%file%"';
var command = editor.replace(/%line%/g, match[3])
.replace(/%file%/g, file)
.replace(/%project%/g, project)
.replace(/\//g, '\\');
shell.Exec(command);
shell.AppActivate(settings.window_title);
}
from phpstormprotocol.
I have no idea. Probably something in regexp needs to be escaped differently.
from phpstormprotocol.
Ok not easy to find indeed :(
from phpstormprotocol.
Perhaps you have to align the editor
path. Try setting the path directly
editor = "<path to my phpstorm.exe>";
instead of
editor = '"C:\\' + (settings.x64 ? 'Program Files (x86)' : 'Program Files') + '\\JetBrains\\' + settings.folder_name + '\\bin\\phpstorm.exe"';
from phpstormprotocol.
Ohhh nice ! It is working ^^
Thanks !
editor = '"C:\\Program Files (x86)\\JetBrains\\' + settings.folder_name + '\\bin\\phpstorm.exe"';
from phpstormprotocol.
@Snowbaha , were you able to fix the regexp and ready to send a PR?
from phpstormprotocol.
Ok i will Try, I found the right editor path ^^ the x64 was inversed
from phpstormprotocol.
Related Issues (20)
- Provided Framework configuration doesn't work HOT 7
- How to manage it to work with projects on vagrant HOT 6
- ActiveX object not available for Windows 10 HOT 3
- Regular expression does not match HOT 19
- got an error while opening file HOT 4
- Remove "//E:JScript" HOT 11
- How to uninstall this? HOT 1
- It work but with error HOT 2
- Popup every time I trigger a link with this protocol HOT 3
- Linux support HOT 5
- Cannot find file 'C:\Windows\system32\W' HOT 7
- Please add to urldecode for linux HOT 3
- The system cannot find the file specified HOT 1
- JetBrains toolbox dir HOT 7
- can't find run_editor.js HOT 2
- wsl + docker + win10 problem HOT 9
- Problem with running this on windows HOT 2
- Can open file in PHPStrom8 HOT 6
- Problem with cloning on Windows HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpstormprotocol.