(t0)
| 15 | mcpClients: MCPServerConnection[]; |
| 16 | }; |
| 17 | export function useIDEStatusIndicator(t0) { |
| 18 | const $ = _c(26); |
| 19 | const { |
| 20 | ideSelection, |
| 21 | mcpClients, |
| 22 | ideInstallationStatus |
| 23 | } = t0; |
| 24 | const { |
| 25 | addNotification, |
| 26 | removeNotification |
| 27 | } = useNotifications(); |
| 28 | const { |
| 29 | status: ideStatus, |
| 30 | ideName |
| 31 | } = useIdeConnectionStatus(mcpClients); |
| 32 | const hasShownHintRef = useRef(false); |
| 33 | let t1; |
| 34 | if ($[0] !== ideInstallationStatus) { |
| 35 | t1 = ideInstallationStatus ? isJetBrainsIde(ideInstallationStatus?.ideType) : false; |
| 36 | $[0] = ideInstallationStatus; |
| 37 | $[1] = t1; |
| 38 | } else { |
| 39 | t1 = $[1]; |
| 40 | } |
| 41 | const isJetBrains = t1; |
| 42 | const showIDEInstallErrorOrJetBrainsInfo = ideInstallationStatus?.error || isJetBrains; |
| 43 | const shouldShowIdeSelection = ideStatus === "connected" && (ideSelection?.filePath || ideSelection?.text && ideSelection.lineCount > 0); |
| 44 | const shouldShowConnected = ideStatus === "connected" && !shouldShowIdeSelection; |
| 45 | const showIDEInstallError = showIDEInstallErrorOrJetBrainsInfo && !isJetBrains && !shouldShowConnected && !shouldShowIdeSelection; |
| 46 | const showJetBrainsInfo = showIDEInstallErrorOrJetBrainsInfo && isJetBrains && !shouldShowConnected && !shouldShowIdeSelection; |
| 47 | let t2; |
| 48 | let t3; |
| 49 | if ($[2] !== addNotification || $[3] !== ideStatus || $[4] !== removeNotification || $[5] !== showJetBrainsInfo) { |
| 50 | t2 = () => { |
| 51 | if (getIsRemoteMode()) { |
| 52 | return; |
| 53 | } |
| 54 | if (isSupportedTerminal() || ideStatus !== null || showJetBrainsInfo) { |
| 55 | removeNotification("ide-status-hint"); |
| 56 | return; |
| 57 | } |
| 58 | if (hasShownHintRef.current || (getGlobalConfig().ideHintShownCount ?? 0) >= MAX_IDE_HINT_SHOW_COUNT) { |
| 59 | return; |
| 60 | } |
| 61 | const timeoutId = setTimeout(_temp2, 3000, hasShownHintRef, addNotification); |
| 62 | return () => clearTimeout(timeoutId); |
| 63 | }; |
| 64 | t3 = [addNotification, removeNotification, ideStatus, showJetBrainsInfo]; |
| 65 | $[2] = addNotification; |
| 66 | $[3] = ideStatus; |
| 67 | $[4] = removeNotification; |
| 68 | $[5] = showJetBrainsInfo; |
| 69 | $[6] = t2; |
| 70 | $[7] = t3; |
| 71 | } else { |
| 72 | t2 = $[6]; |
| 73 | t3 = $[7]; |
| 74 | } |
no test coverage detected