Skip to content

Commit d76a632

Browse files
committed
changes from the review
1 parent 193cbfd commit d76a632

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

src/vs/editor/contrib/zoneWidget/browser/zoneWidget.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export interface IOptions {
3131
allowUnlimitedHeight?: boolean;
3232
ordinal?: number;
3333
showInHiddenAreas?: boolean;
34-
allowBehindVerticalScrollbar?: boolean;
3534
}
3635

3736
export interface IStyles {
@@ -272,7 +271,7 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
272271
}
273272

274273
protected _getWidth(info: EditorLayoutInfo): number {
275-
return info.width - info.minimap.minimapWidth - (this.options.allowBehindVerticalScrollbar ? 0 : info.verticalScrollbarWidth);
274+
return info.width - info.minimap.minimapWidth - info.verticalScrollbarWidth;
276275
}
277276

278277
private _getLeft(info: EditorLayoutInfo): number {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export class InlineChatController implements IEditorContribution {
199199
assertType(this._strategy);
200200
assertType(this._editor.hasModel());
201201

202-
let widgetPosition: Position | undefined;
202+
let widgetPosition: Position;
203203
if (initialRender) {
204204
widgetPosition = this._editor.getSelection().getEndPosition();
205205
this._zone.value.setContainerMargins();
@@ -212,7 +212,7 @@ export class InlineChatController implements IEditorContribution {
212212
}
213213
}
214214
this._zone.value.show(widgetPosition);
215-
this._zone.value.updateBackgroundColor(widgetPosition, this._activeSession.selection);
215+
this._zone.value.updateBackgroundColor(widgetPosition, this._activeSession.wholeRange.value);
216216
}
217217

218218
protected async _nextState(state: State, options: InlineChatRunOptions | undefined): Promise<void> {

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ export class Session {
126126
readonly textModelN: ITextModel,
127127
readonly provider: IInlineChatSessionProvider,
128128
readonly session: IInlineChatSession,
129-
readonly wholeRange: SessionWholeRange,
130-
readonly selection: IRange
129+
readonly wholeRange: SessionWholeRange
131130
) {
132131
this.textModelNAltVersion = textModelN.getAlternativeVersionId();
133132
this._teldata = {
@@ -444,7 +443,7 @@ export class InlineChatSessionService implements IInlineChatSessionService {
444443
const wholeRangeMgr = new SessionWholeRange(textModel, wholeRange);
445444
store.add(wholeRangeMgr);
446445

447-
const session = new Session(options.editMode, editor, textModel0, textModel, provider, raw, wholeRangeMgr, editor.getSelection());
446+
const session = new Session(options.editMode, editor, textModel0, textModel, provider, raw, wholeRangeMgr);
448447

449448
// store: key -> session
450449
const key = this._key(editor, textModel.uri);

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import 'vs/css!./inlineChat';
77
import { DisposableStore, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle';
88
import { IActiveCodeEditor, ICodeEditor, IDiffEditorConstructionOptions } from 'vs/editor/browser/editorBrowser';
9-
import { EditorOption } from 'vs/editor/common/config/editorOptions';
9+
import { EditorLayoutInfo, EditorOption } from 'vs/editor/common/config/editorOptions';
1010
import { IRange, Range } from 'vs/editor/common/core/range';
1111
import { localize } from 'vs/nls';
1212
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
@@ -701,7 +701,7 @@ export class InlineChatZoneWidget extends ZoneWidget {
701701
@IInstantiationService private readonly _instaService: IInstantiationService,
702702
@IContextKeyService contextKeyService: IContextKeyService,
703703
) {
704-
super(editor, { showFrame: false, showArrow: false, isAccessible: true, className: 'inline-chat-widget', keepEditorSelection: true, showInHiddenAreas: true, ordinal: 10000 + 3, allowBehindVerticalScrollbar: true });
704+
super(editor, { showFrame: false, showArrow: false, isAccessible: true, className: 'inline-chat-widget', keepEditorSelection: true, showInHiddenAreas: true, ordinal: 10000 + 3 });
705705

706706
this._ctxVisible = CTX_INLINE_CHAT_VISIBLE.bindTo(contextKeyService);
707707
this._ctxCursorPosition = CTX_INLINE_CHAT_OUTER_CURSOR_POSITION.bindTo(contextKeyService);
@@ -771,6 +771,10 @@ export class InlineChatZoneWidget extends ZoneWidget {
771771
this._ctxVisible.set(true);
772772
}
773773

774+
override _getWidth(info: EditorLayoutInfo): number {
775+
return info.width - info.minimap.minimapWidth - 0;
776+
}
777+
774778
public updateBackgroundColor(position: Position, selection: IRange) {
775779
if (!this.container) {
776780
return;

0 commit comments

Comments
 (0)