run config reload with additional context providers

This commit is contained in:
Adam Shedivy 2025-01-22 13:21:39 -06:00
parent aaf1a608bc
commit 344241bcda
2 changed files with 5 additions and 5 deletions

View file

@ -286,11 +286,11 @@ export class ConfigHandler {
this.updateListeners.push(listener);
}
async reloadConfig() {
async reloadConfig(additionalContextProviders: IContextProvider[] = []) {
// TODO: this isn't right, there are two different senses in which you want to "reload"
const { config, errors, configLoadInterrupted } =
await this.currentProfile.reloadConfig();
await this.currentProfile.reloadConfig(additionalContextProviders);
if (config) {
this.inactiveProfiles.forEach((profile) => profile.clearConfig());
@ -340,6 +340,6 @@ export class ConfigHandler {
registerCustomContextProvider(contextProvider: IContextProvider) {
this.additionalContextProviders.push(contextProvider);
void this.reloadConfig();
void this.reloadConfig(this.additionalContextProviders);
}
}

View file

@ -32,12 +32,12 @@ export class ProfileLifecycleManager {
}
// Clear saved config and reload
async reloadConfig(): Promise<ConfigResult<ContinueConfig>> {
async reloadConfig(additionalContextProviders: IContextProvider[] = []): Promise<ConfigResult<ContinueConfig>> {
this.savedConfigResult = undefined;
this.savedBrowserConfigResult = undefined;
this.pendingConfigPromise = undefined;
return this.loadConfig([], true);
return this.loadConfig(additionalContextProviders, true);
}
async loadConfig(