Skip to content

Commit 7062714

Browse files
authored
joh/foreign cod (microsoft#182747)
* add more description to IE setting * remove unused code * 💄
1 parent 46c9471 commit 7062714

File tree

4 files changed

+10
-20
lines changed

4 files changed

+10
-20
lines changed

src/vs/workbench/contrib/interactiveEditor/browser/interactiveEditorLivePreviewWidget.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,6 @@ export class InteractiveEditorLivePreviewWidget extends ZoneWidget {
128128
}
129129

130130
override show(): void {
131-
throw new Error('not supported like this, use showDiff');
132-
}
133-
134-
showDiff(): void {
135131
assertType(this.editor.hasModel());
136132
this._updateFromChanges(this._session.wholeRange, this._session.lastTextModelChanges);
137133
this._isVisible = true;

src/vs/workbench/contrib/interactiveEditor/browser/interactiveEditorStrategies.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ export class LivePreviewStrategy extends LiveStrategy {
364364

365365
override async renderChanges(response: EditResponse) {
366366

367-
this._diffZone.showDiff();
367+
this._diffZone.show();
368368
this._updateSummaryMessage();
369369
this._ctxShowingDiff.set(true);
370370

@@ -382,7 +382,7 @@ export class LivePreviewStrategy extends LiveStrategy {
382382
this._diffZone.hide();
383383
this._ctxShowingDiff.set(false);
384384
} else {
385-
this._diffZone.showDiff();
385+
this._diffZone.show();
386386
this._ctxShowingDiff.set(true);
387387
}
388388
scrollState.restore(this._editor);

src/vs/workbench/contrib/interactiveEditor/browser/interactiveEditorWidget.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export class InteractiveEditorWidget {
143143
private readonly _store = new DisposableStore();
144144
private readonly _slashCommands = this._store.add(new DisposableStore());
145145

146-
readonly _inputEditor: IActiveCodeEditor;
146+
private readonly _inputEditor: IActiveCodeEditor;
147147
private readonly _inputModel: ITextModel;
148148
private readonly _ctxInputEmpty: IContextKey<boolean>;
149149
private readonly _ctxMessageCropState: IContextKey<'cropped' | 'not_cropped' | 'expanded'>;
@@ -662,17 +662,6 @@ export class InteractiveEditorZoneWidget extends ZoneWidget {
662662
this._ctxVisible.set(true);
663663
}
664664

665-
updatePosition(where: IPosition) {
666-
// todo@jrieken
667-
// UGYLY: we need to restore focus because showing the zone removes and adds it and that
668-
// means we loose focus for a bit
669-
const hasFocusNow = this.widget._inputEditor.hasWidgetFocus();
670-
super.show(where, this._computeHeightInLines());
671-
if (hasFocusNow) {
672-
this.widget._inputEditor.focus();
673-
}
674-
}
675-
676665
protected override revealRange(_range: Range, _isLastLine: boolean) {
677666
// disabled
678667
}

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,15 @@ Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfigurat
158158
id: 'editor',
159159
properties: {
160160
'interactiveEditor.editMode': {
161-
description: localize('editMode', "Configure if changes crafted in the interactive editor are applied directly or previewed first"),
161+
description: localize('editMode', "Configure if changes crafted in the interactive editor are applied directly to the document or are previewed first."),
162162
default: EditMode.LivePreview,
163163
type: 'string',
164-
enum: [EditMode.LivePreview, EditMode.Preview, EditMode.Live]
164+
enum: [EditMode.LivePreview, EditMode.Preview, EditMode.Live],
165+
markdownEnumDescriptions: [
166+
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."),
167+
localize('editMode.preview', "Changes are previewed only and need to be accepted via the apply button. Ending a session will discard the changes."),
168+
localize('editMode.live', "Changes are applied directly to the document but can be highlighted via inline diffs. Ending a session will keep the changes."),
169+
]
165170
}
166171
}
167172
});

0 commit comments

Comments
 (0)