Skip to content

Commit

Permalink
when disposing inline chat controller directly release session (don't…
Browse files Browse the repository at this point in the history
… wait for SM), enable leak checks in test

re #192356 (comment)

re #190503
  • Loading branch information
jrieken committed Sep 12, 2023
1 parent 41c6343 commit c1f8cef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ export class InlineChatController implements IEditorContribution {
dispose(): void {
this._strategy?.dispose();
this._stashedSession.clear();
this.finishExistingSession();
if (this._activeSession) {
this._inlineChatSessionService.releaseSession(this._activeSession);
}
this._store.dispose();
this._log('controller disposed');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { equals } from 'vs/base/common/arrays';
import { Emitter, Event } from 'vs/base/common/event';
import { DisposableStore } from 'vs/base/common/lifecycle';
import { mock } from 'vs/base/test/common/mock';
import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils';
import { TestDiffProviderFactoryService } from 'vs/editor/browser/diff/testDiffProviderFactoryService';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { IDiffProviderFactoryService } from 'vs/editor/browser/widget/diffEditor/diffProviderFactoryService';
Expand Down Expand Up @@ -147,8 +148,7 @@ suite('InteractiveChatController', function () {
ctrl?.dispose();
});

// todo: re-enable this when earlier tests are fixed
// ensureNoDisposablesAreLeakedInTestSuite();
ensureNoDisposablesAreLeakedInTestSuite();

test('creation, not showing anything', function () {
ctrl = instaService.createInstance(TestController, editor);
Expand Down

0 comments on commit c1f8cef

Please sign in to comment.