@@ -279,31 +279,30 @@ suite('EditorService', () => {
279
279
assert . ok ( ! lastUntitledEditorFactoryEditor ) ;
280
280
assert . ok ( ! lastDiffEditorFactoryEditor ) ;
281
281
282
- // TODO@bpasero https://github.com/microsoft/vscode/issues/127310
283
282
// opening the same editor should not create
284
283
// a new editor input
285
- // await openEditor(untypedEditor);
286
- // assert.strictEqual(pane?.group.activeEditor, typedEditor);
287
- //
284
+ await openEditor ( untypedEditor ) ;
285
+ assert . strictEqual ( pane ?. group . activeEditor , typedEditor ) ;
286
+
288
287
// replaceEditors should work too
289
- // let untypedEditorReplacement: IResourceEditorInput = { resource: URI.file('file-replaced.editor-service-override-tests') };
290
- // await service.replaceEditors([{
291
- // editor: typedEditor,
292
- // replacement: untypedEditorReplacement
293
- // }], rootGroup);
288
+ let untypedEditorReplacement : IResourceEditorInput = { resource : URI . file ( 'file-replaced.editor-service-override-tests' ) } ;
289
+ await service . replaceEditors ( [ {
290
+ editor : typedEditor ,
291
+ replacement : untypedEditorReplacement
292
+ } ] , rootGroup ) ;
294
293
295
- // typedEditor = rootGroup.activeEditor!;
294
+ typedEditor = rootGroup . activeEditor ! ;
296
295
297
- // assert.ok(typedEditor instanceof TestFileEditorInput);
298
- // assert.strictEqual(typedEditor?.resource?.toString(), untypedEditorReplacement.resource.toString());
296
+ assert . ok ( typedEditor instanceof TestFileEditorInput ) ;
297
+ assert . strictEqual ( typedEditor ?. resource ?. toString ( ) , untypedEditorReplacement . resource . toString ( ) ) ;
299
298
300
- // assert.strictEqual(editorFactoryCalled, 2);
301
- // assert.strictEqual(untitledEditorFactoryCalled, 0);
302
- // assert.strictEqual(diffEditorFactoryCalled, 0);
299
+ assert . strictEqual ( editorFactoryCalled , 2 ) ;
300
+ assert . strictEqual ( untitledEditorFactoryCalled , 0 ) ;
301
+ assert . strictEqual ( diffEditorFactoryCalled , 0 ) ;
303
302
304
- // assert.strictEqual(lastEditorFactoryEditor, untypedEditorReplacement);
305
- // assert.ok(!lastUntitledEditorFactoryEditor);
306
- // assert.ok(!lastDiffEditorFactoryEditor);
303
+ assert . strictEqual ( lastEditorFactoryEditor , untypedEditorReplacement ) ;
304
+ assert . ok ( ! lastUntitledEditorFactoryEditor ) ;
305
+ assert . ok ( ! lastDiffEditorFactoryEditor ) ;
307
306
308
307
await resetTestState ( ) ;
309
308
}
@@ -329,7 +328,7 @@ suite('EditorService', () => {
329
328
// opening the same editor should not create
330
329
// a new editor input
331
330
await openEditor ( untypedEditor ) ;
332
- // assert.strictEqual(pane?.group.activeEditor, typedEditor); // TODO@bpasero https://github.com/microsoft/vscode/issues/127310
331
+ assert . strictEqual ( pane ?. group . activeEditor , typedEditor ) ;
333
332
334
333
await resetTestState ( ) ;
335
334
}
@@ -505,30 +504,30 @@ suite('EditorService', () => {
505
504
assert . ok ( ! lastUntitledEditorFactoryEditor ) ;
506
505
assert . ok ( ! lastDiffEditorFactoryEditor ) ;
507
506
508
- // // TODO@bpasero https://github.com/microsoft/vscode/issues/127310
509
507
// opening the same editor should not create
510
508
// a new editor input
511
- // await openEditor(typedEditor);
512
- // assert.strictEqual(pane?.group.activeEditor, typedEditor);
509
+ await openEditor ( typedEditor ) ;
510
+ assert . strictEqual ( pane ?. group . activeEditor , typedInput ) ;
511
+
513
512
// replaceEditors should work too
514
- // let typedEditorReplacement = new TestFileEditorInput(URI.file('file-replaced.editor-service-override-tests'), TEST_EDITOR_INPUT_ID);
515
- // await service.replaceEditors([{
516
- // editor: typedEditor,
517
- // replacement: typedEditorReplacement
518
- // }], rootGroup);
513
+ let typedEditorReplacement = new TestFileEditorInput ( URI . file ( 'file-replaced.editor-service-override-tests' ) , TEST_EDITOR_INPUT_ID ) ;
514
+ await service . replaceEditors ( [ {
515
+ editor : typedEditor ,
516
+ replacement : typedEditorReplacement
517
+ } ] , rootGroup ) ;
519
518
520
- // typedInput = rootGroup.activeEditor!;
519
+ typedInput = rootGroup . activeEditor ! ;
521
520
522
- // assert.ok(typedInput instanceof TestFileEditorInput);
523
- // assert.strictEqual(typedInput.resource.toString(), typedEditorReplacement.resource.toString());
521
+ assert . ok ( typedInput instanceof TestFileEditorInput ) ;
522
+ assert . strictEqual ( typedInput . resource . toString ( ) , typedEditorReplacement . resource . toString ( ) ) ;
524
523
525
- // assert.strictEqual(editorFactoryCalled, 2);
526
- // assert.strictEqual(untitledEditorFactoryCalled, 0);
527
- // assert.strictEqual(diffEditorFactoryCalled, 0);
524
+ assert . strictEqual ( editorFactoryCalled , 2 ) ;
525
+ assert . strictEqual ( untitledEditorFactoryCalled , 0 ) ;
526
+ assert . strictEqual ( diffEditorFactoryCalled , 0 ) ;
528
527
529
- // assert.strictEqual((lastEditorFactoryEditor as IResourceEditorInput).resource.toString(), typedInput.resource.toString());
530
- // assert.ok(!lastUntitledEditorFactoryEditor);
531
- // assert.ok(!lastDiffEditorFactoryEditor);
528
+ assert . strictEqual ( ( lastEditorFactoryEditor as IResourceEditorInput ) . resource . toString ( ) , typedInput . resource . toString ( ) ) ;
529
+ assert . ok ( ! lastUntitledEditorFactoryEditor ) ;
530
+ assert . ok ( ! lastDiffEditorFactoryEditor ) ;
532
531
533
532
await resetTestState ( ) ;
534
533
}
@@ -554,7 +553,7 @@ suite('EditorService', () => {
554
553
// opening the same editor should not create
555
554
// a new editor input
556
555
await openEditor ( typedEditor ) ;
557
- // assert.strictEqual(pane?.group.activeEditor, typedEditor); // TODO@bpasero https://github.com/microsoft/vscode/issues/127310
556
+ assert . strictEqual ( pane ?. group . activeEditor , typedEditor ) ;
558
557
559
558
await resetTestState ( ) ;
560
559
}
@@ -774,7 +773,7 @@ suite('EditorService', () => {
774
773
// opening the same editor should not create
775
774
// a new editor input
776
775
await openEditor ( untypedEditor ) ;
777
- // assert.strictEqual(pane?.group.activeEditor, typedEditor); // TODO@bpasero https://github.com/microsoft/vscode/issues/127310
776
+ assert . strictEqual ( pane ?. group . activeEditor , typedEditor ) ;
778
777
779
778
await resetTestState ( ) ;
780
779
}
0 commit comments