From 455613f6dbd320b8ecd051421a6ea0c0e7a599bd Mon Sep 17 00:00:00 2001 From: Calvinn Ng Date: Fri, 21 Jun 2024 18:55:39 +0800 Subject: [PATCH] change built binary to also load configuration correctly --- binary/src/core.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/binary/src/core.ts b/binary/src/core.ts index 8cded9f25..49285d682 100644 --- a/binary/src/core.ts +++ b/binary/src/core.ts @@ -13,6 +13,7 @@ import { streamDiffLines } from "core/util/verticalEdit"; import { v4 as uuidv4 } from "uuid"; import { IpcMessenger } from "./messenger"; import { Protocol } from "./protocol"; +import * as vscode from "vscode"; export class Core { private messenger: IpcMessenger; @@ -53,8 +54,11 @@ export class Core { ); const getLlm = async () => { + const ws_config = vscode.workspace.getConfiguration(); const config = await this.configHandler.loadConfig(); - return config.tabAutocompleteModel; + let completionModelName = ws_config.get("ahrefs-continue.completionModel", "") + let completionModel = config.tabAutocompleteModels.find((m) => m.title == completionModelName || m.model == completionModelName) || config.tabAutocompleteModels[0]; + return this.configHandler.setupLlm(completionModel); }; this.completionProvider = new CompletionProvider( this.configHandler,