From 039170eae5c666d029f4f3b92ef018e75e986d23 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 31 Oct 2023 15:04:39 +0100 Subject: [PATCH] Clear cache on new version --- src/commands/Cache.ts | 4 +++- src/helpers/Extension.ts | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/commands/Cache.ts b/src/commands/Cache.ts index 0490e1c6..aafaa7f2 100644 --- a/src/commands/Cache.ts +++ b/src/commands/Cache.ts @@ -1,6 +1,6 @@ import { commands } from 'vscode'; import { COMMAND_NAME, ExtensionState } from '../constants'; -import { Extension, Notifications } from '../helpers'; +import { Extension, Logger, Notifications } from '../helpers'; export class Cache { public static async registerCommands() { @@ -29,6 +29,8 @@ export class Cache { if (showNotification) { Notifications.info('Cache cleared'); + } else { + Logger.info('Cache cleared'); } } } diff --git a/src/helpers/Extension.ts b/src/helpers/Extension.ts index 9bc4e33d..8e6ad425 100644 --- a/src/helpers/Extension.ts +++ b/src/helpers/Extension.ts @@ -32,6 +32,7 @@ import { ContentFolder, Snippet, TaxonomyType } from '../models'; import { Notifications } from './Notifications'; import { Settings } from './SettingsHelper'; import { TaxonomyHelper } from './TaxonomyHelper'; +import { Cache } from '../commands/Cache'; export class Extension { private static instance: Extension; @@ -104,6 +105,9 @@ export class Extension { }); this.setVersion(installedVersion); + + // Reset the cache + Cache.clear(false); } return {