chat symbols - active file working
This commit is contained in:
parent
b80833158b
commit
f210faf09d
5 changed files with 11 additions and 10 deletions
|
|
@ -10,11 +10,7 @@ import {
|
|||
import { stripImages } from "core/llm/images";
|
||||
import { IIdeMessenger } from "../../context/IdeMessenger";
|
||||
import { Dispatch } from "@reduxjs/toolkit";
|
||||
import {
|
||||
setIsGatheringContext,
|
||||
updateFileSymbols,
|
||||
} from "../../redux/slices/stateSlice";
|
||||
import { updateFileSymbolsFromContextItems } from "../../util/symbols";
|
||||
import { setIsGatheringContext } from "../../redux/slices/stateSlice";
|
||||
|
||||
interface MentionAttrs {
|
||||
label: string;
|
||||
|
|
@ -175,8 +171,6 @@ async function resolveEditorContent(
|
|||
);
|
||||
contextItems.push(...defaultContextItems.flat());
|
||||
|
||||
await updateFileSymbolsFromContextItems(contextItems, ideMessenger, dispatch);
|
||||
|
||||
if (contextItemsText !== "") {
|
||||
contextItemsText += "\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import {
|
|||
import { resetNextCodeBlockToApplyIndex } from "../redux/slices/stateSlice";
|
||||
import { RootState } from "../redux/store";
|
||||
import useHistory from "./useHistory";
|
||||
import { updateFileSymbolsFromContextItems } from "../util/symbols";
|
||||
|
||||
function useChatHandler(dispatch: Dispatch, ideMessenger: IIdeMessenger) {
|
||||
const posthog = usePostHog();
|
||||
|
|
@ -256,7 +257,11 @@ function useChatHandler(dispatch: Dispatch, ideMessenger: IIdeMessenger) {
|
|||
}
|
||||
}
|
||||
|
||||
// dispatch(addContextItems(contextItems));
|
||||
await updateFileSymbolsFromContextItems(
|
||||
selectedContextItems,
|
||||
ideMessenger,
|
||||
dispatch,
|
||||
);
|
||||
|
||||
const message: ChatMessage = {
|
||||
role: "user",
|
||||
|
|
|
|||
|
|
@ -6,8 +6,7 @@ import { useCallback, useContext } from "react";
|
|||
import { useSelector } from "react-redux";
|
||||
import { IdeMessengerContext } from "../context/IdeMessenger";
|
||||
import { useLastSessionContext } from "../context/LastSessionContext";
|
||||
import { defaultModelSelector } from "../redux/selectors/modelSelectors";
|
||||
import { newSession, updateFileSymbols } from "../redux/slices/stateSlice";
|
||||
import { newSession } from "../redux/slices/stateSlice";
|
||||
import { RootState } from "../redux/store";
|
||||
import { getLocalStorage, setLocalStorage } from "../util/localStorage";
|
||||
import { updateFileSymbolsFromContextItems } from "../util/symbols";
|
||||
|
|
|
|||
|
|
@ -177,6 +177,8 @@ function Edit() {
|
|||
dispatch,
|
||||
);
|
||||
|
||||
// Note, not currently updating file symbols in edit mode
|
||||
|
||||
const prompt = [
|
||||
...contextItems.map((item) => item.content),
|
||||
stripImages(userInstructions),
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ export async function updateFileSymbolsFromContextItems(
|
|||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// Catch all - don't want file symbols to break the chat experience for now
|
||||
console.error("Error updating file symbols from context items", e);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue