Skip to content

Commit f893e87

Browse files
committed
using a different mode for migrating options
1 parent 8928645 commit f893e87

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

src/vs/editor/browser/config/migrateOptions.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,3 @@ registerEditorSettingMigration('experimental.stickyScroll.maxLineCount', (value,
192192
}
193193
}
194194
});
195-
196-
// Inline Chat
197-
198-
registerEditorSettingMigration('interactiveEditor.editMode', (value, read, write) => {
199-
if (typeof value === 'string' && (value === 'live' || value === 'preview' || value === 'livePreview')) {
200-
write('interactiveEditor.editMode', undefined);
201-
if (typeof read('inlineChat.mode') === 'undefined') {
202-
write('inlineChat.mode', value);
203-
}
204-
}
205-
});

src/vs/workbench/contrib/inlineChat/common/inlineChat.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
1717
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
1818
import { Registry } from 'vs/platform/registry/common/platform';
1919
import { diffInserted, diffRemoved, editorHoverHighlight, editorWidgetBorder, focusBorder, inputBackground, inputPlaceholderForeground, registerColor, transparent, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
20+
import { Extensions as ExtensionsMigration, IConfigurationMigrationRegistry } from 'vs/workbench/common/configuration';
2021

2122
export interface IInlineChatSlashCommand {
2223
command: string;
@@ -150,6 +151,14 @@ export const enum EditMode {
150151
Preview = 'preview'
151152
}
152153

154+
Registry.as<IConfigurationMigrationRegistry>(ExtensionsMigration.ConfigurationMigration).registerConfigurationMigrations(
155+
[{
156+
key: 'interactiveEditor.editMode', migrateFn: (value: any) => {
157+
return [['inlineChat.mode', { value: value }]];
158+
}
159+
}]
160+
);
161+
153162
Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({
154163
id: 'editor',
155164
properties: {

0 commit comments

Comments
 (0)