* Build goto-line argv for a GUI editor. VS Code family uses -g file:line; * subl uses bare file:line; others don't support goto-line.
( guiFamily: string, filePath: string, line: number | undefined, )
| 56 | * subl uses bare file:line; others don't support goto-line. |
| 57 | */ |
| 58 | function guiGotoArgv( |
| 59 | guiFamily: string, |
| 60 | filePath: string, |
| 61 | line: number | undefined, |
| 62 | ): string[] { |
| 63 | if (!line) return [filePath] |
| 64 | if (VSCODE_FAMILY.has(guiFamily)) return ['-g', `${filePath}:${line}`] |
| 65 | if (guiFamily === 'subl') return [`${filePath}:${line}`] |
| 66 | return [filePath] |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Launch a file in the user's external editor. |
no test coverage detected