- {/* Edit session history */}
- {/* {editModeState.previousInputs.length > 0 && (
-
- {editModeState.previousInputs.map((input, index) => (
-
-
- {stripImages(input)}
-
-
-
- ))}
-
- )} */}
-
-
- }
- toolbarOptions={{
- hideAddContext: true,
- hideImageUpload: true,
- hideUseCodebase: true,
- hideSelectModel: false,
- enterText: ["streaming", "accepting"].includes(
- editModeState.editStatus,
- )
- ? "Retry"
- : "Edit",
- }}
- placeholder={
- ["streaming", "accepting"].includes(editModeState.editStatus)
- ? "Describe how to modify code"
- : "Describe how to modify code"
- }
- border={`1px solid #aa0`}
- availableContextProviders={availableContextProviders.filter(
- (provider) =>
- !EDIT_DISALLOWED_CONTEXT_PROVIDERS.includes(provider.title),
- )}
- historyKey="edit"
- availableSlashCommands={[]}
- isMainInput={true}
- onEnter={async function (
- editorState: JSONContent,
- modifiers: InputModifiers,
- editor: Editor,
- ): Promise {
- const [contextItems, __, userInstructions] =
- await resolveEditorContent(
- editorState,
- {
- noContext: true,
- useCodebase: false,
- },
- ideMessenger,
- [],
- dispatch,
- );
-
- // Note, not currently updating file symbols in edit mode
-
- const prompt = [
- ...contextItems.map((item) => item.content),
- stripImages(userInstructions),
- ].join("\n\n");
- ideMessenger.post("edit/sendPrompt", {
- prompt,
- range: editModeState.highlightedCode,
- });
- dispatch(submitEdit(prompt));
-
- // Move cursor to end of editor (it's already focused)
- editor.commands.selectTextblockEnd();
- }}
- >
-
-
-
-