From 20d89cd07cd8122904db4c7669b3ee1086629a38 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Wed, 19 Mar 2025 18:28:38 -0700 Subject: [PATCH] prompt update --- .../react/src/void-command-bar-tsx/VoidCommandBar.tsx | 7 ++++--- src/vs/workbench/contrib/void/common/prompt/prompts.ts | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/react/src/void-command-bar-tsx/VoidCommandBar.tsx b/src/vs/workbench/contrib/void/browser/react/src/void-command-bar-tsx/VoidCommandBar.tsx index a319e0b9..074e7e09 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/void-command-bar-tsx/VoidCommandBar.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/void-command-bar-tsx/VoidCommandBar.tsx @@ -34,8 +34,7 @@ export const VoidCommandBarMain = ({ uri, editor }: VoidCommandBarProps) => { const stepIdx = (currIdx: number | null, len: number, step: -1 | 1) => { if (len === 0) return null - if (len === 1 && step === -1) return null // don't step backwards if just 1 element - return ((currIdx ?? 0) + step) % len + return ((currIdx ?? 0) + step + len) % len // for some reason, small negatives are kept negative. just add len to offset } @@ -54,6 +53,7 @@ const VoidCommandBar = ({ uri, editor }: { uri: URI | null, editor: ICodeEditor // changes if the user clicks left/right or if the user goes on a uri with changes const [currUriIdx, setUriIdx] = useState(null) const [currUriHasChanges, setCurrUriHasChanges] = useState(false) + const anyUriHasChanges = sortedCommandBarURIs.length !== 0 useEffect(() => { console.log('uri', uri?.fsPath, sortedCommandBarURIs) const i = sortedCommandBarURIs.findIndex(e => e.fsPath === uri?.fsPath) @@ -91,6 +91,7 @@ const VoidCommandBar = ({ uri, editor }: { uri: URI | null, editor: ICodeEditor const diff = editCodeService.diffOfId[diffid] const range = { startLineNumber: diff.startLine, endLineNumber: diff.startLine, startColumn: 1, endColumn: 1 }; editor.revealRange(range, ScrollType.Immediate) + commandBarService.setDiffIdx(uri, idx) } } @@ -133,7 +134,7 @@ const VoidCommandBar = ({ uri, editor }: { uri: URI | null, editor: ICodeEditor // if there are *any* changes at all - const navPanel = sortedCommandBarURIs.length !== 0 &&
setIsFocused(true)} onBlur={() => setIsFocused(false)} diff --git a/src/vs/workbench/contrib/void/common/prompt/prompts.ts b/src/vs/workbench/contrib/void/common/prompt/prompts.ts index 72f02707..73716c8d 100644 --- a/src/vs/workbench/contrib/void/common/prompt/prompts.ts +++ b/src/vs/workbench/contrib/void/common/prompt/prompts.ts @@ -53,6 +53,7 @@ You're allowed to ask for more context. For example, if the user only gives you \ `} ${mode === 'agent' /* code blocks */ ? `\ +Behavior: - Prioritize editing files and running commands over simply making suggestions. - Prioritize taking as many steps as you need to complete your request over stopping early.\ `: `\ @@ -65,7 +66,9 @@ If you think it's appropriate to suggest an edit to a file, then you must descri Misc: - Do not make things up. - Do not be lazy. -- Always wrap any code you produce in triple backticks, and specify a language if possible. For example, ${tripleTick[0]}typescript\n...\n${tripleTick[1]}.\ +- Always wrap any code you produce in triple backticks, and specify a language if possible. For example, ${tripleTick[0]}typescript\n...\n${tripleTick[1]}. ${mode === 'agent' || mode === 'gather' ? ` +- If you are writing a code explanation for the user (NOT calling a tool), and you know the full path of the file that the code should go in, then you should also output the path in the first line of the triple ticks. For example, ${tripleTick[0]}typescript\n/Users/username/Desktop/my_project/app.ts\n...\n${tripleTick[1]}.\ +This is only for display purposes to the user, and it's not required. Do NOT do this if you are calling a tool or have any ambiguity about the path.` : ''}\ `