From 9730799a08014709d9ef12e9578efb383fb6254f Mon Sep 17 00:00:00 2001 From: Fred Bricon Date: Wed, 16 Apr 2025 11:01:57 +0200 Subject: [PATCH] Fix 'undefined' this on files/changed listener Signed-off-by: Fred Bricon --- core/core.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/core.ts b/core/core.ts index 1b3794456..56246dfad 100644 --- a/core/core.ts +++ b/core/core.ts @@ -509,9 +509,9 @@ export class Core { streamDiffLinesGenerator(this.configHandler, this.abortedMessageIds, msg), ); - on("completeOnboarding", this.handleCompleteOnboarding); + on("completeOnboarding", this.handleCompleteOnboarding.bind(this)); - on("addAutocompleteModel", this.handleAddAutocompleteModel); + on("addAutocompleteModel", this.handleAddAutocompleteModel.bind(this)); on("stats/getTokensPerDay", async (msg) => { const rows = await DevDataSqliteDb.getTokensPerDay(); @@ -552,7 +552,7 @@ export class Core { }); // File changes - TODO - remove remaining logic for these from IDEs where possible - on("files/changed", this.handleFilesChanged); + on("files/changed", this.handleFilesChanged.bind(this)); const refreshIfNotIgnored = async (uris: string[]) => { const toRefresh: string[] = []; for (const uri of uris) {