Skip to content

Commit

Permalink
change built binary to also load configuration correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Calvinn Ng committed Jun 21, 2024
1 parent e5221da commit 455613f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion binary/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 455613f

Please sign in to comment.