mirror of
https://github.com/stablyai/orca.git
synced 2026-11-17 03:15:01 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user