fix(desktop): use bundle IDs for multi-edition JetBrains IDEs#1317
Conversation
`open -a "IntelliJ IDEA"` fails when only an edition-specific variant is installed (e.g. "IntelliJ IDEA Ultimate.app"). Use `open -b` with bundle IDs instead, which resolves correctly regardless of app name. Tries each candidate in order, falling back to the next on failure. Closes #1314
📝 WalkthroughWalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant getAppCommand as getAppCommand<br/>(helpers)
participant OSExec as OS Execution<br/>(spawn)
participant Fallback as Fallback<br/>(shell.openPath)
Caller->>getAppCommand: getAppCommand(app, path)
alt Multi-edition app (IntelliJ, PyCharm)
getAppCommand-->>Caller: [cmd1(bundle1), cmd2(bundle2), ...]
else Single-edition or standard app
getAppCommand-->>Caller: [cmd(app-name)]
else Unsupported app
getAppCommand-->>Caller: null
end
Caller->>OSExec: Iterate candidates: spawn(cmd[0])
alt Success
OSExec-->>Caller: ✓ Process spawned
else Failure with more candidates
OSExec-->>Caller: ✗ Error, try next
Caller->>OSExec: spawn(cmd[1])
OSExec-->>Caller: ✓ Process spawned
else All candidates failed
OSExec-->>Caller: ✗ Last error
Caller->>Fallback: shell.openPath(path)
Fallback-->>Caller: ✓ Fallback opened
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
open -b <bundleId>instead ofopen -a <appName>for IntelliJ and PyCharm, which have multiple editions (Ultimate/Professional vs Community).appdisplay name, so "IntelliJ IDEA Ultimate.app", "IntelliJ IDEA CE.app", etc. all resolve correctlyCloses #1314
Test plan
bun test)bun run lint:fix)open -b com.jetbrains.intellijopens IntelliJ on a machine with Ultimate installedcom.jetbrains.intellij.ceworks when only Community is installedSummary by CodeRabbit
Release Notes
New Features
Improvements