fix(gpt-runner-vscode): do not provide all the editing context when only checked provide select text

This commit is contained in:
JinmingYang
2023-07-18 00:36:08 +08:00
parent 9c4c2cef97
commit 9a87dc1111
3 changed files with 3176 additions and 3 deletions

View File

@@ -296,6 +296,7 @@ export const createChatSlice: StateCreator<
chatIdAbortCtrlMap.set(chatId, abortCtrl)
const contextFilePaths = state.getContextFilePaths()
const shouldProvideEditingPath = state.provideFileInfoToGptMap.activeIdeFileContents || state.provideFileInfoToGptMap.openingIdeFileContents
await fetchLlmStream({
signal: abortCtrl.signal,
@@ -304,7 +305,7 @@ export const createChatSlice: StateCreator<
appendSystemPrompt,
singleFilePath,
contextFilePaths,
editingFilePath: tempState.ideActiveFilePath,
editingFilePath: shouldProvideEditingPath ? tempState.ideActiveFilePath : undefined,
overrideModelType: state.overrideModelType || undefined,
overrideModelsConfig: state.overrideModelsConfig,
rootPath: getGlobalConfig().rootPath,

View File

@@ -42,8 +42,8 @@ function getInitialState() {
provideFileInfoToGptMap: {
allFilePaths: false,
checkedFileContents: true,
activeIdeFileContents: false,
openingIdeFileContents: true,
activeIdeFileContents: true,
openingIdeFileContents: false,
userSelectedText: true,
},
provideFileInfoPromptMap: {

File diff suppressed because it is too large Load Diff