From 023e4586efa4c980a259f9470ae1217475067a1a Mon Sep 17 00:00:00 2001 From: Enguerrand de Ribaucourt Date: Wed, 6 Dec 2023 14:24:53 +0100 Subject: [PATCH] Fix: Only rescan when bitbake settings are changed The extension started scanning twice at startup. It turns out this was because the extension was sending a rescan request when the python embedded settings where updated. This was fixed by only sending a rescan request when the bitbake settings are changed. --- client/src/extension.ts | 1 + server/src/server.ts | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/extension.ts b/client/src/extension.ts index b2adacd2..709f41d7 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -69,6 +69,7 @@ export async function activate (context: vscode.ExtensionContext): Promise if (event.affectsConfiguration('bitbake')) { bitbakeDriver.loadSettings(vscode.workspace.getConfiguration('bitbake'), vscode.workspace.workspaceFolders?.[0].uri.fsPath) logger.debug('Bitbake settings changed') + void vscode.commands.executeCommand('bitbake.rescan-project') } if (event.affectsConfiguration('bitbake.loggingLevel')) { loadLoggerSettings() diff --git a/server/src/server.ts b/server/src/server.ts index f90295aa..55728dbd 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -91,7 +91,6 @@ connection.onShutdown(() => { // eslint-disable-next-line @typescript-eslint/no-misused-promises connection.onDidChangeConfiguration(async (change) => { logger.level = change.settings.bitbake.loggingLevel - void connection.sendRequest('bitbake/rescanProject') parseOnSave = change.settings.bitbake.parseOnSave })