Skip to content

Commit 670b39e

Browse files
committed
adding console logs to understand where the error comes from
1 parent 15db606 commit 670b39e

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

src/vs/editor/browser/widget/diffEditorWidget.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,8 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
709709
}
710710

711711
public override dispose(): void {
712+
console.log('inside of the dispose method');
713+
712714
this._codeEditorService.removeDiffEditor(this);
713715

714716
if (this._beginUpdateDecorationsTimeout !== -1) {
@@ -884,6 +886,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
884886
this._onDidChangeModel.fire();
885887

886888
// Diff navigator
889+
console.log('right before the final _register');
887890
this._diffNavigator = this._register(this._instantiationService.createInstance(DiffNavigator, this, {
888891
alwaysRevealFirst: false,
889892
findResultLoop: this.getModifiedEditor().getOption(EditorOption.find).loop

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export class PreviewStrategy extends EditModeStrategy {
126126
const edits = response.localEdits.map(edit => EditOperation.replace(Range.lift(edit.range), edit.text));
127127
this._widget.showEditsPreview(this._session.textModel0, edits, this._session.lastTextModelChanges);
128128
} else {
129+
console.log('inside of render changes');
129130
this._widget.hideEditsPreview();
130131
}
131132

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,7 @@ export class InlineChatWidget {
521521
this._elements.statusToolbar.classList.add('hidden');
522522
this._elements.feedbackToolbar.classList.add('hidden');
523523
this.hideCreatePreview();
524+
console.log('inside of reset');
524525
this.hideEditsPreview();
525526
this._onDidChangeHeight.fire();
526527
}
@@ -537,6 +538,7 @@ export class InlineChatWidget {
537538

538539
showEditsPreview(textModelv0: ITextModel, edits: ISingleEditOperation[], changes: readonly LineRangeMapping[]) {
539540
if (changes.length === 0) {
541+
console.log('inside of show edits preview');
540542
this.hideEditsPreview();
541543
return;
542544
}
@@ -546,6 +548,7 @@ export class InlineChatWidget {
546548
const languageSelection: ILanguageSelection = { languageId: textModelv0.getLanguageId(), onDidChange: Event.None };
547549
const modified = this._modelService.createModel(createTextBufferFactoryFromSnapshot(textModelv0.createSnapshot()), languageSelection, undefined, true);
548550
modified.applyEdits(edits, false);
551+
console.log('inside of show edits preview');
549552
this._previewDiffEditor.value.setModel({ original: textModelv0, modified });
550553

551554
// joined ranges
@@ -577,7 +580,10 @@ export class InlineChatWidget {
577580
}
578581

579582
hideEditsPreview() {
583+
// Error happens because this is called after the diff editor widget is already disposed.
584+
console.log('inside of hide edits preview');
580585
this._elements.previewDiff.classList.add('hidden');
586+
// TODO: error is happening here
581587
this._previewDiffEditor.value.setModel(null);
582588
this._previewDiffModel.clear();
583589
this._onDidChangeHeight.fire();
@@ -834,6 +840,7 @@ export class InlineChatZoneWidget extends ZoneWidget {
834840
}
835841

836842
override hide(): void {
843+
console.log('inside of hide');
837844
this.container!.classList.remove('inside-selection');
838845
this._ctxVisible.reset();
839846
this._ctxCursorPosition.reset();

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ suite('InteractiveChatController', function () {
156156

157157
await run;
158158

159+
console.log('ctrl.getWidgetPosition() : ', ctrl.getWidgetPosition());
159160
assert.ok(ctrl.getWidgetPosition() === undefined);
160161
});
161162

0 commit comments

Comments
 (0)