diff --git a/core/edit/lazy/deterministic.test.ts b/core/edit/lazy/deterministic.test.ts index 13a4da0bf..b0345b995 100644 --- a/core/edit/lazy/deterministic.test.ts +++ b/core/edit/lazy/deterministic.test.ts @@ -135,4 +135,12 @@ describe("deterministicApplyLazyEdit(", () => { test("calculator docstrings", async () => { await expectDiff("calculator-docstrings.js"); }); + + test("top level same blocks", async () => { + await expectDiff("top-level-same.js"); + }); + + test("gui add toggle", async () => { + await expectDiff("gui.js"); + }); }); diff --git a/core/edit/lazy/test-examples/gui.js.diff b/core/edit/lazy/test-examples/gui.js.diff new file mode 100644 index 000000000..9b6ed209a --- /dev/null +++ b/core/edit/lazy/test-examples/gui.js.diff @@ -0,0 +1,1186 @@ +import { + ArrowLeftIcon, + ChatBubbleOvalLeftIcon, + CodeBracketSquareIcon, + ExclamationTriangleIcon, +} from "@heroicons/react/24/outline"; +import { JSONContent } from "@tiptap/react"; +import { InputModifiers } from "core"; +import { usePostHog } from "posthog-js/react"; +import { + Fragment, + useCallback, + useContext, + useEffect, + useRef, + useState, +} from "react"; +import { ErrorBoundary } from "react-error-boundary"; +import { useDispatch, useSelector } from "react-redux"; +import styled from "styled-components"; +import { + Button, + defaultBorderRadius, + lightGray, + vscBackground, + vscForeground, +} from "../components"; +import { ChatScrollAnchor } from "../components/ChatScrollAnchor"; +import StepContainer from "../components/gui/StepContainer"; +import TimelineItem from "../components/gui/TimelineItem"; +import ContinueInputBox from "../components/mainInput/ContinueInputBox"; +import { defaultInputModifiers } from "../components/mainInput/inputModifiers"; +import { TutorialCard } from "../components/mainInput/TutorialCard"; +import { + OnboardingCard, + useOnboardingCard, +} from "../components/OnboardingCard"; +import { IdeMessengerContext } from "../context/IdeMessenger"; +import useChatHandler from "../hooks/useChatHandler"; +import useHistory from "../hooks/useHistory"; +import { useTutorialCard } from "../hooks/useTutorialCard"; +import { useWebviewListener } from "../hooks/useWebviewListener"; +import { defaultModelSelector } from "../redux/selectors/modelSelectors"; +import { + clearLastResponse, + deleteMessage, + newSession, + setInactive, +} from "../redux/slices/stateSlice"; +import { + setDialogEntryOn, + setDialogMessage, + setShowDialog, +} from "../redux/slices/uiStateSlice"; +import { RootState } from "../redux/store"; +import { + getFontSize, + getMetaKeyLabel, + isJetBrains, + isMetaEquivalentKeyPressed, +} from "../util"; +import { FREE_TRIAL_LIMIT_REQUESTS } from "../util/freeTrial"; +import { getLocalStorage, setLocalStorage } from "../util/localStorage"; + +const TopGuiDiv = styled.div<{ + showScrollbar?: boolean; +}>` + overflow-y: auto; + height: 100%; + scrollbar-width: ${(props) => (props.showScrollbar ? "thin" : "none")}; + + &::-webkit-scrollbar { + display: ${(props) => (props.showScrollbar ? "block" : "none")}; + } +`; + +const StopButton = styled.div` + width: fit-content; + margin-right: auto; + margin-left: auto; + + font-size: ${getFontSize() - 2}px; + + border: 0.5px solid ${lightGray}; + border-radius: ${defaultBorderRadius}; + padding: 4px 8px; + color: ${lightGray}; + + cursor: pointer; +`; + +const StepsDiv = styled.div` + position: relative; + background-color: transparent; + + & > * { + position: relative; + } + + .thread-message { + margin: 8px 4px 0 4px; + padding-bottom: 8px; + } +`; + +const NewSessionButton = styled.div` + width: fit-content; + margin-right: auto; + margin-left: 6px; + margin-top: 2px; + margin-bottom: 8px; + font-size: ${getFontSize() - 2}px; + + border-radius: ${defaultBorderRadius}; + padding: 2px 6px; + color: ${lightGray}; + + &:hover { + background-color: ${lightGray}33; + color: ${vscForeground}; + } + + cursor: pointer; +`; + +function fallbackRender({ error, resetErrorBoundary }: any) { + // Call resetErrorBoundary() to reset the error boundary and retry the render. + + return ( +
+

Something went wrong:

+
{error.message}
+ +
+ +
+
+ ); +} + +function GUI() { + const posthog = usePostHog(); + const dispatch = useDispatch(); + const ideMessenger = useContext(IdeMessengerContext); + + const onboardingCard = useOnboardingCard(); + const { showTutorialCard, closeTutorialCard } = useTutorialCard(); + + const sessionState = useSelector((state: RootState) => state.state); + + const defaultModel = useSelector(defaultModelSelector); + + const ttsActive = useSelector((state: RootState) => state.state.ttsActive); + const active = useSelector((state: RootState) => state.state.active); + + const [stepsOpen, setStepsOpen] = useState<(boolean | undefined)[]>([]); + + const mainTextInputRef = useRef(null); + const topGuiDivRef = useRef(null); + + const [isAtBottom, setIsAtBottom] = useState(false); + + const state = useSelector((state: RootState) => state.state); + + const handleScroll = () => { + // Temporary fix to account for additional height when code blocks are added + const OFFSET_HERUISTIC = 300; + if (!topGuiDivRef.current) return; + + const { scrollTop, scrollHeight, clientHeight } = topGuiDivRef.current; + const atBottom = + scrollHeight - clientHeight <= scrollTop + OFFSET_HERUISTIC; + + setIsAtBottom(atBottom); + }; + + useEffect(() => { + if (!active || !topGuiDivRef.current) return; + + const scrollAreaElement = topGuiDivRef.current; + + scrollAreaElement.scrollTop = + scrollAreaElement.scrollHeight - scrollAreaElement.clientHeight; + + setIsAtBottom(true); + }, [active]); + + useEffect(() => { + // Cmd + Backspace to delete current step + const listener = (e: any) => { + if ( + e.key === "Backspace" && + isMetaEquivalentKeyPressed(e) && + !e.shiftKey + ) { + dispatch(setInactive()); + } + }; + window.addEventListener("keydown", listener); + + return () => { + window.removeEventListener("keydown", listener); + }; + }, [active]); + + // #endregion + + const { streamResponse } = useChatHandler(dispatch, ideMessenger); + + const sendInput = useCallback( + (editorState: JSONContent, modifiers: InputModifiers) => { + if (defaultModel?.provider === "free-trial") { + const u = getLocalStorage("ftc"); + if (u) { + setLocalStorage("ftc", u + 1); + + if (u >= FREE_TRIAL_LIMIT_REQUESTS) { + onboardingCard.open("Best"); + posthog?.capture("ftc_reached"); + ideMessenger.ide.showToast( + "info", + "You've reached the free trial limit. Please configure a model to continue.", + ); + return; + } + } else { + setLocalStorage("ftc", 1); + } + } + + streamResponse(editorState, modifiers, ideMessenger); + + // Increment localstorage counter for popup + const currentCount = getLocalStorage("mainTextEntryCounter"); + if (currentCount) { + setLocalStorage("mainTextEntryCounter", currentCount + 1); + if (currentCount === 300) { + dispatch( + setDialogMessage( +
+ 👋 Thanks for using Continue. We are always trying to improve + and love hearing from users. If you're interested in speaking, + enter your name and email. We won't use this information for + anything other than reaching out. +
+
+
{ + e.preventDefault(); + posthog?.capture("user_interest_form", { + name: e.target.elements[0].value, + email: e.target.elements[1].value, + }); + dispatch( + setDialogMessage( +
+ Thanks! We'll be in touch soon. +
, + ), + ); + }} + style={{ + display: "flex", + flexDirection: "column", + gap: "10px", + }} + > + + + +
+
, + ), + ); + dispatch(setDialogEntryOn(false)); + dispatch(setShowDialog(true)); + } + } else { + setLocalStorage("mainTextEntryCounter", 1); + } + }, + [ + sessionState.history, + sessionState.contextItems, + defaultModel, + state, + streamResponse, + ], + ); + + const { saveSession, getLastSessionId, loadLastSession } = + useHistory(dispatch); + + useWebviewListener( + "newSession", + async () => { + saveSession(); + mainTextInputRef.current?.focus?.(); + }, + [saveSession], + ); + + const isLastUserInput = useCallback( + (index: number): boolean => { + let foundLaterUserInput = false; + for (let i = index + 1; i < state.history.length; i++) { + if (state.history[i].message.role === "user") { + foundLaterUserInput = true; + break; + } + } + return !foundLaterUserInput; + }, + [state.history], + ); + + return ( + <> + +
+ + {state.history.map((item, index: number) => { + return ( + + { + dispatch(newSession()); + }} + > + {item.message.role === "user" ? ( + { + streamResponse( + editorState, + modifiers, + ideMessenger, + index, + ); + }} + isLastUserInput={isLastUserInput(index)} + isMainInput={false} + editorState={item.editorState} + contextItems={item.contextItems} + > + ) : ( +
+ + ) : false ? ( + + ) : ( + + ) + } + open={ + typeof stepsOpen[index] === "undefined" + ? false + ? false + : true + : stepsOpen[index]! + } + onToggle={() => {}} + > + {}} + item={item} + onReverse={() => {}} + onRetry={() => { + streamResponse( + state.history[index - 1].editorState, + state.history[index - 1].modifiers ?? + defaultInputModifiers, + ideMessenger, + index - 1, + ); + }} + onContinueGeneration={() => { + window.postMessage( + { + messageType: "userInput", + data: { + input: + "Continue your response exactly where you left off:", + }, + }, + "*", + ); + }} + onDelete={() => { + dispatch(deleteMessage(index)); + }} + modelTitle={item.promptLogs?.[0]?.modelTitle ?? ""} + /> + +
+ )} +
+
+ ); + })} +
+ { + sendInput(editorContent, modifiers); + }} + isLastUserInput={false} + isMainInput={true} + hidden={active} + > + + {active ? ( + <> +
+
+ + ) : state.history.length > 0 ? ( +
+ { + saveSession(); + }} + className="mr-auto" + > + New Session ({getMetaKeyLabel()} {isJetBrains() ? "J" : "L"}) + {" "} +
+ ) : ( + <> + {getLastSessionId() ? ( +
+ { + loadLastSession().catch((e) => + console.error(`Failed to load last session: ${e}`), + ); + }} + className="mr-auto flex items-center gap-2" + > + + Last Session + +
+ ) : null} + + {onboardingCard.show && ( +
+ +
+ )} + + {showTutorialCard !== false && !onboardingCard.open && ( +
+ +
+ )} + + )} +
+ + +
+ {ttsActive && ( + { + ideMessenger.post("tts/kill", undefined); + }} + > + ■ Stop TTS + + )} + {active && ( + { + dispatch(setInactive()); + if ( + state.history[state.history.length - 1]?.message.content + .length === 0 + ) { + dispatch(clearLastResponse()); + } + }} + > + {getMetaKeyLabel()} ⌫ Cancel + + )} + + ); +} + +export default GUI; + +--- + +import { + ArrowLeftIcon, + ChatBubbleOvalLeftIcon, + CodeBracketSquareIcon, + ExclamationTriangleIcon, +} from "@heroicons/react/24/outline"; +import { JSONContent } from "@tiptap/react"; +import { InputModifiers } from "core"; +import { usePostHog } from "posthog-js/react"; +import { + Fragment, + useCallback, + useContext, + useEffect, + useRef, + useState, +} from "react"; +// ... existing imports ... + +function GUI() { + const posthog = usePostHog(); + const dispatch = useDispatch(); + const ideMessenger = useContext(IdeMessengerContext); + + // ... existing code ... + + const [hello, setHello] = useState(false); + + // ... existing code ... + + return ( + <> + +
+
+ + {hello && world} +
+ + + {state.history.map((item, index: number) => { + // ... existing code ... + })} + + + // ... rest of the existing code ... +
+ + // ... existing code ... +
+ // ... rest of the existing code ... + + ); +} + +export default GUI; + + +--- + +import { + ArrowLeftIcon, + ChatBubbleOvalLeftIcon, + CodeBracketSquareIcon, + ExclamationTriangleIcon, +} from "@heroicons/react/24/outline"; +import { JSONContent } from "@tiptap/react"; +import { InputModifiers } from "core"; +import { usePostHog } from "posthog-js/react"; +import { + Fragment, + useCallback, + useContext, + useEffect, + useRef, + useState, +} from "react"; +import { ErrorBoundary } from "react-error-boundary"; +import { useDispatch, useSelector } from "react-redux"; +import styled from "styled-components"; +import { + Button, + defaultBorderRadius, + lightGray, + vscBackground, + vscForeground, +} from "../components"; +import { ChatScrollAnchor } from "../components/ChatScrollAnchor"; +import StepContainer from "../components/gui/StepContainer"; +import TimelineItem from "../components/gui/TimelineItem"; +import ContinueInputBox from "../components/mainInput/ContinueInputBox"; +import { defaultInputModifiers } from "../components/mainInput/inputModifiers"; +import { TutorialCard } from "../components/mainInput/TutorialCard"; +import { + OnboardingCard, + useOnboardingCard, +} from "../components/OnboardingCard"; +import { IdeMessengerContext } from "../context/IdeMessenger"; +import useChatHandler from "../hooks/useChatHandler"; +import useHistory from "../hooks/useHistory"; +import { useTutorialCard } from "../hooks/useTutorialCard"; +import { useWebviewListener } from "../hooks/useWebviewListener"; +import { defaultModelSelector } from "../redux/selectors/modelSelectors"; +import { + clearLastResponse, + deleteMessage, + newSession, + setInactive, +} from "../redux/slices/stateSlice"; +import { + setDialogEntryOn, + setDialogMessage, + setShowDialog, +} from "../redux/slices/uiStateSlice"; +import { RootState } from "../redux/store"; +import { + getFontSize, + getMetaKeyLabel, + isJetBrains, + isMetaEquivalentKeyPressed, +} from "../util"; +import { FREE_TRIAL_LIMIT_REQUESTS } from "../util/freeTrial"; +import { getLocalStorage, setLocalStorage } from "../util/localStorage"; + +const TopGuiDiv = styled.div<{ + showScrollbar?: boolean; +}>` + overflow-y: auto; + height: 100%; + scrollbar-width: ${(props) => (props.showScrollbar ? "thin" : "none")}; + + &::-webkit-scrollbar { + display: ${(props) => (props.showScrollbar ? "block" : "none")}; + } +`; + +const StopButton = styled.div` + width: fit-content; + margin-right: auto; + margin-left: auto; + + font-size: ${getFontSize() - 2}px; + + border: 0.5px solid ${lightGray}; + border-radius: ${defaultBorderRadius}; + padding: 4px 8px; + color: ${lightGray}; + + cursor: pointer; +`; + +const StepsDiv = styled.div` + position: relative; + background-color: transparent; + + & > * { + position: relative; + } + + .thread-message { + margin: 8px 4px 0 4px; + padding-bottom: 8px; + } +`; + +const NewSessionButton = styled.div` + width: fit-content; + margin-right: auto; + margin-left: 6px; + margin-top: 2px; + margin-bottom: 8px; + font-size: ${getFontSize() - 2}px; + + border-radius: ${defaultBorderRadius}; + padding: 2px 6px; + color: ${lightGray}; + + &:hover { + background-color: ${lightGray}33; + color: ${vscForeground}; + } + + cursor: pointer; +`; + +function fallbackRender({ error, resetErrorBoundary }: any) { + // Call resetErrorBoundary() to reset the error boundary and retry the render. + + return ( +
+

Something went wrong:

+
{error.message}
+ +
+ +
+
+ ); +} + +function GUI() { + const posthog = usePostHog(); + const dispatch = useDispatch(); + const ideMessenger = useContext(IdeMessengerContext); + ++ const [hello, setHello] = useState(false); + + const onboardingCard = useOnboardingCard(); + const { showTutorialCard, closeTutorialCard } = useTutorialCard(); + + const sessionState = useSelector((state: RootState) => state.state); + + const defaultModel = useSelector(defaultModelSelector); + + const ttsActive = useSelector((state: RootState) => state.state.ttsActive); + const active = useSelector((state: RootState) => state.state.active); + + const [stepsOpen, setStepsOpen] = useState<(boolean | undefined)[]>([]); + + const mainTextInputRef = useRef(null); + const topGuiDivRef = useRef(null); + + const [isAtBottom, setIsAtBottom] = useState(false); + + const state = useSelector((state: RootState) => state.state); + + const handleScroll = () => { + // Temporary fix to account for additional height when code blocks are added + const OFFSET_HERUISTIC = 300; + if (!topGuiDivRef.current) return; + + const { scrollTop, scrollHeight, clientHeight } = topGuiDivRef.current; + const atBottom = + scrollHeight - clientHeight <= scrollTop + OFFSET_HERUISTIC; + + setIsAtBottom(atBottom); + }; + + useEffect(() => { + if (!active || !topGuiDivRef.current) return; + + const scrollAreaElement = topGuiDivRef.current; + + scrollAreaElement.scrollTop = + scrollAreaElement.scrollHeight - scrollAreaElement.clientHeight; + + setIsAtBottom(true); + }, [active]); + + useEffect(() => { + // Cmd + Backspace to delete current step + const listener = (e: any) => { + if ( + e.key === "Backspace" && + isMetaEquivalentKeyPressed(e) && + !e.shiftKey + ) { + dispatch(setInactive()); + } + }; + window.addEventListener("keydown", listener); + + return () => { + window.removeEventListener("keydown", listener); + }; + }, [active]); + + // #endregion + + const { streamResponse } = useChatHandler(dispatch, ideMessenger); + + const sendInput = useCallback( + (editorState: JSONContent, modifiers: InputModifiers) => { + if (defaultModel?.provider === "free-trial") { + const u = getLocalStorage("ftc"); + if (u) { + setLocalStorage("ftc", u + 1); + + if (u >= FREE_TRIAL_LIMIT_REQUESTS) { + onboardingCard.open("Best"); + posthog?.capture("ftc_reached"); + ideMessenger.ide.showToast( + "info", + "You've reached the free trial limit. Please configure a model to continue.", + ); + return; + } + } else { + setLocalStorage("ftc", 1); + } + } + + streamResponse(editorState, modifiers, ideMessenger); + + // Increment localstorage counter for popup + const currentCount = getLocalStorage("mainTextEntryCounter"); + if (currentCount) { + setLocalStorage("mainTextEntryCounter", currentCount + 1); + if (currentCount === 300) { + dispatch( + setDialogMessage( +
+ 👋 Thanks for using Continue. We are always trying to improve + and love hearing from users. If you're interested in speaking, + enter your name and email. We won't use this information for + anything other than reaching out. +
+
+
{ + e.preventDefault(); + posthog?.capture("user_interest_form", { + name: e.target.elements[0].value, + email: e.target.elements[1].value, + }); + dispatch( + setDialogMessage( +
+ Thanks! We'll be in touch soon. +
, + ), + ); + }} + style={{ + display: "flex", + flexDirection: "column", + gap: "10px", + }} + > + + + +
+
, + ), + ); + dispatch(setDialogEntryOn(false)); + dispatch(setShowDialog(true)); + } + } else { + setLocalStorage("mainTextEntryCounter", 1); + } + }, + [ + sessionState.history, + sessionState.contextItems, + defaultModel, + state, + streamResponse, + ], + ); + + const { saveSession, getLastSessionId, loadLastSession } = + useHistory(dispatch); + + useWebviewListener( + "newSession", + async () => { + saveSession(); + mainTextInputRef.current?.focus?.(); + }, + [saveSession], + ); + + const isLastUserInput = useCallback( + (index: number): boolean => { + let foundLaterUserInput = false; + for (let i = index + 1; i < state.history.length; i++) { + if (state.history[i].message.role === "user") { + foundLaterUserInput = true; + break; + } + } + return !foundLaterUserInput; + }, + [state.history], + ); + + return ( + <> + +
++
++ ++ {hello && world} ++
+ + + {state.history.map((item, index: number) => { + return ( + + { + dispatch(newSession()); + }} + > + {item.message.role === "user" ? ( + { + streamResponse( + editorState, + modifiers, + ideMessenger, + index, + ); + }} + isLastUserInput={isLastUserInput(index)} + isMainInput={false} + editorState={item.editorState} + contextItems={item.contextItems} + > + ) : ( +
+ + ) : false ? ( + + ) : ( + + ) + } + open={ + typeof stepsOpen[index] === "undefined" + ? false + ? false + : true + : stepsOpen[index]! + } + onToggle={() => {}} + > + {}} + item={item} + onReverse={() => {}} + onRetry={() => { + streamResponse( + state.history[index - 1].editorState, + state.history[index - 1].modifiers ?? + defaultInputModifiers, + ideMessenger, + index - 1, + ); + }} + onContinueGeneration={() => { + window.postMessage( + { + messageType: "userInput", + data: { + input: + "Continue your response exactly where you left off:", + }, + }, + "*", + ); + }} + onDelete={() => { + dispatch(deleteMessage(index)); + }} + modelTitle={item.promptLogs?.[0]?.modelTitle ?? ""} + /> + +
+ )} +
+
+ ); + })} +
+ { + sendInput(editorContent, modifiers); + }} + isLastUserInput={false} + isMainInput={true} + hidden={active} + > + + {active ? ( + <> +
+
+ + ) : state.history.length > 0 ? ( +
+ { + saveSession(); + }} + className="mr-auto" + > + New Session ({getMetaKeyLabel()} {isJetBrains() ? "J" : "L"}) + {" "} +
+ ) : ( + <> + {getLastSessionId() ? ( +
+ { + loadLastSession().catch((e) => + console.error(`Failed to load last session: ${e}`), + ); + }} + className="mr-auto flex items-center gap-2" + > + + Last Session + +
+ ) : null} + + {onboardingCard.show && ( +
+ +
+ )} + + {showTutorialCard !== false && !onboardingCard.open && ( +
+ +
+ )} + + )} +
+ + +
+ {ttsActive && ( + { + ideMessenger.post("tts/kill", undefined); + }} + > + ■ Stop TTS + + )} + {active && ( + { + dispatch(setInactive()); + if ( + state.history[state.history.length - 1]?.message.content + .length === 0 + ) { + dispatch(clearLastResponse()); + } + }} + > + {getMetaKeyLabel()} ⌫ Cancel + + )} + + ); +} + +export default GUI; diff --git a/core/edit/lazy/test-examples/top-level-same.js.diff b/core/edit/lazy/test-examples/top-level-same.js.diff new file mode 100644 index 000000000..f37e4d9bf --- /dev/null +++ b/core/edit/lazy/test-examples/top-level-same.js.diff @@ -0,0 +1,64 @@ +class Calculator { + constructor() { + this.result = 0; + } +} + +class Subtract extends Calculator { + sub(num1, num2) { + this.result = num1 - num2; + return this.result; + } +} + +class Add extends Calculator { + add(num1, num2) { + this.result = num1 + num2; + return this.result; + } +} + +--- + +// ... existing code ... + +class Subtract extends Calculator { + sub(num1, num2) { + this.result = num1 - num2; + + if (this.result < 0) { + throw new Error("Result cannot be negative"); + } + + return this.result; + } +} + +// ... existing code ... + +--- + +class Calculator { + constructor() { + this.result = 0; + } +} + +class Subtract extends Calculator { + sub(num1, num2) { + this.result = num1 - num2; ++ ++ if (this.result < 0) { ++ throw new Error("Result cannot be negative"); ++ } ++ + return this.result; + } +} + +class Add extends Calculator { + add(num1, num2) { + this.result = num1 + num2; + return this.result; + } +} \ No newline at end of file diff --git a/core/llm/llms/Anthropic.ts b/core/llm/llms/Anthropic.ts index f0d90967d..497629338 100644 --- a/core/llm/llms/Anthropic.ts +++ b/core/llm/llms/Anthropic.ts @@ -26,15 +26,19 @@ class Anthropic extends BaseLLM { 2. Never separate the code into multiple code blocks. 3. Only include the code that is being added. 4. Replace existing code with a "lazy" block like this: "// ... existing code ..." -5. If the user submits a code block that contains a filename in the language specifier, always include the filename in any code block you generate based on that file. The filename should be on the same line as the language specifier in your code block. +5. You must always provide 1-2 lines of context above and below a "lazy" block +6. If the user submits a code block that contains a filename in the language specifier, always include the filename in any code block you generate based on that file. The filename should be on the same line as the language specifier in your code block. Example 1: Input: \`\`\`test.js +import addition from "addition" + class Calculator { constructor() { this.result = 0; } + add(number) { this.result += number; return this; @@ -45,6 +49,9 @@ User request: Add a subtract method Output: \`\`\`javascript test.js +// ... existing code ... +import subtraction from "subtraction" + class Calculator { // ... existing code ... diff --git a/gui/src/components/gui/StepContainer.tsx b/gui/src/components/gui/StepContainer.tsx index 3f6876925..245a1d57a 100644 --- a/gui/src/components/gui/StepContainer.tsx +++ b/gui/src/components/gui/StepContainer.tsx @@ -124,7 +124,7 @@ function StepContainer(props: StepContainerProps) { {(props.isLast || isHovered || typeof feedback !== "undefined") && !active && (
)} - +