From 764d1366336fee0619f1f500418eb6f62ca2dd52 Mon Sep 17 00:00:00 2001 From: chezsmithy Date: Mon, 2 Jun 2025 13:02:48 -0700 Subject: [PATCH] Remove continueServerClientPromise --- core/core.ts | 12 ++----- extensions/vscode/src/commands.ts | 35 +------------------ .../vscode/src/extension/VsCodeExtension.ts | 2 -- 3 files changed, 3 insertions(+), 46 deletions(-) diff --git a/core/core.ts b/core/core.ts index 9673c5515..2a133a6e0 100644 --- a/core/core.ts +++ b/core/core.ts @@ -40,7 +40,7 @@ import { RangeInFile, type ContextItem, type ContextItemId, - type IDE + type IDE, } from "."; import { ConfigYaml } from "@continuedev/config-yaml"; @@ -66,7 +66,6 @@ export class Core { configHandler: ConfigHandler; codeBaseIndexer: CodebaseIndexer; completionProvider: CompletionProvider; - continueServerClientPromise: Promise; private docsService: DocsService; private globalContext = new GlobalContext(); llmLogger = new LLMLogger(); @@ -165,18 +164,11 @@ export class Core { dataLogger.ideInfoPromise = ideInfoPromise; dataLogger.ideSettingsPromise = ideSettingsPromise; - let continueServerClientResolve: (_: any) => void | undefined; - this.continueServerClientPromise = new Promise( - (resolve) => (continueServerClientResolve = resolve), - ); - - void ideSettingsPromise.then((ideSettings) => { - const continueServerClient = new ContinueServerClient( + const continueServerClient = new ContinueServerClient( ideSettings.remoteConfigServerUrl, ideSettings.userToken, ); - continueServerClientResolve(continueServerClient); // Index on initialization void this.ide.getWorkspaceDirs().then(async (dirs) => { diff --git a/extensions/vscode/src/commands.ts b/extensions/vscode/src/commands.ts index 84885f757..1dbc69b60 100644 --- a/extensions/vscode/src/commands.ts +++ b/extensions/vscode/src/commands.ts @@ -4,21 +4,14 @@ import * as fs from "node:fs"; import { ContextMenuConfig, ILLM, ModelInstaller } from "core"; import { CompletionProvider } from "core/autocomplete/CompletionProvider"; import { ConfigHandler } from "core/config/ConfigHandler"; -import { ContinueServerClient } from "core/continueServer/stubs/client"; import { EXTENSION_NAME } from "core/control-plane/env"; import { Core } from "core/core"; -import { LOCAL_DEV_DATA_VERSION } from "core/data/log"; import { walkDirAsync } from "core/indexing/walkDir"; import { isModelInstaller } from "core/llm"; import { extractMinimalStackTraceInfo } from "core/util/extractMinimalStackTraceInfo"; import { startLocalOllama } from "core/util/ollamaHelper"; -import { - getConfigJsonPath, - getConfigYamlPath, - getDevDataFilePath, -} from "core/util/paths"; +import { getConfigJsonPath, getConfigYamlPath } from "core/util/paths"; import { Telemetry } from "core/util/posthog"; -import readLastLines from "read-last-lines"; import * as vscode from "vscode"; import * as YAML from "yaml"; @@ -173,7 +166,6 @@ const getCommandsMap: ( consoleView: ContinueConsoleWebviewViewProvider, configHandler: ConfigHandler, verticalDiffManager: VerticalDiffManager, - continueServerClientPromise: Promise, battery: Battery, quickEdit: QuickEdit, core: Core, @@ -185,7 +177,6 @@ const getCommandsMap: ( consoleView, configHandler, verticalDiffManager, - continueServerClientPromise, battery, quickEdit, core, @@ -686,9 +677,6 @@ const getCommandsMap: ( description: getMetaKeyLabel() + " + K, " + getMetaKeyLabel() + " + A", }, - { - label: "$(feedback) Give feedback", - }, { kind: vscode.QuickPickItemKind.Separator, label: "Switch model", @@ -721,8 +709,6 @@ const getCommandsMap: ( title: selectedOption, }); } - } else if (selectedOption === "$(feedback) Give feedback") { - vscode.commands.executeCommand("continue.giveAutocompleteFeedback"); } else if (selectedOption === "$(comment) Open chat") { vscode.commands.executeCommand("continue.focusContinueInput"); } else if (selectedOption === "$(screen-full) Open full screen chat") { @@ -735,23 +721,6 @@ const getCommandsMap: ( }); quickPick.show(); }, - "continue.giveAutocompleteFeedback": async () => { - const feedback = await vscode.window.showInputBox({ - ignoreFocusOut: true, - prompt: - "Please share what went wrong with the last completion. The details of the completion as well as this message will be sent to the Continue team in order to improve.", - }); - if (feedback) { - const client = await continueServerClientPromise; - const completionsPath = getDevDataFilePath( - "autocomplete", - LOCAL_DEV_DATA_VERSION, - ); - - const lastLines = await readLastLines.read(completionsPath, 2); - client.sendFeedback(feedback, lastLines); - } - }, "continue.navigateTo": (path: string, toggle: boolean) => { sidebar.webviewProtocol?.request("navigateTo", { path, toggle }); focusGUI(); @@ -895,7 +864,6 @@ export function registerAllCommands( consoleView: ContinueConsoleWebviewViewProvider, configHandler: ConfigHandler, verticalDiffManager: VerticalDiffManager, - continueServerClientPromise: Promise, battery: Battery, quickEdit: QuickEdit, core: Core, @@ -909,7 +877,6 @@ export function registerAllCommands( consoleView, configHandler, verticalDiffManager, - continueServerClientPromise, battery, quickEdit, core, diff --git a/extensions/vscode/src/extension/VsCodeExtension.ts b/extensions/vscode/src/extension/VsCodeExtension.ts index 2dfb3166c..914624895 100644 --- a/extensions/vscode/src/extension/VsCodeExtension.ts +++ b/extensions/vscode/src/extension/VsCodeExtension.ts @@ -244,8 +244,6 @@ export class VsCodeExtension { this.consoleView, this.configHandler, this.verticalDiffManager, - // This is expected to exist, but it's no longer used? Can I remove it? - this.core.continueServerClientPromise, this.battery, quickEdit, this.core,