diff --git a/src/vs/platform/positronActionBar/browser/useRegisterWithActionBar.tsx b/src/vs/platform/positronActionBar/browser/useRegisterWithActionBar.tsx index 3348142ab3a..9183c5c090e 100644 --- a/src/vs/platform/positronActionBar/browser/useRegisterWithActionBar.tsx +++ b/src/vs/platform/positronActionBar/browser/useRegisterWithActionBar.tsx @@ -27,5 +27,5 @@ export const useRegisterWithActionBar = (refs: MutableRefObject[]) return () => { refs.forEach(ref => focusableComponents.delete(ref.current)); }; - }, []); + }, [focusableComponents, refs]); }; diff --git a/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterActions.tsx b/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterActions.tsx index 08772615944..6c9851d9915 100644 --- a/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterActions.tsx +++ b/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterActions.tsx @@ -67,7 +67,7 @@ export const InterpreterActions = (props: PropsWithChildren disposableStore.dispose(); - }, []); + }, [props.runtime.runtimeId, props.runtimeSessionService, session]); // Interrupt the session, if we have one. const interrupt = () => { diff --git a/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterGroup.tsx b/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterGroup.tsx index 6a760fd8441..9db883e968f 100644 --- a/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterGroup.tsx +++ b/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterGroup.tsx @@ -7,7 +7,7 @@ import './interpreterGroup.css'; // React. -import React, { useEffect, useState } from 'react'; +import React, { useCallback, useEffect, useState } from 'react'; // Other dependencies. import { DisposableStore } from '../../../../../base/common/lifecycle.js'; @@ -38,7 +38,7 @@ export const InterpreterGroup = (props: InterpreterGroupProps) => { * Determines whether an alternate runtime is alive. * @returns A value which indicates whether an alternate runtime is alive. */ - const isAlternateRuntimeAlive = () => { + const isAlternateRuntimeAlive = useCallback(() => { // Get the active sessions. const activeSessions = props.runtimeSessionService.activeSessions; @@ -66,7 +66,7 @@ export const InterpreterGroup = (props: InterpreterGroupProps) => { // An alternate runtime is not alive. return false; - }; + }, [props.interpreterGroup.alternateRuntimes, props.runtimeSessionService.activeSessions]); // State hooks. const [alternateRuntimeAlive, setAlternateRuntimeAlive] = useState(isAlternateRuntimeAlive()); @@ -91,7 +91,7 @@ export const InterpreterGroup = (props: InterpreterGroupProps) => { // Return the cleanup function that will dispose of the event handlers. return () => disposableStore.dispose(); - }, []); + }, [isAlternateRuntimeAlive, props.runtimeSessionService]); // Render. return ( diff --git a/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterGroups.tsx b/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterGroups.tsx index 103b7a38e20..4d56d4bfbf1 100644 --- a/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterGroups.tsx +++ b/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterGroups.tsx @@ -108,7 +108,7 @@ export const InterpreterGroups = (props: InterpreterGroupsProps) => { // Return the cleanup function that will dispose of the event handlers. return () => disposableStore.dispose(); - }, []); + }, [props.languageRuntimeService, props.runtimeAffiliationService]); // Render. return ( diff --git a/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/primaryInterpreter.tsx b/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/primaryInterpreter.tsx index da3922c3bc3..0d8258cddc9 100644 --- a/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/primaryInterpreter.tsx +++ b/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/primaryInterpreter.tsx @@ -69,7 +69,7 @@ export const PrimaryInterpreter = (props: PrimaryInterpreterProps) => { // Return the cleanup function that will dispose of the event handlers. return () => disposableStore.dispose(); - }, []); + }, [props.runtime.runtimeId, props.runtimeSessionService, session]); // Render. return ( diff --git a/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/secondaryInterpreter.tsx b/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/secondaryInterpreter.tsx index 4669034960e..85b8186d905 100644 --- a/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/secondaryInterpreter.tsx +++ b/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/secondaryInterpreter.tsx @@ -65,7 +65,7 @@ export const SecondaryInterpreter = (props: SecondaryInterpreterProps) => { // Return the cleanup function that will dispose of the event handlers. return () => disposableStore.dispose(); - }, []); + }, [props.runtime.runtimeId, props.runtimeSessionService, session]); // Render. return ( diff --git a/src/vs/workbench/browser/parts/positronTopActionBar/positronTopActionBarState.tsx b/src/vs/workbench/browser/parts/positronTopActionBar/positronTopActionBarState.tsx index 6ce63de92f6..472ce178a0f 100644 --- a/src/vs/workbench/browser/parts/positronTopActionBar/positronTopActionBarState.tsx +++ b/src/vs/workbench/browser/parts/positronTopActionBar/positronTopActionBarState.tsx @@ -45,7 +45,7 @@ export const usePositronTopActionBarState = (services: PositronTopActionBarServi // Return the clean up for our event handlers. return () => disposableStore.dispose(); - }, []); + }, [services.workspaceContextService]); // Return the Positron top action bar state. return { diff --git a/src/vs/workbench/contrib/positronConsole/browser/components/consoleInstanceInfoButton.tsx b/src/vs/workbench/contrib/positronConsole/browser/components/consoleInstanceInfoButton.tsx index e5923da55de..9963832c30b 100644 --- a/src/vs/workbench/contrib/positronConsole/browser/components/consoleInstanceInfoButton.tsx +++ b/src/vs/workbench/contrib/positronConsole/browser/components/consoleInstanceInfoButton.tsx @@ -81,7 +81,7 @@ const ConsoleInstanceInfoModalPopup = (props: ConsoleInstanceInfoModalPopupProps setSessionState(state); })); return () => disposableStore.dispose(); - }, []); + }, [props.session]); const showKernelOutputChannelClickHandler = () => { props.session.showOutput(); diff --git a/src/vs/workbench/contrib/positronConsole/browser/components/consoleInstanceMenuButton.tsx b/src/vs/workbench/contrib/positronConsole/browser/components/consoleInstanceMenuButton.tsx index 95a04a05c7f..211d8f98f42 100644 --- a/src/vs/workbench/contrib/positronConsole/browser/components/consoleInstanceMenuButton.tsx +++ b/src/vs/workbench/contrib/positronConsole/browser/components/consoleInstanceMenuButton.tsx @@ -52,7 +52,7 @@ export const ConsoleInstanceMenuButton = (props: ConsoleInstanceMenuButtonProps) setActiveRuntimeLabel(labelForSession(e?.session)); })); return () => disposables.dispose(); - }, [positronConsoleContext.activePositronConsoleInstance]); + }, [positronConsoleContext.activePositronConsoleInstance, positronConsoleContext.positronConsoleService]); // Builds the actions. const actions = () => { diff --git a/src/vs/workbench/contrib/positronConsole/browser/components/historyBrowserPopup.tsx b/src/vs/workbench/contrib/positronConsole/browser/components/historyBrowserPopup.tsx index e93e424af22..2330bf99316 100644 --- a/src/vs/workbench/contrib/positronConsole/browser/components/historyBrowserPopup.tsx +++ b/src/vs/workbench/contrib/positronConsole/browser/components/historyBrowserPopup.tsx @@ -73,7 +73,7 @@ export const HistoryBrowserPopup = (props: HistoryBrowserPopupProps) => { return () => { DOM.getActiveWindow().removeEventListener('click', clickHandler); }; - }, [props.selectedIndex]); + }, [props]); const noMatch = nls.localize('positronConsoleHistoryMatchesEmpty', "No matching history items"); diff --git a/src/vs/workbench/contrib/positronConsole/browser/positronConsole.tsx b/src/vs/workbench/contrib/positronConsole/browser/positronConsole.tsx index 1060df057e4..ca7d405e689 100644 --- a/src/vs/workbench/contrib/positronConsole/browser/positronConsole.tsx +++ b/src/vs/workbench/contrib/positronConsole/browser/positronConsole.tsx @@ -46,7 +46,7 @@ export const PositronConsole = (props: PropsWithChildren) // Return the cleanup function that will dispose of the event handlers. return () => disposableStore.dispose(); - }, []); + }, [props.reactComponentContainer]); // Render. return ( diff --git a/src/vs/workbench/contrib/positronConsole/browser/positronConsoleState.tsx b/src/vs/workbench/contrib/positronConsole/browser/positronConsoleState.tsx index a868116cb70..e4b83df32d4 100644 --- a/src/vs/workbench/contrib/positronConsole/browser/positronConsoleState.tsx +++ b/src/vs/workbench/contrib/positronConsole/browser/positronConsoleState.tsx @@ -89,7 +89,7 @@ export const usePositronConsoleState = (services: PositronConsoleServices): Posi // Return the clean up for our event handlers. return () => disposableStore.dispose(); - }, []); + }, [services.positronConsoleService]); // Return the Positron console state. return { diff --git a/src/vs/workbench/contrib/positronHelp/browser/components/actionBars.tsx b/src/vs/workbench/contrib/positronHelp/browser/components/actionBars.tsx index 9658b606276..e38db58d46d 100644 --- a/src/vs/workbench/contrib/positronHelp/browser/components/actionBars.tsx +++ b/src/vs/workbench/contrib/positronHelp/browser/components/actionBars.tsx @@ -118,7 +118,7 @@ export const ActionBars = (props: PropsWithChildren) => { // Return the cleanup function that will dispose of the event handlers. return () => disposableStore.dispose(); - }, []); + }, [props.positronHelpService, props.reactComponentContainer]); // useEffect for currentHelpEntry. useEffect(() => { diff --git a/src/vs/workbench/contrib/positronNotebook/browser/utilityComponents/ActionButton.tsx b/src/vs/workbench/contrib/positronNotebook/browser/utilityComponents/ActionButton.tsx index d2df9e9c743..a01f5410a4f 100644 --- a/src/vs/workbench/contrib/positronNotebook/browser/utilityComponents/ActionButton.tsx +++ b/src/vs/workbench/contrib/positronNotebook/browser/utilityComponents/ActionButton.tsx @@ -17,7 +17,6 @@ import { Button } from '../../../../../base/browser/ui/positronComponents/button * @param props The props for the button * @return A button with `action` and `action-button` classes added to it. */ -// eslint-disable-next-line react/prop-types export function ActionButton({ className, ...props }: React.ComponentProps) { return