Skip to content

Commit 595e7d4

Browse files
authored
1 parent 48996f7 commit 595e7d4

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ export class InlineChatController implements IEditorContribution {
279279
widgetPosition = this._editor.getSelection().getStartPosition().delta(-1);
280280
}
281281

282-
let needsMargin = false;
283282
if (initialRender) {
284283
this._zone.value.setContainerMargins();
285284
}
@@ -290,11 +289,8 @@ export class InlineChatController implements IEditorContribution {
290289
if (this._activeSession) {
291290
this._zone.value.updateBackgroundColor(widgetPosition, this._activeSession.wholeRange.value);
292291
}
293-
if (this._strategy) {
294-
needsMargin = this._strategy.needsMargin();
295-
}
296292
if (!this._zone.value.position) {
297-
this._zone.value.setWidgetMargins(widgetPosition, !needsMargin ? 0 : undefined);
293+
this._zone.value.setWidgetMargins(widgetPosition);
298294
this._zone.value.show(widgetPosition);
299295
} else {
300296
this._zone.value.updatePositionAndHeight(widgetPosition);

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ export abstract class EditModeStrategy {
7575
abstract renderChanges(response: ReplyResponse): Promise<Position | undefined>;
7676

7777
abstract hasFocus(): boolean;
78-
79-
abstract needsMargin(): boolean;
8078
}
8179

8280
export class PreviewStrategy extends EditModeStrategy {
@@ -165,10 +163,6 @@ export class PreviewStrategy extends EditModeStrategy {
165163
hasFocus(): boolean {
166164
return this._zone.widget.hasFocus();
167165
}
168-
169-
needsMargin(): boolean {
170-
return true;
171-
}
172166
}
173167

174168

@@ -307,11 +301,6 @@ export class LivePreviewStrategy extends EditModeStrategy {
307301
this._zone.widget.updateStatus(message);
308302
}
309303

310-
override needsMargin(): boolean {
311-
return true;
312-
}
313-
314-
315304
private async _updateDiffZones() {
316305
const diff = await this._editorWorkerService.computeDiff(this._session.textModel0.uri, this._session.textModelN.uri, { ignoreTrimWhitespace: false, maxComputationTimeMs: 5000, computeMoves: false }, 'advanced');
317306
if (!diff || diff.changes.length === 0) {
@@ -901,10 +890,6 @@ export class LiveStrategy extends EditModeStrategy {
901890
this._zone.widget.updateStatus(message);
902891
}
903892

904-
override needsMargin(): boolean {
905-
return true;
906-
}
907-
908893
hasFocus(): boolean {
909894
return this._zone.widget.hasFocus();
910895
}

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,10 +1042,8 @@ export class InlineChatZoneWidget extends ZoneWidget {
10421042
this.container.style.marginLeft = `${marginWithoutIndentation}px`;
10431043
}
10441044

1045-
setWidgetMargins(position: Position, indentationWidth?: number): void {
1046-
if (indentationWidth === undefined) {
1047-
indentationWidth = this._calculateIndentationWidth(position);
1048-
}
1045+
setWidgetMargins(position: Position): void {
1046+
const indentationWidth = this._calculateIndentationWidth(position);
10491047
if (this._indentationWidth === indentationWidth) {
10501048
return;
10511049
}

0 commit comments

Comments
 (0)