fix(editor): open VS Code-family editors at the clicked line on macOS (#42613)

When a linked file's macOS default app is Cursor, VS Code or VS Code
Insiders, hand it `--goto path:line:column` with
`open -n -g -a <app> --args`, the same LaunchServices hand-off the bundled
CLI ends in, minus the CLI's Node startup and `--env` forwarding. The
editor sees a desktop (non-Dock) open, so it reuses the file's window as
a CLI open would. An empty env keeps Orca's variables out of the editor
and lets a cold start resolve the login-shell env. `open` returns once
the app has launched, like shell.openPath, so there is no timer; a
non-zero exit or spawn error falls back to shell.openPath. Other
platforms, other apps, links without a line, and files main reveals
instead of opening are unchanged.

The IPC location reuses RuntimeFileOpenPosition. Moves the positive
safe-integer guard to src/shared so this and its two existing copies
share one definition.

Fixes #29508

Co-authored-by: Takumi Hara <takumihara1226@gmail.com>
This commit is contained in:
Neil
2026-11-14 21:15:22 -08:00
committed by GitHub
co-authored by Takumi Hara
parent d5a90c0da0
commit 07eced7636
11 changed files with 213 additions and 22 deletions
@@ -1,6 +1,4 @@
export function isPositiveSafeInteger(value: unknown): value is number {
return typeof value === 'number' && Number.isSafeInteger(value) && value > 0
}
import { isPositiveSafeInteger } from '../../../../shared/positive-safe-integer'
export function isGitObjectId(value: unknown): value is string {
return typeof value === 'string' && /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/i.test(value)