Skip to content

Commit

Permalink
Merge pull request #3896 from continuedev/nate/vscode-setting-change
Browse files Browse the repository at this point in the history
don't use enum
  • Loading branch information
sestinj authored Jan 29, 2025
2 parents 7b9ac83 + 59001a3 commit afdc003
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 26 deletions.
6 changes: 3 additions & 3 deletions extensions/vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 5 additions & 11 deletions extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "continue",
"icon": "media/icon.png",
"author": "Continue Dev, Inc",
"version": "0.9.256",
"version": "0.9.257",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"
Expand Down Expand Up @@ -96,16 +96,10 @@
"default": false,
"markdownDescription": "Enable Continue for teams beta features. To sign in, click the person icon in the bottom right of the sidebar."
},
"continue.continueTestEnvironment": {
"type": "string",
"enum": [
"none",
"production",
"test",
"local"
],
"default": "none",
"description": "Continue test environment"
"continue.enableContinueHub": {
"type": "boolean",
"default": false,
"description": "Enable Continue Hub (internal)"
},
"continue.showInlineTip": {
"type": "boolean",
Expand Down
6 changes: 3 additions & 3 deletions extensions/vscode/src/VsCodeIde.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,9 @@ class VsCodeIde implements IDE {
"enableContinueForTeams",
false,
),
continueTestEnvironment: settings.get<
IdeSettings["continueTestEnvironment"]
>("continueTestEnvironment", "none"),
continueTestEnvironment: settings.get<boolean>("enableContinueHub")
? "production"
: "none",
pauseCodebaseIndexOnStart: settings.get<boolean>(
"pauseCodebaseIndexOnStart",
false,
Expand Down
12 changes: 8 additions & 4 deletions extensions/vscode/src/extension/VsCodeExtension.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from "fs";

import { IContextProvider, IdeSettings } from "core";
import { IContextProvider } from "core";
import { ConfigHandler } from "core/config/ConfigHandler";
import { EXTENSION_NAME, getControlPlaneEnv } from "core/control-plane/env";
import { Core } from "core/core";
Expand Down Expand Up @@ -375,9 +375,9 @@ export class VsCodeExtension {
void this.core.invoke("didChangeActiveTextEditor", { filepath });
});

const originalValue = vscode.workspace
const enableContinueHub = vscode.workspace
.getConfiguration(EXTENSION_NAME)
.get<IdeSettings["continueTestEnvironment"]>("continueTestEnvironment");
.get<boolean>("enableContinueHub");
vscode.workspace.onDidChangeConfiguration(async (event) => {
if (event.affectsConfiguration(EXTENSION_NAME)) {
const settings = this.ide.getIdeSettingsSync();
Expand All @@ -386,7 +386,11 @@ export class VsCodeExtension {
settings,
});

if (settings.continueTestEnvironment !== originalValue) {
if (
enableContinueHub
? settings.continueTestEnvironment !== "production"
: settings.continueTestEnvironment === "production"
) {
await vscode.commands.executeCommand("workbench.action.reloadWindow");
}
}
Expand Down
8 changes: 3 additions & 5 deletions extensions/vscode/src/stubs/WorkOsAuthProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@ import {
workspace,
} from "vscode";

import { IdeSettings } from "core";
import { PromiseAdapter, promiseFromEvent } from "./promiseUtils";
import { SecretStorage } from "./SecretStorage";

const AUTH_NAME = "Continue";

const controlPlaneEnv = getControlPlaneEnvSync(
workspace
.getConfiguration(EXTENSION_NAME)
.get<IdeSettings["continueTestEnvironment"]>("continueTestEnvironment") ??
"none",
workspace.getConfiguration(EXTENSION_NAME).get<boolean>("enableContinueHub")
? "production"
: "none",
);

const SESSIONS_SECRET_KEY = `${controlPlaneEnv.AUTH_TYPE}.sessions`;
Expand Down

0 comments on commit afdc003

Please sign in to comment.