fix: intellij not being visible even though it's installed #1828
Closedtomaspiaggio(GitHub profile, opens in a new tab)wants to merge 3 commits into
main fromrefs/pull/1828/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
- apps/server/src/open.ts lines 308 to 312OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -269,5 +296,17 @@269296 }270297271298 if (editorDef.commands) {272- const command =273- resolveAvailableCommand(editorDef.commands, { platform, env }) ?? editorDef.commands[0];299+ const command = resolveAvailableCommand(editorDef.commands, { platform, env });300+ if (command) {301+ return {302+ command,303+ args: resolveCommandEditorArgs(editorDef, input.cwd),304+ };305+ }306+307+ if (isAppInstalled(editorDef, platform)) {308+ return {309+ command: "open",310+ args: ["-a", editorDef.appName, input.cwd],311+ };312+ }
- @@ -269,5 +296,17 @@269296 }270297271298 if (editorDef.commands) {272- const command =273- resolveAvailableCommand(editorDef.commands, { platform, env }) ?? editorDef.commands[0];299+ const command = resolveAvailableCommand(editorDef.commands, { platform, env });300+ if (command) {301+ return {302+ command,303+ args: resolveCommandEditorArgs(editorDef, input.cwd),304+ };305+ }306+307+ if (isAppInstalled(editorDef, platform)) {308+ return {309+ command: "open",310+ args: ["-a", editorDef.appName, input.cwd],311+ };312+ }
- @@ -221,3 +226,21 @@221226 }),222227 );223228229+ it.effect("falls back to open -a on macOS when CLI is missing but .app is installed", () =>230+ Effect.gen(function* () {231+ const idea = EDITORS.find((e) => e.id === "idea");232+ assert.isDefined(idea);233+234+ if (!isAppInstalled(idea, "darwin")) return;235+236+ const launch = yield* resolveEditorLaunch(237+ { cwd: "/tmp/workspace", editor: "idea" },238+ "darwin",239+ { PATH: "" },240+ );241+ assert.deepEqual(launch, {242+ command: "open",243+ args: ["-a", "IntelliJ IDEA", "--args", "/tmp/workspace"],244+ });245+ }),246+ );
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
3b832374-d1f0-44ea-b900-20d14e76b6ccYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
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.
❤️ Share