MCPcopy Index your code
hub / github.com/codeaashu/claude-code / useIDEStatusIndicator

Function useIDEStatusIndicator

src/hooks/notifs/useIDEStatusIndicator.tsx:17–165  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

15 mcpClients: MCPServerConnection[];
16};
17export 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 }

Callers 1

REPLFunction · 0.85

Calls 5

useIdeConnectionStatusFunction · 0.85
isJetBrainsIdeFunction · 0.85
getIsRemoteModeFunction · 0.85
getGlobalConfigFunction · 0.85
useNotificationsFunction · 0.50

Tested by

no test coverage detected