Skip to content

Commit 8928645

Browse files
committed
migration
1 parent d8dcdb9 commit 8928645

File tree

8 files changed

+48
-35
lines changed

8 files changed

+48
-35
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,14 @@ 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/api/common/extHostInteractiveEditor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class ExtHostInteractiveEditor implements ExtHostInteractiveEditorShape {
6868
};
6969

7070
extHostCommands.registerApiCommand(new ApiCommand(
71-
'vscode.editorChat.start', 'interactiveEditor.start', 'Invoke a new editor chat session',
71+
'vscode.editorChat.start', 'inlineChat.start', 'Invoke a new editor chat session',
7272
[new ApiCommandArgument<EditorChatApiArg | undefined, InteractiveEditorRunOptions | undefined>('Run arguments', '', _v => true, v => {
7373

7474
if (!v) {

src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function getAccessibilityHelpText(accessor: ServicesAccessor, type: 'chat
3333
const match = currentInput?.match(regex);
3434
const command = match && match.length ? match[0].substring(1) : undefined;
3535
if (command === 'fix') {
36-
const editMode = configurationService.getValue('interactiveEditor.editMode');
36+
const editMode = configurationService.getValue('inlineChat.mode');
3737
if (editMode === EditMode.Preview) {
3838
const keybinding = keybindingService.lookupKeybinding('editor.action.diffReview.next')?.getAriaLabel();
3939
content.push(keybinding ? localize('interactiveSession.diff', "Tab again to enter the Diff editor with the changes and enter review mode with ({0}). Use Up/DownArrow to navigate lines with the proposed changes.", keybinding) : localize('interactiveSession.diffNoKb', "Tab again to enter the Diff editor with the changes and enter review mode with the Go to Next Difference Command. Use Up/DownArrow to navigate lines with the proposed changes."));

src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.ts

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ import { fromNow } from 'vs/base/common/date';
2626
import { IInlineChatSessionService, Recording } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSession';
2727
import { runAccessibilityHelpAction } from 'vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp';
2828
import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vs/platform/accessibility/common/accessibility';
29+
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
2930

31+
CommandsRegistry.registerCommandAlias('interactiveEditor.start', 'inlineChat.start');
3032

3133
export class StartSessionAction extends EditorAction2 {
3234

3335
constructor() {
3436
super({
35-
id: 'interactiveEditor.start',
37+
id: 'inlineChat.start',
3638
title: { value: localize('run', 'Start Code Chat'), original: 'Start Code Chat' },
3739
category: AbstractInlineChatAction.category,
3840
f1: true,
@@ -69,7 +71,7 @@ export class StartSessionAction extends EditorAction2 {
6971
export class UnstashSessionAction extends EditorAction2 {
7072
constructor() {
7173
super({
72-
id: 'interactiveEditor.unstash',
74+
id: 'inlineChat.unstash',
7375
title: { value: localize('unstash', 'Resume Last Dismissed Code Chat'), original: 'Resume Last Dismissed Code Chat' },
7476
category: AbstractInlineChatAction.category,
7577
precondition: ContextKeyExpr.and(CTX_INLINE_CHAT_HAS_STASHED_SESSION, EditorContextKeys.writable),
@@ -132,7 +134,7 @@ export class MakeRequestAction extends AbstractInlineChatAction {
132134

133135
constructor() {
134136
super({
135-
id: 'interactiveEditor.accept',
137+
id: 'inlineChat.accept',
136138
title: localize('accept', 'Make Request'),
137139
icon: Codicon.send,
138140
precondition: ContextKeyExpr.and(CTX_INLINE_CHAT_VISIBLE, CTX_INLINE_CHAT_EMPTY.negate()),
@@ -159,7 +161,7 @@ export class StopRequestAction extends AbstractInlineChatAction {
159161

160162
constructor() {
161163
super({
162-
id: 'interactiveEditor.stop',
164+
id: 'inlineChat.stop',
163165
title: localize('stop', 'Stop Request'),
164166
icon: Codicon.debugStop,
165167
precondition: ContextKeyExpr.and(CTX_INLINE_CHAT_VISIBLE, CTX_INLINE_CHAT_EMPTY.negate(), CTX_INLINE_CHAT_HAS_ACTIVE_REQUEST),
@@ -184,7 +186,7 @@ export class StopRequestAction extends AbstractInlineChatAction {
184186
export class ArrowOutUpAction extends AbstractInlineChatAction {
185187
constructor() {
186188
super({
187-
id: 'interactiveEditor.arrowOutUp',
189+
id: 'inlineChat.arrowOutUp',
188190
title: localize('arrowUp', 'Cursor Up'),
189191
precondition: ContextKeyExpr.and(CTX_INLINE_CHAT_FOCUSED, CTX_INLINE_CHAT_INNER_CURSOR_FIRST, EditorContextKeys.isEmbeddedDiffEditor.negate(), CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()),
190192
keybinding: {
@@ -202,7 +204,7 @@ export class ArrowOutUpAction extends AbstractInlineChatAction {
202204
export class ArrowOutDownAction extends AbstractInlineChatAction {
203205
constructor() {
204206
super({
205-
id: 'interactiveEditor.arrowOutDown',
207+
id: 'inlineChat.arrowOutDown',
206208
title: localize('arrowDown', 'Cursor Down'),
207209
precondition: ContextKeyExpr.and(CTX_INLINE_CHAT_FOCUSED, CTX_INLINE_CHAT_INNER_CURSOR_LAST, EditorContextKeys.isEmbeddedDiffEditor.negate(), CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()),
208210
keybinding: {
@@ -221,7 +223,7 @@ export class FocusInlineChat extends EditorAction2 {
221223

222224
constructor() {
223225
super({
224-
id: 'interactiveEditor.focus',
226+
id: 'inlineChat.focus',
225227
title: { value: localize('focus', 'Focus Input'), original: 'Focus Input' },
226228
f1: true,
227229
category: AbstractInlineChatAction.category,
@@ -247,7 +249,7 @@ export class PreviousFromHistory extends AbstractInlineChatAction {
247249

248250
constructor() {
249251
super({
250-
id: 'interactiveEditor.previousFromHistory',
252+
id: 'inlineCat.previousFromHistory',
251253
title: localize('previousFromHistory', 'Previous From History'),
252254
precondition: CTX_INLINE_CHAT_FOCUSED,
253255
keybinding: {
@@ -266,7 +268,7 @@ export class NextFromHistory extends AbstractInlineChatAction {
266268

267269
constructor() {
268270
super({
269-
id: 'interactiveEditor.nextFromHistory',
271+
id: 'inlineChat.nextFromHistory',
270272
title: localize('nextFromHistory', 'Next From History'),
271273
precondition: CTX_INLINE_CHAT_FOCUSED,
272274
keybinding: {
@@ -296,7 +298,7 @@ export class DiscardAction extends AbstractInlineChatAction {
296298

297299
constructor() {
298300
super({
299-
id: 'interactiveEditor.discard',
301+
id: 'inlineChat.discard',
300302
title: localize('discard', 'Discard'),
301303
icon: Codicon.discard,
302304
precondition: CTX_INLINE_CHAT_VISIBLE,
@@ -321,7 +323,7 @@ export class DiscardToClipboardAction extends AbstractInlineChatAction {
321323

322324
constructor() {
323325
super({
324-
id: 'interactiveEditor.discardToClipboard',
326+
id: 'inlineChat.discardToClipboard',
325327
title: localize('undo.clipboard', 'Discard to Clipboard'),
326328
precondition: ContextKeyExpr.and(CTX_INLINE_CHAT_VISIBLE, CTX_INLINE_CHAT_DID_EDIT),
327329
// keybinding: {
@@ -350,7 +352,7 @@ export class DiscardUndoToNewFileAction extends AbstractInlineChatAction {
350352

351353
constructor() {
352354
super({
353-
id: 'interactiveEditor.discardToFile',
355+
id: 'inlineChat.discardToFile',
354356
title: localize('undo.newfile', 'Discard to New File'),
355357
precondition: ContextKeyExpr.and(CTX_INLINE_CHAT_VISIBLE, CTX_INLINE_CHAT_DID_EDIT),
356358
menu: {
@@ -374,7 +376,7 @@ export class DiscardUndoToNewFileAction extends AbstractInlineChatAction {
374376
export class FeebackHelpfulCommand extends AbstractInlineChatAction {
375377
constructor() {
376378
super({
377-
id: 'interactiveEditor.feedbackHelpful',
379+
id: 'inlineChat.feedbackHelpful',
378380
title: localize('feedback.helpful', 'Helpful'),
379381
icon: Codicon.thumbsup,
380382
precondition: CTX_INLINE_CHAT_VISIBLE,
@@ -396,7 +398,7 @@ export class FeebackHelpfulCommand extends AbstractInlineChatAction {
396398
export class FeebackUnhelpfulCommand extends AbstractInlineChatAction {
397399
constructor() {
398400
super({
399-
id: 'interactiveEditor.feedbackunhelpful',
401+
id: 'inlineChat.feedbackunhelpful',
400402
title: localize('feedback.unhelpful', 'Unhelpful'),
401403
icon: Codicon.thumbsdown,
402404
precondition: CTX_INLINE_CHAT_VISIBLE,
@@ -419,7 +421,7 @@ export class ToggleInlineDiff extends AbstractInlineChatAction {
419421

420422
constructor() {
421423
super({
422-
id: 'interactiveEditor.toggleDiff',
424+
id: 'inlineChat.toggleDiff',
423425
title: localize('toggleDiff', 'Toggle Diff'),
424426
icon: Codicon.diff,
425427
precondition: ContextKeyExpr.and(CTX_INLINE_CHAT_VISIBLE, CTX_INLINE_CHAT_DID_EDIT),
@@ -468,7 +470,7 @@ export class CancelSessionAction extends AbstractInlineChatAction {
468470

469471
constructor() {
470472
super({
471-
id: 'interactiveEditor.cancel',
473+
id: 'inlineChat.cancel',
472474
title: localize('cancel', 'Cancel'),
473475
icon: Codicon.clearAll,
474476
precondition: ContextKeyExpr.and(CTX_INLINE_CHAT_VISIBLE, CTX_INLINE_CHAT_EDIT_MODE.isEqualTo(EditMode.Preview)),
@@ -494,7 +496,7 @@ export class CopyRecordings extends AbstractInlineChatAction {
494496

495497
constructor() {
496498
super({
497-
id: 'interactiveEditor.copyRecordings',
499+
id: 'inlineChat.copyRecordings',
498500
f1: true,
499501
title: {
500502
value: localize('copyRecordings', '(Developer) Write Exchange to Clipboard'),
@@ -532,7 +534,7 @@ export class CopyRecordings extends AbstractInlineChatAction {
532534
export class ViewInChatAction extends AbstractInlineChatAction {
533535
constructor() {
534536
super({
535-
id: 'interactiveEditor.viewInChat',
537+
id: 'inlineChat.viewInChat',
536538
title: localize('viewInChat', 'View in Chat'),
537539
icon: Codicon.commentDiscussion,
538540
precondition: CTX_INLINE_CHAT_VISIBLE,
@@ -552,7 +554,7 @@ export class ViewInChatAction extends AbstractInlineChatAction {
552554
export class ExpandMessageAction extends AbstractInlineChatAction {
553555
constructor() {
554556
super({
555-
id: 'interactiveEditor.expandMessageAction',
557+
id: 'inlineChat.expandMessageAction',
556558
title: localize('expandMessage', 'Expand Message'),
557559
icon: Codicon.chevronDown,
558560
precondition: CTX_INLINE_CHAT_VISIBLE,
@@ -572,7 +574,7 @@ export class ExpandMessageAction extends AbstractInlineChatAction {
572574
export class ContractMessageAction extends AbstractInlineChatAction {
573575
constructor() {
574576
super({
575-
id: 'interactiveEditor.contractMessageAction',
577+
id: 'inlineChat.contractMessageAction',
576578
title: localize('contractMessage', 'Contract Message'),
577579
icon: Codicon.chevronUp,
578580
precondition: CTX_INLINE_CHAT_VISIBLE,
@@ -592,7 +594,7 @@ export class ContractMessageAction extends AbstractInlineChatAction {
592594
export class AccessibilityHelpEditorAction extends EditorAction2 {
593595
constructor() {
594596
super({
595-
id: 'interactiveEditor.accessibilityHelp',
597+
id: 'inlineChat.accessibilityHelp',
596598
title: localize('actions.interactiveSession.accessibiltyHelpEditor', "Interactive Session Editor Accessibility Help"),
597599
category: AbstractInlineChatAction.category,
598600
keybinding: {

src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export class InlineChatController implements IEditorContribution {
157157
}
158158

159159
private _getMode(): EditMode {
160-
const editMode = this._configurationService.inspect<EditMode>('interactiveEditor.editMode');
160+
const editMode = this._configurationService.inspect<EditMode>('inlineChat.mode');
161161
let editModeValue = editMode.value;
162162
if (this._accessibilityService.isScreenReaderOptimized() && editModeValue === editMode.defaultValue) {
163163
// By default, use preview mode for screen reader users
@@ -315,8 +315,8 @@ export class InlineChatController implements IEditorContribution {
315315
}
316316
let result = this._activeSession.session.placeholder ?? localize('default.placeholder', "Ask a question");
317317
if (InlineChatController._promptHistory.length > 0) {
318-
const kb1 = this._keybindingService.lookupKeybinding('interactiveEditor.previousFromHistory')?.getLabel();
319-
const kb2 = this._keybindingService.lookupKeybinding('interactiveEditor.nextFromHistory')?.getLabel();
318+
const kb1 = this._keybindingService.lookupKeybinding('inlineChat.previousFromHistory')?.getLabel();
319+
const kb2 = this._keybindingService.lookupKeybinding('inlineChat.nextFromHistory')?.getLabel();
320320

321321
if (kb1 && kb2) {
322322
result = localize('default.placeholder.history', "{0} ({1}, {2} for history)", result, kb1, kb2);

src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,8 @@ export class InlineChatWidget {
360360
}
361361
let label = defaultAriaLabel;
362362
if (this._configurationService.getValue<boolean>(AccessibilityVerbositySettingId.InteractiveEditor)) {
363-
const kbLabel = this._keybindingService.lookupKeybinding('interactiveEditor.accessibilityHelp')?.getLabel();
364-
label = kbLabel ? localize('interactiveEditor.accessibilityHelp', "Interactive Editor Input, Use {0} for Interactive Editor Accessibility Help.", kbLabel) : localize('interactiveSessionInput.accessibilityHelpNoKb', "Interactive Editor Input, Run the Interactive Editor Accessibility Help command for more information.");
363+
const kbLabel = this._keybindingService.lookupKeybinding('inlineChat.accessibilityHelp')?.getLabel();
364+
label = kbLabel ? localize('inlineChat.accessibilityHelp', "Inline Chat Input, Use {0} for Inline Chat Accessibility Help.", kbLabel) : localize('inlineChat.accessibilityHelpNoKb', "Inline Chat Input, Run the Inline Chat Accessibility Help command for more information.");
365365
}
366366
_inputEditorOptions.ariaLabel = label;
367367
this._inputEditor.updateOptions({ ariaLabel: label });

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ export const enum EditMode {
153153
Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({
154154
id: 'editor',
155155
properties: {
156-
'interactiveEditor.editMode': {
157-
description: localize('editMode', "Configure if changes crafted in the interactive editor are applied directly to the document or are previewed first."),
156+
'inlineChat.mode': {
157+
description: localize('mode', "Configure if changes crafted in the interactive editor are applied directly to the document or are previewed first."),
158158
default: EditMode.LivePreview,
159159
type: 'string',
160160
enum: [EditMode.LivePreview, EditMode.Preview, EditMode.Live],
161161
markdownEnumDescriptions: [
162-
localize('editMode.livePreview', "Changes are applied directly to the document and are highlighted visually via inline or side-by-side diffs. Ending a session will keep the changes."),
163-
localize('editMode.preview', "Changes are previewed only and need to be accepted via the apply button. Ending a session will discard the changes."),
164-
localize('editMode.live', "Changes are applied directly to the document but can be highlighted via inline diffs. Ending a session will keep the changes."),
162+
localize('mode.livePreview', "Changes are applied directly to the document and are highlighted visually via inline or side-by-side diffs. Ending a session will keep the changes."),
163+
localize('mode.preview', "Changes are previewed only and need to be accepted via the apply button. Ending a session will discard the changes."),
164+
localize('mode.live', "Changes are applied directly to the document but can be highlighted via inline diffs. Ending a session will keep the changes."),
165165
]
166166
}
167167
}

src/vs/workbench/contrib/preferences/browser/settingsLayout.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ export const tocData: ITOCEntry<string> = {
232232
},
233233
{
234234
id: 'features/chat',
235-
label: localize('interactiveSession', 'Interactive Session'),
236-
settings: ['chat.*', 'interactiveEditor.*']
235+
label: localize('chat', 'Chat'),
236+
settings: ['chat.*', 'inlineChat.*']
237237
}
238238
]
239239
},

0 commit comments

Comments
 (0)