Merge branch 'main' of https://github.com/continuedev/continue into dallin/rules-sources
This commit is contained in:
commit
df93dfbc6c
45 changed files with 368 additions and 219 deletions
|
|
@ -2,7 +2,7 @@ import { DiffLine, ILLM } from "../..";
|
|||
import { generateLines } from "../../diff/util";
|
||||
import { supportedLanguages } from "../../util/treeSitter";
|
||||
import { getUriFileExtension } from "../../util/uri";
|
||||
|
||||
import { deterministicApplyLazyEdit } from "./deterministic";
|
||||
import { streamLazyApply } from "./streamLazyApply";
|
||||
import { applyUnifiedDiff, isUnifiedDiffFormat } from "./unifiedDiffApply";
|
||||
|
||||
|
|
@ -13,35 +13,44 @@ function canUseInstantApply(filename: string) {
|
|||
|
||||
export async function applyCodeBlock(
|
||||
oldFile: string,
|
||||
newFile: string,
|
||||
newLazyFile: string,
|
||||
filename: string,
|
||||
llm: ILLM,
|
||||
): Promise<[boolean, AsyncGenerator<DiffLine>]> {
|
||||
// This was buggy, removed for now, maybe forever
|
||||
// if (canUseInstantApply(filename)) {
|
||||
// const diffLines = await deterministicApplyLazyEdit(
|
||||
// oldFile,
|
||||
// newFile,
|
||||
// filename,
|
||||
// );
|
||||
): Promise<{
|
||||
isInstantApply: boolean;
|
||||
diffLinesGenerator: AsyncGenerator<DiffLine>;
|
||||
}> {
|
||||
if (canUseInstantApply(filename)) {
|
||||
const diffLines = await deterministicApplyLazyEdit({
|
||||
oldFile,
|
||||
newLazyFile,
|
||||
filename,
|
||||
onlyFullFileRewrite: true,
|
||||
});
|
||||
|
||||
// // Fall back to LLM method if we couldn't apply deterministically
|
||||
// if (diffLines !== undefined) {
|
||||
// const diffGenerator = generateLines(diffLines!);
|
||||
// return [true, diffGenerator];
|
||||
// }
|
||||
// }
|
||||
if (diffLines !== undefined) {
|
||||
return {
|
||||
isInstantApply: true,
|
||||
diffLinesGenerator: generateLines(diffLines!),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// If the code block is a diff
|
||||
if (isUnifiedDiffFormat(newFile)) {
|
||||
if (isUnifiedDiffFormat(newLazyFile)) {
|
||||
try {
|
||||
const diffLines = applyUnifiedDiff(oldFile, newFile);
|
||||
const diffGenerator = generateLines(diffLines!);
|
||||
return [true, diffGenerator];
|
||||
const diffLines = applyUnifiedDiff(oldFile, newLazyFile);
|
||||
return {
|
||||
isInstantApply: true,
|
||||
diffLinesGenerator: generateLines(diffLines!),
|
||||
};
|
||||
} catch (e) {
|
||||
console.error("Failed to apply unified diff", e);
|
||||
}
|
||||
}
|
||||
|
||||
return [false, streamLazyApply(oldFile, filename, newFile, llm)];
|
||||
return {
|
||||
isInstantApply: false,
|
||||
diffLinesGenerator: streamLazyApply(oldFile, filename, newLazyFile, llm),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@ async function collectDiffs(
|
|||
): Promise<{ ourDiffs: DiffLine[]; myersDiffs: any }> {
|
||||
const ourDiffs: DiffLine[] = [];
|
||||
|
||||
for (const diffLine of (await deterministicApplyLazyEdit(
|
||||
for (const diffLine of (await deterministicApplyLazyEdit({
|
||||
oldFile,
|
||||
newFile,
|
||||
newLazyFile: newFile,
|
||||
filename,
|
||||
)) ?? []) {
|
||||
})) ?? []) {
|
||||
ourDiffs.push(diffLine);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,11 @@ type AstReplacements = Array<{
|
|||
replacementNodes: Parser.SyntaxNode[];
|
||||
}>;
|
||||
|
||||
const LAZY_COMMENT_REGEX = /\.{3}\s*(.+?)\s*\.{3}/;
|
||||
export function isLazyText(text: string): boolean {
|
||||
return LAZY_COMMENT_REGEX.test(text);
|
||||
}
|
||||
|
||||
function reconstructNewFile(
|
||||
oldFile: string,
|
||||
newFile: string,
|
||||
|
|
@ -121,11 +126,23 @@ function nodeSurroundedInLazyBlocks(
|
|||
}
|
||||
|
||||
// TODO: If we don't have high confidence, return undefined to fall back to slower methods
|
||||
export async function deterministicApplyLazyEdit(
|
||||
oldFile: string,
|
||||
newLazyFile: string,
|
||||
filename: string,
|
||||
): Promise<DiffLine[] | undefined> {
|
||||
export async function deterministicApplyLazyEdit({
|
||||
oldFile,
|
||||
newLazyFile,
|
||||
filename,
|
||||
/**
|
||||
* Using this as a flag to slowly reintroduce lazy applies.
|
||||
* With this set, we will only attempt to deterministically apply
|
||||
* when there are no lazy blocks and then just replace the whole file,
|
||||
* and otherwise never use instant apply
|
||||
*/
|
||||
onlyFullFileRewrite = false,
|
||||
}: {
|
||||
oldFile: string;
|
||||
newLazyFile: string;
|
||||
filename: string;
|
||||
onlyFullFileRewrite?: boolean;
|
||||
}): Promise<DiffLine[] | undefined> {
|
||||
const parser = await getParserForFile(filename);
|
||||
if (!parser) {
|
||||
return undefined;
|
||||
|
|
@ -135,6 +152,14 @@ export async function deterministicApplyLazyEdit(
|
|||
let newTree = parser.parse(newLazyFile);
|
||||
let reconstructedNewFile: string | undefined = undefined;
|
||||
|
||||
if (onlyFullFileRewrite) {
|
||||
if (!isLazyText(newTree.rootNode.text)) {
|
||||
return myersDiff(oldFile, newLazyFile);
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
// If there is no lazy block anywhere, we add our own to the outsides
|
||||
// so that large chunks of the file don't get removed
|
||||
if (!findInAst(newTree.rootNode, isLazyBlock)) {
|
||||
|
|
@ -198,11 +223,6 @@ export async function deterministicApplyLazyEdit(
|
|||
return diff;
|
||||
}
|
||||
|
||||
const LAZY_COMMENT_REGEX = /\.{3}\s*(.+?)\s*\.{3}/;
|
||||
export function isLazyLine(text: string): boolean {
|
||||
return LAZY_COMMENT_REGEX.test(text);
|
||||
}
|
||||
|
||||
function isLazyBlock(node: Parser.SyntaxNode): boolean {
|
||||
// Special case for "{/* ... existing code ... */}"
|
||||
if (
|
||||
|
|
@ -213,7 +233,7 @@ function isLazyBlock(node: Parser.SyntaxNode): boolean {
|
|||
return true;
|
||||
}
|
||||
|
||||
return node.type.includes("comment") && isLazyLine(node.text);
|
||||
return node.type.includes("comment") && isLazyText(node.text);
|
||||
}
|
||||
|
||||
function stringsWithinLevDistThreshold(
|
||||
|
|
|
|||
|
|
@ -10,9 +10,15 @@ import Tabs from "@theme/Tabs";
|
|||
|
||||
When editing code, Chat and Edit model output often doesn't clearly align with existing code. A model with the `apply` role is used to generate a more precise diff to apply changes to a file.
|
||||
|
||||
Generally speaking, models proficient in chat and edit can also be used for applying code.
|
||||
## Recommended Apply models
|
||||
|
||||
Explore apply models in [the hub](https://hub.continue.dev/explore/models?roles=apply).
|
||||
We recommend [Relace's Instant Apply model](https://hub.continue.dev/relace/instant-apply) for the fastest Apply experience. You can get an API key [here](https://app.relace.ai/settings/api-keys).
|
||||
|
||||
However, most Chat models can also be used for applying code changes. We recommend smaller/cheaper models for the task, such as Claude 3.5 Haiku.
|
||||
|
||||
:::info
|
||||
Explore all apply models in [the Hub](https://hub.continue.dev/explore/models?roles=apply)
|
||||
:::
|
||||
|
||||
## Prompt templating
|
||||
|
||||
|
|
|
|||
|
|
@ -116,17 +116,17 @@ export class ApplyManager {
|
|||
return;
|
||||
}
|
||||
|
||||
const [instant, diffLines] = await applyCodeBlock(
|
||||
const { isInstantApply, diffLinesGenerator } = await applyCodeBlock(
|
||||
editor.document.getText(),
|
||||
text,
|
||||
getUriPathBasename(editor.document.uri.toString()),
|
||||
llm,
|
||||
);
|
||||
|
||||
if (instant) {
|
||||
if (isInstantApply) {
|
||||
await this.verticalDiffManager.streamDiffLines(
|
||||
diffLines,
|
||||
instant,
|
||||
diffLinesGenerator,
|
||||
isInstantApply,
|
||||
streamId,
|
||||
toolCallId,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { useContext } from "react";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { CheckIcon, XMarkIcon } from "@heroicons/react/24/outline";
|
||||
import { ApplyState } from "core";
|
||||
import { getMetaKeyLabel } from "../../util";
|
||||
import { useAppSelector } from "../../redux/hooks";
|
||||
import { selectIsSingleRangeEditOrInsertion } from "../../redux/slices/sessionSlice";
|
||||
import { useContext } from "react";
|
||||
import { IdeMessengerContext } from "../context/IdeMessenger";
|
||||
import { useAppSelector } from "../redux/hooks";
|
||||
import { selectIsSingleRangeEditOrInsertion } from "../redux/slices/sessionSlice";
|
||||
import { getMetaKeyLabel } from "../util";
|
||||
|
||||
export interface AcceptRejectAllButtonsProps {
|
||||
pendingApplyStates: ApplyState[];
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
import FileIcon from "../FileIcon";
|
||||
import {
|
||||
ChevronDownIcon,
|
||||
ChevronRightIcon,
|
||||
XMarkIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import { useState } from "react";
|
||||
import StyledMarkdownPreview from "../markdown/StyledMarkdownPreview";
|
||||
import { getMarkdownLanguageTagForFile } from "core/util";
|
||||
import styled from "styled-components";
|
||||
import { CodeToEdit } from "core";
|
||||
import { getMarkdownLanguageTagForFile } from "core/util";
|
||||
import {
|
||||
getLastNUriRelativePathParts,
|
||||
getUriPathBasename,
|
||||
} from "core/util/uri";
|
||||
import { useState } from "react";
|
||||
import styled from "styled-components";
|
||||
import FileIcon from "../FileIcon";
|
||||
import StyledMarkdownPreview from "../StyledMarkdownPreview";
|
||||
|
||||
export interface CodeToEditListItemProps {
|
||||
code: CodeToEdit;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import {
|
||||
HandThumbUpIcon,
|
||||
HandThumbDownIcon,
|
||||
HandThumbUpIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import HeaderButtonWithToolTip from "../gui/HeaderButtonWithToolTip";
|
||||
import { ChatHistoryItem } from "core";
|
||||
import { useState, useContext } from "react";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { useAppSelector } from "../../redux/hooks";
|
||||
import { useContext, useState } from "react";
|
||||
import { IdeMessengerContext } from "../context/IdeMessenger";
|
||||
import { useAppSelector } from "../redux/hooks";
|
||||
import HeaderButtonWithToolTip from "./gui/HeaderButtonWithToolTip";
|
||||
|
||||
export interface FeedbackButtonsProps {
|
||||
item: ChatHistoryItem;
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
import { ChatHistoryItem } from "core";
|
||||
import AcceptRejectAllButtons from "./AcceptRejectAllButtons";
|
||||
import FeedbackButtons from "./FeedbackButtons";
|
||||
|
||||
import { renderChatMessage } from "core/util/messageContent";
|
||||
import { CopyIconButton } from "../gui/CopyIconButton";
|
||||
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
|
||||
import { exitEditMode } from "../../redux/thunks/exitEditMode";
|
||||
import { loadLastSession } from "../../redux/thunks/session";
|
||||
import AcceptRejectAllButtons from "../AcceptRejectAllButtons";
|
||||
import FeedbackButtons from "../FeedbackButtons";
|
||||
import { CopyIconButton } from "../gui/CopyIconButton";
|
||||
|
||||
export interface EditActionsProps {
|
||||
index: number;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import {
|
|||
vscQuickInputBackground,
|
||||
} from "..";
|
||||
import { getFontSize } from "../../util";
|
||||
import StyledMarkdownPreview from "../markdown/StyledMarkdownPreview";
|
||||
import StyledMarkdownPreview from "../StyledMarkdownPreview";
|
||||
|
||||
interface ReasoningProps {
|
||||
item: ChatHistoryItem;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { BarsArrowDownIcon, TrashIcon } from "@heroicons/react/24/outline";
|
||||
import { ChatHistoryItem } from "core";
|
||||
import { renderChatMessage } from "core/util/messageContent";
|
||||
import { useAppSelector } from "../../redux/hooks";
|
||||
import { selectIsInEditMode } from "../../redux/slices/sessionSlice";
|
||||
import FeedbackButtons from "../FeedbackButtons";
|
||||
import { CopyIconButton } from "../gui/CopyIconButton";
|
||||
import HeaderButtonWithToolTip from "../gui/HeaderButtonWithToolTip";
|
||||
import EditActions from "./EditActions";
|
||||
import FeedbackButtons from "./FeedbackButtons";
|
||||
import { useAppSelector } from "../../redux/hooks";
|
||||
import { selectIsInEditMode } from "../../redux/slices/sessionSlice";
|
||||
|
||||
export interface ResponseActionsProps {
|
||||
isTruncated: boolean;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { useAppSelector } from "../../redux/hooks";
|
|||
import { selectUIConfig } from "../../redux/slices/configSlice";
|
||||
import { deleteMessage } from "../../redux/slices/sessionSlice";
|
||||
import { getFontSize } from "../../util";
|
||||
import StyledMarkdownPreview from "../markdown/StyledMarkdownPreview";
|
||||
import StyledMarkdownPreview from "../StyledMarkdownPreview";
|
||||
import Reasoning from "./Reasoning";
|
||||
import ResponseActions from "./ResponseActions";
|
||||
import ThinkingIndicator from "./ThinkingIndicator";
|
||||
|
|
@ -43,9 +43,6 @@ export default function StepContainer(props: StepContainerProps) {
|
|||
historyItemAfterThis?.message.role === "thinking";
|
||||
const hideActions = hideActionSpace || (isStreaming && props.isLast);
|
||||
|
||||
// const isStepAheadOfCurCheckpoint =
|
||||
// isInEditMode && Math.floor(props.index / 2) > curCheckpointIndex;
|
||||
|
||||
useEffect(() => {
|
||||
if (!isStreaming) {
|
||||
const content = renderChatMessage(props.item.message).trim();
|
||||
|
|
@ -83,9 +80,7 @@ export default function StepContainer(props: StepContainerProps) {
|
|||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
// className={isStepAheadOfCurCheckpoint ? "opacity-25" : "relative"}
|
||||
>
|
||||
<div>
|
||||
<ContentDiv>
|
||||
{uiConfig?.displayRawMarkdown ? (
|
||||
<pre
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { CheckIcon, PlayIcon, XMarkIcon } from "@heroicons/react/24/outline";
|
||||
import { ApplyState } from "core";
|
||||
import { useEffect, useState } from "react";
|
||||
import { lightGray, vscForeground } from "../..";
|
||||
import { getMetaKeyLabel } from "../../../util";
|
||||
import Spinner from "../../gui/Spinner";
|
||||
import { ToolbarButtonWithTooltip } from "./ToolbarButtonWithTooltip";
|
||||
|
|
@ -14,7 +13,7 @@ interface ApplyActionsProps {
|
|||
onClickApply: () => void;
|
||||
}
|
||||
|
||||
export default function ApplyActions(props: ApplyActionsProps) {
|
||||
export function ApplyActions(props: ApplyActionsProps) {
|
||||
const [hasRejected, setHasRejected] = useState(false);
|
||||
const [showApplied, setShowApplied] = useState(false);
|
||||
const isClosed = props.applyState?.status === "closed";
|
||||
|
|
@ -37,11 +36,10 @@ export default function ApplyActions(props: ApplyActionsProps) {
|
|||
|
||||
const applyButton = (text: string) => (
|
||||
<button
|
||||
className={`flex items-center border-none bg-transparent pl-0 text-xs text-[${vscForeground}] cursor-pointer outline-none hover:brightness-125`}
|
||||
className="text-lightgray text-[${vscForeground}] flex cursor-pointer items-center border-none bg-transparent pl-0 text-xs outline-none hover:brightness-125"
|
||||
onClick={props.onClickApply}
|
||||
style={{ color: lightGray }}
|
||||
>
|
||||
<div className="flex items-center gap-1 text-gray-400">
|
||||
<div className="text-lightgray flex items-center gap-1">
|
||||
<PlayIcon className="h-3.5 w-3.5" />
|
||||
<span className="xs:inline hidden">{text}</span>
|
||||
</div>
|
||||
|
|
@ -52,7 +50,7 @@ export default function ApplyActions(props: ApplyActionsProps) {
|
|||
case "streaming":
|
||||
return (
|
||||
<div className="flex items-center rounded bg-zinc-700 pl-2 pr-1">
|
||||
<span className="inline-flex w-min items-center gap-2 text-center text-xs text-gray-400">
|
||||
<span className="text-lightgray inline-flex w-min items-center gap-2 text-center text-xs">
|
||||
Applying
|
||||
<Spinner />
|
||||
</span>
|
||||
|
|
@ -61,9 +59,8 @@ export default function ApplyActions(props: ApplyActionsProps) {
|
|||
case "done":
|
||||
return (
|
||||
<div className="flex items-center rounded bg-zinc-700 px-1.5 sm:gap-1">
|
||||
<span className="max-xs:hidden text-center text-xs text-gray-400">
|
||||
<span className="max-xs:hidden text-lightgray text-center text-xs">
|
||||
{`${props.applyState?.numDiffs === 1 ? "1 diff" : `${props.applyState?.numDiffs} diffs`}`}
|
||||
<span className="max-md:hidden">{` remaining`}</span>
|
||||
</span>
|
||||
|
||||
<div className="flex">
|
||||
|
|
@ -1,23 +1,19 @@
|
|||
import { CheckIcon, ClipboardIcon } from "@heroicons/react/24/outline";
|
||||
import { lightGray } from "../..";
|
||||
import useCopy from "../../../hooks/useCopy";
|
||||
|
||||
interface CopyButtonProps {
|
||||
text: string;
|
||||
}
|
||||
|
||||
export default function CopyButton({ text }: CopyButtonProps) {
|
||||
export function CopyButton({ text }: CopyButtonProps) {
|
||||
const { copyText, copied } = useCopy(text);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`flex cursor-pointer items-center border-none bg-transparent text-xs outline-none hover:brightness-125`}
|
||||
className="text-lightgray flex cursor-pointer items-center border-none bg-transparent text-xs outline-none hover:brightness-125"
|
||||
onClick={copyText}
|
||||
>
|
||||
<div
|
||||
className="flex items-center gap-1 transition-colors duration-200 hover:brightness-125"
|
||||
style={{ color: lightGray }}
|
||||
>
|
||||
<div className="flex items-center gap-1 transition-colors duration-200 hover:brightness-125">
|
||||
{copied ? (
|
||||
<CheckIcon className="h-3.5 w-3.5 text-green-500 hover:brightness-125" />
|
||||
) : (
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
import { DocumentPlusIcon } from "@heroicons/react/24/outline";
|
||||
import { vscForeground } from "../..";
|
||||
|
||||
interface CreateFileButtonProps {
|
||||
onClick: () => void;
|
||||
}
|
||||
|
||||
export function CreateFileButton({ onClick }: CreateFileButtonProps) {
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
className={`text-lightgray flex items-center border-none bg-transparent pl-0 text-xs text-[${vscForeground}] cursor-pointer outline-none hover:brightness-125`}
|
||||
onClick={onClick}
|
||||
>
|
||||
<div className="flex items-center gap-1">
|
||||
<DocumentPlusIcon className="h-3.5 w-3.5 shrink-0" />
|
||||
<span className="line-clamp-1 break-all">Create file</span>
|
||||
</div>
|
||||
</button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
import { getLastNPathParts } from "core/util/uri";
|
||||
import FileIcon from "../../FileIcon";
|
||||
import { ToolTip } from "../../gui/Tooltip";
|
||||
|
||||
export interface FileInfoProps {
|
||||
filepath: string;
|
||||
onClick?: () => void;
|
||||
range?: string;
|
||||
}
|
||||
|
||||
const TOOLTIP_ID = "file-info-tooltip";
|
||||
|
||||
export const FileInfo = ({ filepath, range, onClick }: FileInfoProps) => {
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={`flex select-none flex-row items-center gap-0.5 ${onClick && "cursor-pointer hover:underline"}`}
|
||||
onClick={onClick}
|
||||
data-tooltip-id={TOOLTIP_ID}
|
||||
data-tooltip-content={filepath}
|
||||
data-tooltip-place="top-end"
|
||||
>
|
||||
<div>
|
||||
<FileIcon height="20px" width="20px" filename={filepath} />
|
||||
</div>
|
||||
<span className="line-clamp-1 break-all">
|
||||
{getLastNPathParts(filepath, 1)}
|
||||
{range && ` ${range}`}
|
||||
</span>
|
||||
</div>
|
||||
<ToolTip
|
||||
id={TOOLTIP_ID}
|
||||
style={{
|
||||
maxWidth: "200px",
|
||||
textAlign: "left",
|
||||
whiteSpace: "normal",
|
||||
wordBreak: "break-word",
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
@ -5,7 +5,7 @@ export interface GeneratingCodeLoaderProps {
|
|||
codeBlockContent: string;
|
||||
}
|
||||
|
||||
export default function GeneratingCodeLoader({
|
||||
export function GeneratingCodeLoader({
|
||||
showLineCount,
|
||||
codeBlockContent,
|
||||
}: GeneratingCodeLoaderProps) {
|
||||
|
|
@ -16,7 +16,7 @@ export default function GeneratingCodeLoader({
|
|||
: `${numLinesCodeBlock} lines generated`;
|
||||
|
||||
return (
|
||||
<span className="inline-flex items-center gap-2 text-gray-400">
|
||||
<span className="text-lightgray inline-flex items-center gap-2">
|
||||
{showLineCount ? linesGeneratedText : "Generating"}
|
||||
<Spinner />
|
||||
</span>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
import { ArrowLeftEndOnRectangleIcon } from "@heroicons/react/24/outline";
|
||||
|
||||
/**
|
||||
* Button that inserts code at the current cursor position
|
||||
*/
|
||||
interface InsertButtonProps {
|
||||
onInsert: () => void;
|
||||
}
|
||||
|
||||
export function InsertButton({ onInsert }: InsertButtonProps) {
|
||||
return (
|
||||
<div
|
||||
className="text-lightgray flex cursor-pointer items-center border-none bg-transparent text-xs outline-none hover:brightness-125"
|
||||
onClick={onInsert}
|
||||
>
|
||||
<div className="max-2xs:hidden flex items-center gap-1 transition-colors duration-200">
|
||||
<ArrowLeftEndOnRectangleIcon className="h-3.5 w-3.5" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -7,9 +7,7 @@ interface RunInTerminalButtonProps {
|
|||
command: string;
|
||||
}
|
||||
|
||||
export default function RunInTerminalButton({
|
||||
command,
|
||||
}: RunInTerminalButtonProps) {
|
||||
export function RunInTerminalButton({ command }: RunInTerminalButtonProps) {
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
|
||||
function runInTerminal() {
|
||||
|
|
@ -18,7 +16,7 @@ export default function RunInTerminalButton({
|
|||
|
||||
return (
|
||||
<div
|
||||
className={`flex items-center border-none bg-transparent text-xs text-gray-400 text-[${vscForeground}] cursor-pointer outline-none hover:brightness-125`}
|
||||
className={`text-lightgray flex items-center border-none bg-transparent text-xs text-[${vscForeground}] cursor-pointer outline-none hover:brightness-125`}
|
||||
onClick={runInTerminal}
|
||||
>
|
||||
<div
|
||||
|
|
@ -27,7 +25,7 @@ export default function RunInTerminalButton({
|
|||
>
|
||||
<>
|
||||
<CommandLineIcon className="h-3 w-3 hover:brightness-125" />
|
||||
<span className="text-gray-400 max-sm:hidden">Run</span>
|
||||
<span className="text-lightgray max-sm:hidden">Run</span>
|
||||
</>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import { ReactNode, useMemo } from "react";
|
||||
import { Tooltip } from "react-tooltip";
|
||||
import { lightGray, vscForeground } from "../..";
|
||||
import styled from "styled-components";
|
||||
import { lightGray, vscForeground } from "../..";
|
||||
import { getFontSize } from "../../../util";
|
||||
|
||||
export const ToolbarButton = styled.button`
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { ChevronDownIcon } from "@heroicons/react/24/outline";
|
||||
import { inferResolvedUriFromRelativePath } from "core/util/ideUtils";
|
||||
import { useContext, useState } from "react";
|
||||
import { useContext, useEffect, useMemo, useState } from "react";
|
||||
import styled from "styled-components";
|
||||
import {
|
||||
defaultBorderRadius,
|
||||
|
|
@ -8,6 +8,7 @@ import {
|
|||
vscEditorBackground,
|
||||
} from "../..";
|
||||
import { IdeMessengerContext } from "../../../context/IdeMessenger";
|
||||
import { useIdeMessengerRequest } from "../../../hooks";
|
||||
import { useWebviewListener } from "../../../hooks/useWebviewListener";
|
||||
import { useAppSelector } from "../../../redux/hooks";
|
||||
import {
|
||||
|
|
@ -16,12 +17,13 @@ import {
|
|||
} from "../../../redux/slices/sessionSlice";
|
||||
import { getFontSize } from "../../../util";
|
||||
import { isTerminalCodeBlock } from "../utils";
|
||||
import ApplyActions from "./ApplyActions";
|
||||
import CopyButton from "./CopyButton";
|
||||
import { ApplyActions } from "./ApplyActions";
|
||||
import { CopyButton } from "./CopyButton";
|
||||
import { CreateFileButton } from "./CreateFileButton";
|
||||
import { FileInfo } from "./FileInfo";
|
||||
import GeneratingCodeLoader from "./GeneratingCodeLoader";
|
||||
import InsertButton from "./InsertButton";
|
||||
import RunInTerminalButton from "./RunInTerminalButton";
|
||||
import { GeneratingCodeLoader } from "./GeneratingCodeLoader";
|
||||
import { InsertButton } from "./InsertButton";
|
||||
import { RunInTerminalButton } from "./RunInTerminalButton";
|
||||
|
||||
const TopDiv = styled.div`
|
||||
display: flex;
|
||||
|
|
@ -59,7 +61,7 @@ export interface StepContainerPreToolbarProps {
|
|||
disableManualApply?: boolean;
|
||||
}
|
||||
|
||||
export default function StepContainerPreToolbar({
|
||||
export function StepContainerPreToolbar({
|
||||
codeBlockContent,
|
||||
language,
|
||||
relativeFilepath,
|
||||
|
|
@ -77,11 +79,21 @@ export default function StepContainerPreToolbar({
|
|||
expanded ?? (isInEditMode ? false : true),
|
||||
);
|
||||
|
||||
// We store the resolved file URI to ensure we use the same file when
|
||||
// accepting/rejecting diffs, even if no `relativeFilepath` is provided
|
||||
const [resolvedFileUri, setResolvedFileUri] = useState<string | undefined>(
|
||||
undefined,
|
||||
const [relativeFilepathUri, setRelativeFilepathUri] = useState<string | null>(
|
||||
null,
|
||||
);
|
||||
|
||||
const fileExistsInput = useMemo(
|
||||
() => (relativeFilepathUri ? { filepath: relativeFilepathUri } : null),
|
||||
[relativeFilepathUri],
|
||||
);
|
||||
|
||||
const {
|
||||
result: fileExists,
|
||||
refresh: refreshFileExists,
|
||||
isLoading: isLoadingFileExists,
|
||||
} = useIdeMessengerRequest("fileExists", fileExistsInput);
|
||||
|
||||
const nextCodeBlockIndex = useAppSelector(
|
||||
(state) => state.session.codeBlockApplyStates.curIndex,
|
||||
);
|
||||
|
|
@ -90,24 +102,54 @@ export default function StepContainerPreToolbar({
|
|||
selectApplyStateByStreamId(state, codeBlockStreamId),
|
||||
);
|
||||
|
||||
/**
|
||||
* In the case where `relativeFilepath` is defined, this will just be `relativeFilepathUri`.
|
||||
* However, if no `relativeFilepath` is defined, then this will
|
||||
* be the URI of the currently open file at the time the user clicks "Apply".
|
||||
*/
|
||||
const [appliedFileUri, setAppliedFileUri] = useState<string | undefined>(
|
||||
undefined,
|
||||
);
|
||||
|
||||
const isNextCodeBlock = nextCodeBlockIndex === codeBlockIndex;
|
||||
const hasFileExtension =
|
||||
relativeFilepath && /\.[0-9a-z]+$/i.test(relativeFilepath);
|
||||
|
||||
const displayFilepath = relativeFilepath ?? resolvedFileUri;
|
||||
// If we are creating a file, we already render that in the button
|
||||
// so we don't want to dispaly it twice here
|
||||
const displayFilepath = relativeFilepath ?? appliedFileUri;
|
||||
|
||||
async function getFileUri() {
|
||||
// TODO: This logic should be moved to a thunk
|
||||
// Handle apply keyboard shortcut
|
||||
useWebviewListener(
|
||||
"applyCodeFromChat",
|
||||
async () => onClickApply(),
|
||||
[isNextCodeBlock, codeBlockContent],
|
||||
!isNextCodeBlock,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const getRelativeFilepathUri = async () => {
|
||||
if (relativeFilepath) {
|
||||
const resolvedUri = await inferResolvedUriFromRelativePath(
|
||||
relativeFilepath,
|
||||
ideMessenger.ide,
|
||||
);
|
||||
setRelativeFilepathUri(resolvedUri);
|
||||
}
|
||||
};
|
||||
getRelativeFilepathUri();
|
||||
}, [relativeFilepath, ideMessenger.ide]);
|
||||
|
||||
async function getFileUriToApplyTo() {
|
||||
// If we've already resolved a file URI (from clicking apply), use that
|
||||
if (resolvedFileUri) {
|
||||
return resolvedFileUri;
|
||||
if (appliedFileUri) {
|
||||
return appliedFileUri;
|
||||
}
|
||||
|
||||
// If a relative filepath was provided, try to resolve it
|
||||
if (relativeFilepath) {
|
||||
return await inferResolvedUriFromRelativePath(
|
||||
relativeFilepath,
|
||||
ideMessenger.ide,
|
||||
);
|
||||
// If we have the `relativeFilepathUri`, use that
|
||||
if (relativeFilepathUri) {
|
||||
return relativeFilepathUri;
|
||||
}
|
||||
|
||||
// If no filepath was provided, get the current file
|
||||
|
|
@ -120,40 +162,32 @@ export default function StepContainerPreToolbar({
|
|||
}
|
||||
|
||||
async function onClickApply() {
|
||||
const fileUri = await getFileUri();
|
||||
const fileUri = await getFileUriToApplyTo();
|
||||
if (!fileUri) {
|
||||
ideMessenger.ide.showToast(
|
||||
"error",
|
||||
"Could not resolve filepath to apply changes",
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
setResolvedFileUri(fileUri);
|
||||
|
||||
// applyToFile will create the file if it doesn't exist
|
||||
ideMessenger.post("applyToFile", {
|
||||
streamId: codeBlockStreamId,
|
||||
filepath: fileUri,
|
||||
text: codeBlockContent,
|
||||
});
|
||||
|
||||
setAppliedFileUri(fileUri);
|
||||
refreshFileExists();
|
||||
}
|
||||
|
||||
function onClickInsertAtCursor() {
|
||||
ideMessenger.post("insertAtCursor", { text: codeBlockContent });
|
||||
}
|
||||
|
||||
// TODO: This logic should be moved to a thunk
|
||||
// Handle apply keyboard shortcut
|
||||
useWebviewListener(
|
||||
"applyCodeFromChat",
|
||||
async () => onClickApply(),
|
||||
[isNextCodeBlock, codeBlockContent],
|
||||
!isNextCodeBlock,
|
||||
);
|
||||
|
||||
async function handleDiffAction(action: "accept" | "reject") {
|
||||
const filepath = await getFileUri();
|
||||
const filepath = await getFileUriToApplyTo();
|
||||
if (!filepath) {
|
||||
ideMessenger.ide.showToast(
|
||||
"error",
|
||||
|
|
@ -167,13 +201,13 @@ export default function StepContainerPreToolbar({
|
|||
streamId: codeBlockStreamId,
|
||||
});
|
||||
|
||||
setResolvedFileUri(undefined);
|
||||
setAppliedFileUri(undefined);
|
||||
}
|
||||
|
||||
function onClickFilename() {
|
||||
if (resolvedFileUri) {
|
||||
if (appliedFileUri) {
|
||||
ideMessenger.post("showFile", {
|
||||
filepath: resolvedFileUri,
|
||||
filepath: appliedFileUri,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -184,8 +218,32 @@ export default function StepContainerPreToolbar({
|
|||
}
|
||||
}
|
||||
|
||||
// We want until there is an extension in the filepath to avoid rendering
|
||||
// an incomplete filepath
|
||||
const renderActionButtons = () => {
|
||||
if (isTerminalCodeBlock(language, codeBlockContent)) {
|
||||
return <RunInTerminalButton command={codeBlockContent} />;
|
||||
}
|
||||
|
||||
if (isLoadingFileExists) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (fileExists) {
|
||||
return (
|
||||
<ApplyActions
|
||||
disableManualApply={disableManualApply}
|
||||
applyState={applyState}
|
||||
onClickApply={onClickApply}
|
||||
onClickAccept={() => handleDiffAction("accept")}
|
||||
onClickReject={() => handleDiffAction("reject")}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return <CreateFileButton onClick={onClickApply} />;
|
||||
};
|
||||
|
||||
// We wait until there is an extension in the filepath to avoid rendering
|
||||
// an incomplete filepath
|
||||
if (relativeFilepath && !hasFileExtension) {
|
||||
return children;
|
||||
}
|
||||
|
|
@ -196,7 +254,7 @@ export default function StepContainerPreToolbar({
|
|||
<div className="flex max-w-72 flex-row items-center">
|
||||
<ChevronDownIcon
|
||||
onClick={() => setIsExpanded(!isExpanded)}
|
||||
className={`h-3.5 w-3.5 flex-shrink-0 cursor-pointer text-gray-400 hover:brightness-125 ${
|
||||
className={`text-lightgray h-3.5 w-3.5 flex-shrink-0 cursor-pointer hover:brightness-125 ${
|
||||
isExpanded ? "rotate-0" : "-rotate-90"
|
||||
}`}
|
||||
/>
|
||||
|
|
@ -204,10 +262,12 @@ export default function StepContainerPreToolbar({
|
|||
<FileInfo
|
||||
filepath={displayFilepath}
|
||||
range={range}
|
||||
onClick={onClickFilename}
|
||||
onClick={fileExists ? onClickFilename : undefined}
|
||||
/>
|
||||
) : (
|
||||
<span className="ml-2 capitalize text-gray-400">{language}</span>
|
||||
<span className="text-lightgray ml-2 select-none capitalize">
|
||||
{language}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
|
@ -219,20 +279,12 @@ export default function StepContainerPreToolbar({
|
|||
/>
|
||||
) : (
|
||||
<>
|
||||
<InsertButton onInsert={onClickInsertAtCursor} />
|
||||
<CopyButton text={codeBlockContent} />
|
||||
<div className="xs:flex hidden items-center gap-2.5">
|
||||
<InsertButton onInsert={onClickInsertAtCursor} />
|
||||
<CopyButton text={codeBlockContent} />
|
||||
</div>
|
||||
|
||||
{isTerminalCodeBlock(language, codeBlockContent) ? (
|
||||
<RunInTerminalButton command={codeBlockContent} />
|
||||
) : (
|
||||
<ApplyActions
|
||||
disableManualApply={disableManualApply}
|
||||
applyState={applyState}
|
||||
onClickApply={onClickApply}
|
||||
onClickAccept={() => handleDiffAction("accept")}
|
||||
onClickReject={() => handleDiffAction("reject")}
|
||||
/>
|
||||
)}
|
||||
{renderActionButtons()}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
|
@ -22,7 +22,7 @@ import { ToolTip } from "../gui/Tooltip";
|
|||
import FilenameLink from "./FilenameLink";
|
||||
import "./katex.css";
|
||||
import "./markdown.css";
|
||||
import StepContainerPreToolbar from "./StepContainerPreToolbar";
|
||||
import { StepContainerPreToolbar } from "./StepContainerPreToolbar";
|
||||
import SymbolLink from "./SymbolLink";
|
||||
import { SyntaxHighlightedPre } from "./SyntaxHighlightedPre";
|
||||
import { isSymbolNotRif, matchCodeToSymbolOrFile } from "./utils";
|
||||
|
|
@ -23,10 +23,6 @@ const commonTerminalCommands = [
|
|||
"bundle",
|
||||
];
|
||||
|
||||
export function getTerminalCommand(text: string): string {
|
||||
return text.startsWith("$ ") ? text.slice(2) : text;
|
||||
}
|
||||
|
||||
export function isTerminalCodeBlock(
|
||||
language: string | undefined | null,
|
||||
text: string,
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
import { CSSProperties } from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { Tooltip } from "react-tooltip";
|
||||
import { ITooltip, Tooltip } from "react-tooltip";
|
||||
import { vscBackground, vscForeground, vscInputBorder } from "..";
|
||||
import { fontSize } from "../../util";
|
||||
|
||||
const TooltipStyles = {
|
||||
const TooltipStyles: CSSProperties = {
|
||||
fontSize: fontSize(-2),
|
||||
backgroundColor: vscBackground,
|
||||
outline: `0.5px solid ${vscInputBorder}`,
|
||||
|
|
@ -14,7 +15,7 @@ const TooltipStyles = {
|
|||
textAlign: "center",
|
||||
};
|
||||
|
||||
export function ToolTip(props: any) {
|
||||
export function ToolTip(props: ITooltip) {
|
||||
const combinedStyles = {
|
||||
...TooltipStyles,
|
||||
...props.style,
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ function InputToolbar(props: InputToolbarProps) {
|
|||
fileInputRef.current?.click();
|
||||
}}
|
||||
/>
|
||||
<ToolTip id="image-tooltip" place="top-middle">
|
||||
<ToolTip id="image-tooltip" place="top">
|
||||
Attach an image
|
||||
</ToolTip>
|
||||
</HoverItem>
|
||||
|
|
@ -171,7 +171,7 @@ function InputToolbar(props: InputToolbarProps) {
|
|||
className="h-3 w-3 hover:brightness-125"
|
||||
/>
|
||||
|
||||
<ToolTip id="add-context-item-tooltip" place="top-middle">
|
||||
<ToolTip id="add-context-item-tooltip" place="top">
|
||||
Add context (files, docs, urls, etc.)
|
||||
</ToolTip>
|
||||
</HoverItem>
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ export function BlockSettingsTopToolbar() {
|
|||
);
|
||||
|
||||
return (
|
||||
<div className="flex w-full items-center justify-between">
|
||||
<div className="flex w-full items-center justify-between gap-4">
|
||||
<div className="flex flex-row">
|
||||
<div className="xs:flex hidden items-center justify-center text-gray-400">
|
||||
<BlockSettingsToolbarIcon
|
||||
|
|
@ -150,7 +150,7 @@ export function BlockSettingsTopToolbar() {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-0.5">
|
||||
<div className="flex">
|
||||
<AssistantSelect />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { useContext, useMemo } from "react";
|
|||
import { vscBadgeBackground } from "../../../..";
|
||||
import { IdeMessengerContext } from "../../../../../context/IdeMessenger";
|
||||
import FileIcon from "../../../../FileIcon";
|
||||
import StyledMarkdownPreview from "../../../../markdown/StyledMarkdownPreview";
|
||||
import StyledMarkdownPreview from "../../../../StyledMarkdownPreview";
|
||||
import { ExpandableToolbarPreview } from "../../components/ExpandableToolbarPreview";
|
||||
import { NodeViewWrapper } from "../../components/NodeViewWrapper";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { useEffect, useState } from "react";
|
|||
import styled from "styled-components";
|
||||
import { defaultBorderRadius, lightGray, vscBackground } from "../..";
|
||||
import { getFontSize } from "../../../util";
|
||||
import StyledMarkdownPreview from "../../markdown/StyledMarkdownPreview";
|
||||
import StyledMarkdownPreview from "../../StyledMarkdownPreview";
|
||||
|
||||
const SpoilerButton = styled.div`
|
||||
background-color: ${vscBackground};
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
import { getLastNPathParts } from "core/util/uri";
|
||||
import FileIcon from "../../FileIcon";
|
||||
|
||||
export interface FileInfoProps {
|
||||
filepath: string;
|
||||
onClick: () => void;
|
||||
range?: string;
|
||||
}
|
||||
|
||||
export const FileInfo = ({ filepath, range, onClick }: FileInfoProps) => {
|
||||
return (
|
||||
<div
|
||||
className="flex cursor-pointer flex-row items-center gap-0.5"
|
||||
onClick={onClick}
|
||||
>
|
||||
<div>
|
||||
<FileIcon height="20px" width="20px" filename={filepath} />
|
||||
</div>
|
||||
<span className="line-clamp-1 break-all hover:underline">
|
||||
{getLastNPathParts(filepath, 1)}
|
||||
{range && ` ${range}`}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { ArrowLeftEndOnRectangleIcon } from "@heroicons/react/24/outline";
|
||||
import { lightGray } from "../..";
|
||||
|
||||
/**
|
||||
* Button that inserts code at the current cursor position
|
||||
*/
|
||||
interface InsertButtonProps {
|
||||
onInsert: () => void;
|
||||
}
|
||||
|
||||
export default function InsertButton({ onInsert }: InsertButtonProps) {
|
||||
return (
|
||||
<div
|
||||
className={`flex cursor-pointer items-center border-none bg-transparent text-xs outline-none hover:brightness-125`}
|
||||
onClick={onInsert}
|
||||
>
|
||||
<div
|
||||
className="max-2xs:hidden flex items-center gap-1 transition-colors duration-200 hover:brightness-125"
|
||||
style={{ color: lightGray }}
|
||||
>
|
||||
<ArrowLeftEndOnRectangleIcon className="h-3.5 w-3.5 hover:brightness-125" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
export { default } from "./StepContainerPreToolbar";
|
||||
1
gui/src/hooks/index.ts
Normal file
1
gui/src/hooks/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from "./useIdeMessengerRequest";
|
||||
44
gui/src/hooks/useIdeMessengerRequest.ts
Normal file
44
gui/src/hooks/useIdeMessengerRequest.ts
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import type { FromWebviewProtocol } from "core/protocol";
|
||||
import type { SuccessWebviewSingleMessage } from "core/protocol/util";
|
||||
import { useContext, useEffect, useState } from "react";
|
||||
import { IdeMessengerContext } from "../context/IdeMessenger";
|
||||
|
||||
/**
|
||||
* Generic hook for making IDE messenger requests with automatic error handling and refresh capability
|
||||
*/
|
||||
export function useIdeMessengerRequest<T extends keyof FromWebviewProtocol>(
|
||||
messageType: T,
|
||||
data: FromWebviewProtocol[T][0] | null,
|
||||
) {
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
const [result, setResult] = useState<
|
||||
SuccessWebviewSingleMessage<FromWebviewProtocol[T][1]>["content"] | null
|
||||
>(null);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
async function makeRequest() {
|
||||
if (!data) {
|
||||
setResult(null);
|
||||
return;
|
||||
}
|
||||
|
||||
setIsLoading(true);
|
||||
try {
|
||||
const response = await ideMessenger.request(messageType, data);
|
||||
if (response.status === "success") {
|
||||
setResult(response.content);
|
||||
} else {
|
||||
console.error(`Error in ${messageType} request:`, response.error);
|
||||
setResult(null);
|
||||
}
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
makeRequest();
|
||||
}, [data, messageType]);
|
||||
|
||||
return { result, isLoading, refresh: makeRequest };
|
||||
}
|
||||
|
|
@ -13,6 +13,7 @@ import { useCallback, useContext, useEffect, useRef, useState } from "react";
|
|||
import { ErrorBoundary } from "react-error-boundary";
|
||||
import styled from "styled-components";
|
||||
import { Button, lightGray, vscBackground } from "../../components";
|
||||
import AcceptRejectAllButtons from "../../components/AcceptRejectAllButtons";
|
||||
import CodeToEditCard from "../../components/CodeToEditCard";
|
||||
import FeedbackDialog from "../../components/dialogs/FeedbackDialog";
|
||||
import FreeTrialOverDialog from "../../components/dialogs/FreeTrialOverDialog";
|
||||
|
|
@ -24,7 +25,6 @@ import ContinueInputBox from "../../components/mainInput/ContinueInputBox";
|
|||
import { resolveEditorContent } from "../../components/mainInput/TipTapEditor/utils";
|
||||
import { useOnboardingCard } from "../../components/OnboardingCard";
|
||||
import StepContainer from "../../components/StepContainer";
|
||||
import AcceptRejectAllButtons from "../../components/StepContainer/AcceptRejectAllButtons";
|
||||
import { TabBar } from "../../components/TabBar/TabBar";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { useWebviewListener } from "../../hooks/useWebviewListener";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { getMarkdownLanguageTagForFile } from "core/util";
|
||||
import StyledMarkdownPreview from "../../../components/markdown/StyledMarkdownPreview";
|
||||
import StyledMarkdownPreview from "../../../components/StyledMarkdownPreview";
|
||||
|
||||
interface CreateFileToolCallProps {
|
||||
relativeFilepath: string;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { getMarkdownLanguageTagForFile } from "core/util";
|
||||
import { useMemo } from "react";
|
||||
import StyledMarkdownPreview from "../../../components/markdown/StyledMarkdownPreview";
|
||||
import AcceptRejectAllButtons from "../../../components/StepContainer/AcceptRejectAllButtons";
|
||||
import AcceptRejectAllButtons from "../../../components/AcceptRejectAllButtons";
|
||||
import StyledMarkdownPreview from "../../../components/StyledMarkdownPreview";
|
||||
import { useAppSelector } from "../../../redux/hooks";
|
||||
|
||||
type EditToolCallProps = {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ToolCallState } from "core";
|
||||
import StyledMarkdownPreview from "../../../components/markdown/StyledMarkdownPreview";
|
||||
import StyledMarkdownPreview from "../../../components/StyledMarkdownPreview";
|
||||
|
||||
interface RunTerminalCommandToolCallProps {
|
||||
command: string;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue