From bd5cf464c2134f38edfb8e05d74b5cb8fec44491 Mon Sep 17 00:00:00 2001 From: Mathew Pareles Date: Wed, 9 Apr 2025 22:33:17 -0700 Subject: [PATCH] lint error ui --- .../react/src/sidebar-tsx/SidebarChat.tsx | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx index bad585f8..4ef01353 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx @@ -22,12 +22,13 @@ import { WarningBox } from '../void-settings-tsx/WarningBox.js'; import { getModelCapabilities, getIsReasoningEnabledState } from '../../../../common/modelCapabilities.js'; import { AlertTriangle, Ban, Check, ChevronRight, Dot, FileIcon, Pencil, Undo, Undo2, X } from 'lucide-react'; import { ChatMessage, CheckpointEntry, StagingSelectionItem, ToolMessage } from '../../../../common/chatThreadServiceTypes.js'; -import { ToolCallParams, ToolNameWithApproval } from '../../../../common/toolsServiceTypes.js'; +import { LintErrorItem, ToolCallParams, ToolNameWithApproval } from '../../../../common/toolsServiceTypes.js'; import { ApplyButtonsHTML, CopyButton, IconShell1, JumpToFileButton, JumpToTerminalButton, StatusIndicator, StatusIndicatorForApplyButton, useApplyButtonState } from '../markdown/ApplyBlockHoverButtons.js'; import { IsRunningType } from '../../../chatThreadService.js'; import { acceptAllBg, acceptBorder, buttonFontSize, buttonTextColor, rejectAllBg, rejectBg, rejectBorder } from '../../../../common/helpers/colors.js'; import { PlacesType } from 'react-tooltip'; import { ToolName, toolNames } from '../../../../common/prompt/prompts.js'; +import { error } from 'console'; @@ -671,6 +672,7 @@ const ToolHeaderWrapper = ({ numResults, hasNextPage, children, + bottomChildren, isError, onClick, isOpen, @@ -733,6 +735,7 @@ const ToolHeaderWrapper = ({ {children} } + {bottomChildren} ); }; @@ -1338,6 +1341,28 @@ const EditToolChildren = ({ uri, changeDescription }: { uri: URI, changeDescript } +const EditToolLintErrors = ({ lintErrors }: { lintErrors: LintErrorItem[] }) => { + + if (lintErrors.length === 0) return null; + + return ( +
+
+ +
+ {lintErrors.map((error, i) => ( +
Lines {error.startLineNumber}-{error.endLineNumber}: {error.message}
+ ))} +
+ +
+
+ ) + + +} + + const EditToolHeaderButtons = ({ applyBoxId, uri, codeStr }: { applyBoxId: string, uri: URI, codeStr: string }) => { const { currStreamState } = useApplyButtonState({ applyBoxId, uri }) return
@@ -1726,7 +1751,7 @@ const toolNameToComponent: { [T in ToolName]: { resultWrapper: ResultWrapper, if (toolMessage.type !== 'tool_error') { const { params, result } = toolMessage - // componentParams.bottomChildren = + componentParams.bottomChildren = componentParams.children =