Remove _currentSelection property, use selection.get() instead

Co-authored-by: jrieken <1794099+jrieken@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-18 15:05:19 +00:00
parent ef429716f0
commit 0ae003aa57

View File

@@ -146,7 +146,6 @@ export class InlineChatEditorAffordance extends Disposable implements IContentWi
private readonly _domNode: HTMLElement;
private _position: IContentWidgetPosition | null = null;
private _isVisible = false;
private _currentSelection: Selection | undefined;
private readonly _onDidRunAction = this._store.add(new Emitter<string>());
readonly onDidRunAction: Event<string> = this._onDidRunAction.event;
@@ -187,7 +186,6 @@ export class InlineChatEditorAffordance extends Disposable implements IContentWi
this._store.add(autorun(r => {
const sel = selection.read(r);
this._currentSelection = sel;
if (sel) {
this._show(sel);
} else {
@@ -196,7 +194,7 @@ export class InlineChatEditorAffordance extends Disposable implements IContentWi
}));
this._store.add(this._editor.onDidScrollChange(() => {
const sel = this._currentSelection;
const sel = selection.get();
if (!sel) {
return;
}