diff --git a/src/configuration.ts b/src/configuration.ts index c7f7549..27ee312 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -74,38 +74,35 @@ export class Configuration { if (inspection.globalValue !== undefined) { await this.update(to, migrationFn ? migrationFn(inspection.globalValue as TFrom) : inspection.globalValue, ConfigurationTarget.Global); - if (from !== to) { - try { - await this.update(from, undefined, ConfigurationTarget.Global); - } - catch (ex) { - debugger; - } - } + // Can't delete the old setting currently because it errors with `Unable to write to User Settings because is not a registered configuration` + // if (from !== to) { + // try { + // await this.update(from, undefined, ConfigurationTarget.Global); + // } + // catch { } + // } } if (inspection.workspaceValue !== undefined) { await this.update(to, migrationFn ? migrationFn(inspection.workspaceValue as TFrom) : inspection.workspaceValue, ConfigurationTarget.Workspace); - if (from !== to) { - try { - await this.update(from, undefined, ConfigurationTarget.Workspace); - } - catch (ex) { - debugger; - } - } + // Can't delete the old setting currently because it errors with `Unable to write to User Settings because is not a registered configuration` + // if (from !== to) { + // try { + // await this.update(from, undefined, ConfigurationTarget.Workspace); + // } + // catch { } + // } } if (inspection.workspaceFolderValue !== undefined) { await this.update(to, migrationFn ? migrationFn(inspection.workspaceFolderValue as TFrom) : inspection.workspaceFolderValue, ConfigurationTarget.WorkspaceFolder); - if (from !== to) { - try { - await this.update(from, undefined, ConfigurationTarget.WorkspaceFolder); - } - catch (ex) { - debugger; - } - } + // Can't delete the old setting currently because it errors with `Unable to write to User Settings because is not a registered configuration` + // if (from !== to) { + // try { + // await this.update(from, undefined, ConfigurationTarget.WorkspaceFolder); + // } + // catch { } + // } } } diff --git a/src/extension.ts b/src/extension.ts index f24cdd4..0102ca5 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,7 +1,7 @@ 'use strict'; import { Objects, Versions } from './system'; import { commands, ConfigurationTarget, ExtensionContext, extensions, window, workspace } from 'vscode'; -import { CodeLensLanguageScope, CodeLensScopes, configuration, Configuration, IConfig } from './configuration'; +import { CodeLensLanguageScope, CodeLensScopes, configuration, Configuration, IConfig, OutputLevel } from './configuration'; import { CommandContext, ExtensionKey, GlobalState, QualifiedExtensionId, setCommandContext } from './constants'; import { Commands, configureCommands } from './commands'; import { Container } from './container'; @@ -121,11 +121,6 @@ async function migrateSettings(context: ExtensionContext, previousVersion: strin } if (Versions.compare(previous, Versions.from(7, 5, 9)) !== 1) { - const section = configuration.name('advanced')('messages').value; - const messages = configuration.get<{ [key: string]: boolean }>(section); - messages[SuppressedMessages.WelcomeNotice] = false; - await configuration.update(section, messages, ConfigurationTarget.Global); - await configuration.migrate('annotations.file.gutter.gravatars', configuration.name('blame')('avatars').value); await configuration.migrate('annotations.file.gutter.compact', configuration.name('blame')('compact').value); await configuration.migrate('annotations.file.gutter.dateFormat', configuration.name('blame')('dateFormat').value); @@ -173,6 +168,16 @@ async function migrateSettings(context: ExtensionContext, previousVersion: strin await configuration.migrate('recentChanges.file.lineHighlight.locations', configuration.name('recentChanges')('highlight')('locations').value); } + + if (Versions.compare(previous, Versions.from(8, 0, 0, 'beta2')) !== 1) { + const section = configuration.name('advanced')('messages').value; + const messages = configuration.get<{ [key: string]: boolean }>(section); + messages[SuppressedMessages.WelcomeNotice] = false; + await configuration.update(section, messages, ConfigurationTarget.Global); + + await configuration.migrate('debug', configuration.name('outputLevel').value, v => v ? OutputLevel.Debug : configuration.get(configuration.name('outputLevel').value)); + await configuration.migrate('debug', configuration.name('debug').value, v => undefined); + } } catch (ex) { Logger.error(ex, 'migrateSettings');