Skip to content

Commit 363d2fa

Browse files
committed
fix: preserve line-aware args in the macOS PHPStorm fallback
1 parent 742857c commit 363d2fa

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

  • src-tauri/src/shared/workspaces_core

src-tauri/src/shared/workspaces_core/io.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,24 @@ pub(crate) async fn open_workspace_in_core(
269269
.await
270270
.map_err(|error| format!("Failed to open app ({target_label}): {error}"))?
271271
} else {
272+
let fallback_app_args = if matches!(
273+
app_strategy,
274+
Some(LineAwareLaunchStrategy::JetBrainsLineColumnFlags)
275+
) && normalize_open_location(line, column).is_some()
276+
{
277+
build_launch_args(&path, &args, line, column, app_strategy)
278+
} else {
279+
Vec::new()
280+
};
272281
let mut cmd = tokio_command("open");
273-
cmd.arg("-a").arg(trimmed).arg(&path);
274-
if !args.is_empty() {
275-
cmd.arg("--args").args(&args);
282+
cmd.arg("-a").arg(trimmed);
283+
if fallback_app_args.is_empty() {
284+
cmd.arg(&path);
285+
if !args.is_empty() {
286+
cmd.arg("--args").args(&args);
287+
}
288+
} else {
289+
cmd.arg("--args").args(&fallback_app_args);
276290
}
277291
cmd.output()
278292
.await

0 commit comments

Comments
 (0)