Merge pull request #3896 from continuedev/nate/vscode-setting-change
don't use enum
This commit is contained in:
commit
afdc003402
5 changed files with 22 additions and 26 deletions
6
extensions/vscode/package-lock.json
generated
6
extensions/vscode/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "0.9.255",
|
||||
"version": "0.9.256",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "0.9.255",
|
||||
"version": "0.9.256",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/fetch": "^1.0.3",
|
||||
|
|
@ -106,7 +106,7 @@
|
|||
"@aws-sdk/client-sagemaker-runtime": "^3.621.0",
|
||||
"@aws-sdk/credential-providers": "^3.620.1",
|
||||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "^1.0.20",
|
||||
"@continuedev/config-yaml": "^1.0.23",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/openai-adapters": "^1.0.10",
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
@ -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();
|
||||
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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`;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue