( ideType: IdeType, )
| 850 | : 'anthropic.claude-code' |
| 851 | |
| 852 | export async function isIDEExtensionInstalled( |
| 853 | ideType: IdeType, |
| 854 | ): Promise<boolean> { |
| 855 | if (isVSCodeIde(ideType)) { |
| 856 | const command = await getVSCodeIDECommand(ideType) |
| 857 | if (command) { |
| 858 | try { |
| 859 | const result = await execFileNoThrowWithCwd( |
| 860 | command, |
| 861 | ['--list-extensions'], |
| 862 | { |
| 863 | env: getInstallationEnv(), |
| 864 | }, |
| 865 | ) |
| 866 | if (result.stdout?.includes(EXTENSION_ID)) { |
| 867 | return true |
| 868 | } |
| 869 | } catch { |
| 870 | // eat the error |
| 871 | } |
| 872 | } |
| 873 | } else if (isJetBrainsIde(ideType)) { |
| 874 | return await isJetBrainsPluginInstalledCached(ideType) |
| 875 | } |
| 876 | return false |
| 877 | } |
| 878 | |
| 879 | async function installIDEExtension(ideType: IdeType): Promise<string | null> { |
| 880 | if (isVSCodeIde(ideType)) { |
no test coverage detected