diff options
Diffstat (limited to 'src/extension.ts')
| -rw-r--r-- | src/extension.ts | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/extension.ts b/src/extension.ts index 99cc168..73be843 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -11,6 +11,12 @@ enum ConfigChangedNotificationOptions { GLOBAL_STORAGE_KEY = "doxdocgen_hide_config_changed_notification", } +enum Version { + CURRENT = "0.3.1", + PREVIOUS = "0.3.0", + KEY = "doxdocgen_version", +} + // this method is called when your extension is activated // your extension is activated the very first time the command is executed export function activate(context: vscode.ExtensionContext) { @@ -18,9 +24,18 @@ export function activate(context: vscode.ExtensionContext) { context.subscriptions.push(parser); + let change: boolean = false; + + const version = context.globalState.get<string>(Version.KEY); + if (version === undefined) { + context.globalState.update(Version.KEY, Version.CURRENT); + } else if (version !== Version.CURRENT) { + change = true; + } + let notificationHideThenable: Thenable<string>; const active = context.globalState.get<string>(ConfigChangedNotificationOptions.GLOBAL_STORAGE_KEY); - if (active === undefined || active !== "false") { + if (change && (active === undefined || active !== "false")) { // tslint:disable-next-line:max-line-length notificationHideThenable = vscode.window.showWarningMessage("DoxDocGen: Config keys have changed. Please check your config!", ConfigChangedNotificationOptions.CHANGED, ConfigChangedNotificationOptions.HIDE); } |