MCPcopy
hub / github.com/codeaashu/claude-code / maybeInstallIDEExtension

Function maybeInstallIDEExtension

src/utils/ide.ts:590–622  ·  view source on GitHub ↗
(
  ideType: IdeType,
)

Source from the content-addressed store, hash-verified

588}
589
590export async function maybeInstallIDEExtension(
591 ideType: IdeType,
592): Promise<IDEExtensionInstallationStatus | null> {
593 try {
594 // Install/update the extension
595 const installedVersion = await installIDEExtension(ideType)
596 // Only track successful installations
597 logEvent('tengu_ext_installed', {})
598
599 // Set diff tool config to auto if it has not been set already
600 const globalConfig = getGlobalConfig()
601 if (!globalConfig.diffTool) {
602 saveGlobalConfig(current => ({ ...current, diffTool: 'auto' }))
603 }
604 return {
605 installed: true,
606 error: null,
607 installedVersion,
608 ideType: ideType,
609 }
610 } catch (error) {
611 logEvent('tengu_ext_install_error', {})
612 // Handle installation errors
613 const errorMessage = error instanceof Error ? error.message : String(error)
614 logError(error as Error)
615 return {
616 installed: false,
617 error: errorMessage,
618 installedVersion: null,
619 ideType: ideType,
620 }
621 }
622}
623
624let currentIDESearch: AbortController | null = null
625

Callers 1

initializeIdeIntegrationFunction · 0.85

Calls 5

installIDEExtensionFunction · 0.85
logEventFunction · 0.85
getGlobalConfigFunction · 0.85
saveGlobalConfigFunction · 0.85
logErrorFunction · 0.70

Tested by

no test coverage detected