Skip to content

Commit bd27bb0

Browse files
committed
not sure what is causing the test errors
1 parent 670b39e commit bd27bb0

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ export class InlineChatController implements IEditorContribution {
176176
private _currentRun?: Promise<void>;
177177

178178
async run(options: InlineChatRunOptions | undefined = {}): Promise<void> {
179+
console.log('inside of run');
179180
this.finishExistingSession();
180181
if (this._currentRun) {
181182
await this._currentRun;
@@ -667,6 +668,7 @@ export class InlineChatController implements IEditorContribution {
667668
}
668669

669670
private async [State.CANCEL]() {
671+
console.log('inside of cancel function');
670672
assertType(this._activeSession);
671673
assertType(this._strategy);
672674
this._sessionStore.clear();
@@ -771,6 +773,7 @@ export class InlineChatController implements IEditorContribution {
771773
}
772774

773775
cancelSession() {
776+
console.log('inside of the cancel session method');
774777
let result: string | undefined;
775778
if (this._strategy && this._activeSession) {
776779
const changedText = this._activeSession.asChangedText();
@@ -785,6 +788,7 @@ export class InlineChatController implements IEditorContribution {
785788
}
786789

787790
finishExistingSession(): void {
791+
console.log('inside of finish existing session');
788792
if (this._activeSession) {
789793
if (this._activeSession.editMode === EditMode.Preview) {
790794
this._log('finishing existing session, using CANCEL', this._activeSession.editMode);

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,27 +141,39 @@ suite('InteractiveChatController', function () {
141141
});
142142

143143
test('creation, not showing anything', function () {
144+
console.log('*** at the begining of creation');
144145
ctrl = instaService.createInstance(TestController, editor);
145146
assert.ok(ctrl);
146147
assert.strictEqual(ctrl.getWidgetPosition(), undefined);
148+
console.log('*** at the end of creation');
147149
});
148150

149151
test('run (show/hide)', async function () {
152+
console.log('*** at the beginning of run (show/hide)');
153+
150154
ctrl = instaService.createInstance(TestController, editor);
155+
console.log('right before run');
151156
const run = ctrl.run({ message: 'Hello', autoSend: true });
152157

158+
console.log('right before waitFor INIT_SEQUENCE_AUTO_SEND');
153159
await ctrl.waitFor(TestController.INIT_SEQUENCE_AUTO_SEND);
154160
assert.ok(ctrl.getWidgetPosition() !== undefined);
161+
162+
console.log('right before cancel session');
155163
ctrl.cancelSession();
156164

165+
console.log('right before run');
157166
await run;
158167

159168
console.log('ctrl.getWidgetPosition() : ', ctrl.getWidgetPosition());
160169
assert.ok(ctrl.getWidgetPosition() === undefined);
170+
console.log('*** at the end of run (show/hide)');
161171
});
162172

163173
test('wholeRange expands to whole lines, editor selection default', async function () {
164174

175+
console.log('*** at the beginning of wholeRange, editor selection default');
176+
165177
editor.setSelection(new Range(1, 1, 1, 3));
166178
ctrl = instaService.createInstance(TestController, editor);
167179

@@ -186,10 +198,14 @@ suite('InteractiveChatController', function () {
186198

187199
ctrl.cancelSession();
188200
d.dispose();
201+
202+
console.log('*** at the end of wholeRange, editor selection default');
189203
});
190204

191205
test('wholeRange expands to whole lines, session provided', async function () {
192206

207+
console.log('*** at the beginning of wholeRange, editor selection provided');
208+
193209
editor.setSelection(new Range(1, 1, 1, 1));
194210
ctrl = instaService.createInstance(TestController, editor);
195211

@@ -215,9 +231,14 @@ suite('InteractiveChatController', function () {
215231

216232
ctrl.cancelSession();
217233
d.dispose();
234+
235+
console.log('*** at the end of wholeRange, editor selection provided');
218236
});
219237

220238
test('typing outside of wholeRange finishes session', async function () {
239+
240+
console.log('*** at the beginning of typing outside');
241+
221242
ctrl = instaService.createInstance(TestController, editor);
222243
ctrl.run({ message: 'Hello', autoSend: true });
223244

@@ -231,10 +252,14 @@ suite('InteractiveChatController', function () {
231252
editor.trigger('test', 'type', { text: 'a' });
232253

233254
await ctrl.waitFor([State.ACCEPT]);
255+
256+
console.log('*** at the end of typing outside');
234257
});
235258

236259
test('\'whole range\' isn\'t updated for edits outside whole range #4346', async function () {
237260

261+
console.log('*** at the beginning of whole range isnt updated');
262+
238263
editor.setSelection(new Range(3, 1, 3, 1));
239264

240265
const d = inlineChatService.addProvider({
@@ -271,9 +296,14 @@ suite('InteractiveChatController', function () {
271296
await ctrl.waitFor([State.MAKE_REQUEST, State.APPLY_RESPONSE, State.SHOW_RESPONSE, State.WAIT_FOR_INPUT]);
272297

273298
assert.deepStrictEqual(session.wholeRange.value, new Range(1, 1, 4, 12));
299+
300+
console.log('*** at the end of whole range isnt updated');
274301
});
275302

276303
test('Stuck inline chat widget #211', async function () {
304+
305+
console.log('*** at the beginning of stuck inline chat');
306+
277307
const d = inlineChatService.addProvider({
278308
debugName: 'Unit Test',
279309
prepareInlineChatSession() {
@@ -306,5 +336,7 @@ suite('InteractiveChatController', function () {
306336

307337
await p;
308338
assert.strictEqual(ctrl.getWidgetPosition(), undefined);
339+
340+
console.log('*** at the end of stuck inline chat');
309341
});
310342
});

0 commit comments

Comments
 (0)