fix: add current file context when setting is enabled
This commit is contained in:
parent
fbcc5a46b9
commit
31b8f0938b
1 changed files with 8 additions and 0 deletions
|
|
@ -4,8 +4,10 @@ import {
|
|||
BrowserSerializedContinueConfig,
|
||||
Config,
|
||||
ContinueConfig,
|
||||
IContextProvider,
|
||||
SerializedContinueConfig,
|
||||
} from "..";
|
||||
import CurrentFileContextProvider from "../context/providers/CurrentFileContextProvider";
|
||||
|
||||
export const sharedConfigSchema = z
|
||||
.object({
|
||||
|
|
@ -180,6 +182,12 @@ export function modifyAnyConfigWithSharedConfig<
|
|||
if (sharedConfig.useCurrentFileAsContext !== undefined) {
|
||||
configCopy.experimental.useCurrentFileAsContext =
|
||||
sharedConfig.useCurrentFileAsContext;
|
||||
if (sharedConfig.useCurrentFileAsContext === true) {
|
||||
configCopy.contextProviders = [
|
||||
...((configCopy.contextProviders ?? []) as IContextProvider[]),
|
||||
new CurrentFileContextProvider({}),
|
||||
];
|
||||
}
|
||||
}
|
||||
if (sharedConfig.logEditingData !== undefined) {
|
||||
configCopy.experimental.logEditingData = sharedConfig.logEditingData;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue