( command: string, )
| 988 | } |
| 989 | |
| 990 | async function getInstalledVSCodeExtensionVersion( |
| 991 | command: string, |
| 992 | ): Promise<string | null> { |
| 993 | const { stdout } = await execFileNoThrow( |
| 994 | command, |
| 995 | ['--list-extensions', '--show-versions'], |
| 996 | { |
| 997 | env: getInstallationEnv(), |
| 998 | }, |
| 999 | ) |
| 1000 | const lines = stdout?.split('\n') || [] |
| 1001 | for (const line of lines) { |
| 1002 | const [extensionId, version] = line.split('@') |
| 1003 | if (extensionId === 'anthropic.claude-code' && version) { |
| 1004 | return version |
| 1005 | } |
| 1006 | } |
| 1007 | return null |
| 1008 | } |
| 1009 | |
| 1010 | function getVSCodeIDECommandByParentProcess(): string | null { |
| 1011 | try { |
no test coverage detected