removing the console logs

This commit is contained in:
Aiday Marlen Kyzy
2023-07-20 12:54:25 +02:00
parent bd27bb08e5
commit b97e7b8ed0
5 changed files with 0 additions and 48 deletions
@@ -709,8 +709,6 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
}
public override dispose(): void {
console.log('inside of the dispose method');
this._codeEditorService.removeDiffEditor(this);
if (this._beginUpdateDecorationsTimeout !== -1) {
@@ -886,7 +884,6 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
this._onDidChangeModel.fire();
// Diff navigator
console.log('right before the final _register');
this._diffNavigator = this._register(this._instantiationService.createInstance(DiffNavigator, this, {
alwaysRevealFirst: false,
findResultLoop: this.getModifiedEditor().getOption(EditorOption.find).loop
@@ -176,7 +176,6 @@ export class InlineChatController implements IEditorContribution {
private _currentRun?: Promise<void>;
async run(options: InlineChatRunOptions | undefined = {}): Promise<void> {
console.log('inside of run');
this.finishExistingSession();
if (this._currentRun) {
await this._currentRun;
@@ -668,7 +667,6 @@ export class InlineChatController implements IEditorContribution {
}
private async [State.CANCEL]() {
console.log('inside of cancel function');
assertType(this._activeSession);
assertType(this._strategy);
this._sessionStore.clear();
@@ -773,7 +771,6 @@ export class InlineChatController implements IEditorContribution {
}
cancelSession() {
console.log('inside of the cancel session method');
let result: string | undefined;
if (this._strategy && this._activeSession) {
const changedText = this._activeSession.asChangedText();
@@ -788,7 +785,6 @@ export class InlineChatController implements IEditorContribution {
}
finishExistingSession(): void {
console.log('inside of finish existing session');
if (this._activeSession) {
if (this._activeSession.editMode === EditMode.Preview) {
this._log('finishing existing session, using CANCEL', this._activeSession.editMode);
@@ -126,7 +126,6 @@ export class PreviewStrategy extends EditModeStrategy {
const edits = response.localEdits.map(edit => EditOperation.replace(Range.lift(edit.range), edit.text));
this._widget.showEditsPreview(this._session.textModel0, edits, this._session.lastTextModelChanges);
} else {
console.log('inside of render changes');
this._widget.hideEditsPreview();
}
@@ -521,7 +521,6 @@ export class InlineChatWidget {
this._elements.statusToolbar.classList.add('hidden');
this._elements.feedbackToolbar.classList.add('hidden');
this.hideCreatePreview();
console.log('inside of reset');
this.hideEditsPreview();
this._onDidChangeHeight.fire();
}
@@ -538,7 +537,6 @@ export class InlineChatWidget {
showEditsPreview(textModelv0: ITextModel, edits: ISingleEditOperation[], changes: readonly LineRangeMapping[]) {
if (changes.length === 0) {
console.log('inside of show edits preview');
this.hideEditsPreview();
return;
}
@@ -548,7 +546,6 @@ export class InlineChatWidget {
const languageSelection: ILanguageSelection = { languageId: textModelv0.getLanguageId(), onDidChange: Event.None };
const modified = this._modelService.createModel(createTextBufferFactoryFromSnapshot(textModelv0.createSnapshot()), languageSelection, undefined, true);
modified.applyEdits(edits, false);
console.log('inside of show edits preview');
this._previewDiffEditor.value.setModel({ original: textModelv0, modified });
// joined ranges
@@ -580,10 +577,7 @@ export class InlineChatWidget {
}
hideEditsPreview() {
// Error happens because this is called after the diff editor widget is already disposed.
console.log('inside of hide edits preview');
this._elements.previewDiff.classList.add('hidden');
// TODO: error is happening here
this._previewDiffEditor.value.setModel(null);
this._previewDiffModel.clear();
this._onDidChangeHeight.fire();
@@ -840,7 +834,6 @@ export class InlineChatZoneWidget extends ZoneWidget {
}
override hide(): void {
console.log('inside of hide');
this.container!.classList.remove('inside-selection');
this._ctxVisible.reset();
this._ctxCursorPosition.reset();
@@ -141,39 +141,26 @@ suite('InteractiveChatController', function () {
});
test('creation, not showing anything', function () {
console.log('*** at the begining of creation');
ctrl = instaService.createInstance(TestController, editor);
assert.ok(ctrl);
assert.strictEqual(ctrl.getWidgetPosition(), undefined);
console.log('*** at the end of creation');
});
test('run (show/hide)', async function () {
console.log('*** at the beginning of run (show/hide)');
ctrl = instaService.createInstance(TestController, editor);
console.log('right before run');
const run = ctrl.run({ message: 'Hello', autoSend: true });
console.log('right before waitFor INIT_SEQUENCE_AUTO_SEND');
await ctrl.waitFor(TestController.INIT_SEQUENCE_AUTO_SEND);
assert.ok(ctrl.getWidgetPosition() !== undefined);
console.log('right before cancel session');
ctrl.cancelSession();
console.log('right before run');
await run;
console.log('ctrl.getWidgetPosition() : ', ctrl.getWidgetPosition());
assert.ok(ctrl.getWidgetPosition() === undefined);
console.log('*** at the end of run (show/hide)');
});
test('wholeRange expands to whole lines, editor selection default', async function () {
console.log('*** at the beginning of wholeRange, editor selection default');
editor.setSelection(new Range(1, 1, 1, 3));
ctrl = instaService.createInstance(TestController, editor);
@@ -198,14 +185,10 @@ suite('InteractiveChatController', function () {
ctrl.cancelSession();
d.dispose();
console.log('*** at the end of wholeRange, editor selection default');
});
test('wholeRange expands to whole lines, session provided', async function () {
console.log('*** at the beginning of wholeRange, editor selection provided');
editor.setSelection(new Range(1, 1, 1, 1));
ctrl = instaService.createInstance(TestController, editor);
@@ -231,14 +214,9 @@ suite('InteractiveChatController', function () {
ctrl.cancelSession();
d.dispose();
console.log('*** at the end of wholeRange, editor selection provided');
});
test('typing outside of wholeRange finishes session', async function () {
console.log('*** at the beginning of typing outside');
ctrl = instaService.createInstance(TestController, editor);
ctrl.run({ message: 'Hello', autoSend: true });
@@ -252,14 +230,10 @@ suite('InteractiveChatController', function () {
editor.trigger('test', 'type', { text: 'a' });
await ctrl.waitFor([State.ACCEPT]);
console.log('*** at the end of typing outside');
});
test('\'whole range\' isn\'t updated for edits outside whole range #4346', async function () {
console.log('*** at the beginning of whole range isnt updated');
editor.setSelection(new Range(3, 1, 3, 1));
const d = inlineChatService.addProvider({
@@ -296,14 +270,9 @@ suite('InteractiveChatController', function () {
await ctrl.waitFor([State.MAKE_REQUEST, State.APPLY_RESPONSE, State.SHOW_RESPONSE, State.WAIT_FOR_INPUT]);
assert.deepStrictEqual(session.wholeRange.value, new Range(1, 1, 4, 12));
console.log('*** at the end of whole range isnt updated');
});
test('Stuck inline chat widget #211', async function () {
console.log('*** at the beginning of stuck inline chat');
const d = inlineChatService.addProvider({
debugName: 'Unit Test',
prepareInlineChatSession() {
@@ -336,7 +305,5 @@ suite('InteractiveChatController', function () {
await p;
assert.strictEqual(ctrl.getWidgetPosition(), undefined);
console.log('*** at the end of stuck inline chat');
});
});