Closed PhilETaylor closed 1 year ago
Hi,
Putting path to new binaries location, solved the issue?
About the sourcing of ~/.zshrc
I notice slow startup only with heavy 3rd party module (like fig).
I will working on something more faster in few weeks/months, but will be for Alfred5+ only
I am already sourcing the .zshrc and accepting the 4 second delay (my causing, my zshrc does a lot :-))
The problem though is that your code:
if [[ -n "{query}" ]]; then
QUERY="{query}"
BIN=${jb_bin}
PROJECT_NAME=${jb_project_name}
source ~/.zshrc
$(${BIN} "${QUERY}")
echo ${PROJECT_NAME}
fi
runs AFTER the pstorm script filter
which runs src/index.js
I have tried modifying the PATH also by changing the pstorm script filter to be
export PATH="/Applications/PhpStorm.app/Contents/MacOS:$PATH"
./node_modules/.bin/run-node src/index.js "$1" "PhpStorm"
and that did not work either
Im still unable to get this plugin to find the phpstorm
binary
No idea where else to specifically state where the binary is
I even tried symlinking the binary into /usr/local/bin
without success.
0 lrwxr-xr-x@ 1 phil 61 Mar 13 12:50 phpstorm -> /Applications/PhpStorm 2023.1 EAP.app/Contents/MacOS/phpstorm
0 lrwxr-xr-x@ 1 phil 61 Mar 13 12:51 pstorm -> /Applications/PhpStorm 2023.1 EAP.app/Contents/MacOS/phpstorm
Yes, I tried the same operation as @PhilETaylor, but it didn't work either. There are still the same issues in the official version.
I bump all available IDE to 2023.1 and no visible change. here with WebStorm (since PhpStorm is not yet available in 2023.1)
I use JetBrains Toolbox, configured like this
default settings when I install Toolbox few years ago (yes I haven't refresh my laptop since a while)
hi,
take a look on latest release
Error: Can't find application path for PhpStorm.
at getApplicationPath (file:///opt/homebrew/lib/node_modules/@bchatard/alfred-jetbrains/src/findProduct.js:165:9)
at findProduct (file:///opt/homebrew/lib/node_modules/@bchatard/alfred-jetbrains/src/findProduct.js:175:31)
at file:///opt/homebrew/lib/node_modules/@bchatard/alfred-jetbrains/src/index.js:16:17
- JetBrains - Open Project - v3 1.9.8 Alfred 5.1 darwin 22.5.0
$ which phpstorm
/Applications/PhpStorm 2023.1 EAP.app/Contents/MacOS/phpstorm
Can you switch to regular version (EAP support is not "official")?
And put the content of phpstorm
?
I also have/had the standard regular version installed too
also note my default shell is zsh and not bash - no idea if that is an issue
0 drwxr-xr-x@ 3 phil 96 Apr 4 12:00 PhpStorm 2023.1 EAP.app
0 drwxr-xr-x@ 3 phil 96 Mar 29 22:03 PhpStorm.app
so a few other points
If I change the RegExp for the non ToolBox case to JetBrains
like
// non Toolbox case
const oldPattern = new RegExp("JetBrains");
const oldMatch = oldPattern.exec(binContent);
if (oldMatch && oldMatch.length === 1) {
return oldMatch[1];
}
THEN IT WORKS!!!
This is because phpstorm
file is now a binary, and there is limited text in it - example:
I have no idea what's going on now. I have reinstalled from scratch and your original code works. hmm.....
edit..... ahhhh caching alfy.cache.get
ok ignore everything I said. It doesn't work. :( I need sleep and I'll try again
ok this works
const path = `${process.env.PATH}:${toolboxScriptPath}:/Applications/PhpStorm.app/Contents/MacOS`;
const oldPattern = new RegExp("JetBrains");
const oldMatch = oldPattern.exec(binContent);
if (oldMatch && oldMatch.length === 1) {
return oldMatch[1];
}
and then it WORKS every time.
Changing the path to have the EAP in it, also works and opens the EAP.
const path = `${process.env.PATH}:${toolboxScriptPath}:/Applications/PhpStorm 2023.1 EAP.app/Contents/MacOS`;
however... the new phpstorm binary holds the process open in Alfred, meaning that you can only launch one project because when you try to launch again using Alfred, to switch project, nothing happens - until you quit phpstorm, and then another phpstorm app opens with the second project magically like it was queued
It seems this new phpstorm binary acts totally different :(
I have this, a helper script available globally
which contains link to "real bin"
I'm really curious about all this change...
That script appears to be "generated by toolbox"
Im not using toolbox to install/manage my phpStorm (why would anyone, its just overkill, uses resources that are not needed constantly running in the background)
But did you generate script as mentioned in documentation?
Please read the opening post for this issue again.
You can no longer generate the script. phpStorm no longer has that option.
When you go to Tools -> Create command line launcher you get this popup
The "Online help" link goes to https://www.jetbrains.com/help/phpstorm/working-with-the-ide-features-from-command-line.html
The command line launcher script has been deprecated by phpStorm and is no longer generated or used.
Ok, so for now I have no clean solution. Your solution works fine? Can you create a PR?
I'm currently working on a v2 which should fix this kind of issue
my solution works to launch phpStorm if its not yet open, but it cannot be used to switch projects if phpStorm is already open as the new binary just hangs until you close phpstorm, and once closed Alfred is then able to reopen it, meaning you cannot invoke phpStorm twice using your workflow, making the workflow pretty useless (Although, I rarely use your workflow now, as the new phpStorm UI has a great project switcher with cmd+o to launch the Recent Projects dialog
Ok, maybe some additional parameters are needed to execute the process in background properly (like in toolbox script)
I re-read the doc you mentioned in first comment, I will use open command from macOS to start ide
My Intellij IDEA 2023.1 (New versions), got seems to be same issue.
Hi,
If you are adventurous, you can try the v2 pre-release. Be careful, it's a pre-release, tested on Intel mac
Can be installed like this: npm install -g @bchatard/alfred-jetbrains@next
This should fix issue with 2023 version (tested with PyCharm, installed from dmg)
Absolutely flawless! (After I downgraded from EAP to Stable phpStorm)
🚀 Thanks!
Sign up for GitHub Sponsors, https://github.com/sponsors or add a donation/buy now button :)
thanks for your feedback!
if you have time to send me (via an other issue), more feedback (speedier, search more accurate, macos version/chip etc) I really love it
release v2 today
FAQ
Describe the bug
in phpStorm 2023.1 EAP (without toolbox) it looks like the command line launcher
pstorm
is no longer a thingTo Reproduce
When you go to Tools -> Create Command Line Launcher you get:
The link for
online help
goes to https://www.jetbrains.com/help/phpstorm/working-with-the-ide-features-from-command-line.htmlI have added the following in my .zshrc (but including the whole .zshrc slows things down anyway https://github.com/bchatard/alfred-jetbrains/issues/271)
Error on invoking this plugin with Alfred
- JetBrains - Open Project - v3 1.9.7 Alfred 5.0.6 darwin 22.4.0
Expected behavior
Alfred can no longer find phpStorm to launch
Alfred Version
5.06[2110]
Node Version
19.7.0
NPM Version
9.5.1
Jetbrains Product & Version
phpStorm 2023.1 EAP
Installation type
npm -i
OS
macOS 13.3 Beta 2