From fd80c42f7696d2998c9ead4dfc106a92650f9401 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 24 Jan 2025 02:25:38 -0800 Subject: [PATCH] add local environment to dropdown, other fixes --- core/config/ConfigHandler.ts | 22 +++++++++++----------- core/control-plane/env.ts | 4 +++- core/index.d.ts | 2 +- extensions/vscode/package.json | 3 ++- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/core/config/ConfigHandler.ts b/core/config/ConfigHandler.ts index 3c217bbb5b..343bb9cfc1 100644 --- a/core/config/ConfigHandler.ts +++ b/core/config/ConfigHandler.ts @@ -26,7 +26,7 @@ import { } from "./onboarding.js"; import ControlPlaneProfileLoader from "./profile/ControlPlaneProfileLoader.js"; import LocalProfileLoader from "./profile/LocalProfileLoader.js"; -import PlatformProfileLoader from "./profile/PlatformProfileLoader.1.js"; +import PlatformProfileLoader from "./profile/PlatformProfileLoader.js"; import { ProfileDescription, ProfileLifecycleManager, @@ -116,10 +116,7 @@ export class ConfigHandler { this.controlPlaneClient .listAssistants() .then(async (assistants) => { - this.profiles = this.profiles.filter( - (profile) => profile.profileDescription.id === "local", - ); - await Promise.all( + const hubProfiles = await Promise.all( assistants.map(async (assistant) => { let renderedConfig: ConfigYaml | undefined = undefined; if (assistant.configResult.config) { @@ -141,15 +138,18 @@ export class ConfigHandler { this.writeLog, this.reloadConfig.bind(this), ); - this.profiles = [ - ...this.profiles.filter( - (profile) => profile.profileDescription.id === "local", - ), - new ProfileLifecycleManager(profileLoader, this.ide), - ]; + + return new ProfileLifecycleManager(profileLoader, this.ide); }), ); + this.profiles = [ + ...this.profiles.filter( + (profile) => profile.profileDescription.id === "local", + ), + ...hubProfiles, + ]; + this.notifyProfileListeners( this.profiles.map((profile) => profile.profileDescription), ); diff --git a/core/control-plane/env.ts b/core/control-plane/env.ts index fd37c31a8c..8f5bb40a4d 100644 --- a/core/control-plane/env.ts +++ b/core/control-plane/env.ts @@ -75,7 +75,9 @@ export function getControlPlaneEnvSync( ? "hub" : ideTestEnvironment === "test" ? "test" - : process.env.CONTROL_PLANE_ENV; + : ideTestEnvironment === "local" + ? "local" + : process.env.CONTROL_PLANE_ENV; return env === "local" ? LOCAL_ENV diff --git a/core/index.d.ts b/core/index.d.ts index 998ccb312a..03c32a8b5c 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -583,7 +583,7 @@ export interface IdeSettings { remoteConfigSyncPeriod: number; userToken: string; enableControlServerBeta: boolean; - continueTestEnvironment: "none" | "production" | "test"; + continueTestEnvironment: "none" | "production" | "test" | "local"; pauseCodebaseIndexOnStart: boolean; enableDebugLogs: boolean; } diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index a6eba5ce7c..7fccfb4fc4 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -101,7 +101,8 @@ "enum": [ "none", "production", - "test" + "test", + "local" ], "default": "none", "description": "Continue test environment"