@@ -13,7 +13,7 @@ import {
13
13
assertTelemetry ,
14
14
assertTextEditorContains ,
15
15
createTestWorkspaceFolder ,
16
- openATextEditorWithText ,
16
+ toTextEditor ,
17
17
} from 'aws-core-vscode/test'
18
18
import {
19
19
DefaultCodeWhispererClient ,
@@ -156,7 +156,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
156
156
describe ( 'tab and esc' , function ( ) {
157
157
it ( 'single accept' , async function ( ) {
158
158
assertSessionClean ( )
159
- const editor = await openATextEditorWithText ( '' , 'test.py' )
159
+ const editor = await toTextEditor ( '' , 'test.py' )
160
160
161
161
await manualTrigger ( editor , client , config )
162
162
await acceptByTab ( )
@@ -166,7 +166,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
166
166
167
167
it ( 'single reject' , async function ( ) {
168
168
assertSessionClean ( )
169
- const editor = await openATextEditorWithText ( '' , 'test.py' )
169
+ const editor = await toTextEditor ( '' , 'test.py' )
170
170
171
171
await manualTrigger ( editor , client , config )
172
172
await rejectByEsc ( )
@@ -179,7 +179,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
179
179
180
180
it ( 'accept - accept - accept' , async function ( ) {
181
181
assertSessionClean ( )
182
- const editor = await openATextEditorWithText ( '' , 'test.py' )
182
+ const editor = await toTextEditor ( '' , 'test.py' )
183
183
184
184
await manualTrigger ( editor , client , config )
185
185
await acceptByTab ( )
@@ -190,7 +190,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
190
190
await acceptByTab ( )
191
191
await assertTextEditorContains ( `FooBaz${ os . EOL } Baz` )
192
192
193
- const anotherEditor = await openATextEditorWithText ( '' , 'anotherTest.py' )
193
+ const anotherEditor = await toTextEditor ( '' , 'anotherTest.py' )
194
194
assertSessionClean ( )
195
195
await manualTrigger ( anotherEditor , client , config )
196
196
await acceptByTab ( )
@@ -205,7 +205,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
205
205
206
206
it ( 'accept - reject - accept' , async function ( ) {
207
207
assertSessionClean ( )
208
- const editor = await openATextEditorWithText ( '' , 'test.py' )
208
+ const editor = await toTextEditor ( '' , 'test.py' )
209
209
210
210
await manualTrigger ( editor , client , config )
211
211
await acceptByTab ( )
@@ -216,7 +216,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
216
216
await rejectByEsc ( )
217
217
await assertTextEditorContains ( 'Foo' )
218
218
219
- const anotherEditor = await openATextEditorWithText ( '' , 'anotherTest.py' )
219
+ const anotherEditor = await toTextEditor ( '' , 'anotherTest.py' )
220
220
assertSessionClean ( )
221
221
await manualTrigger ( anotherEditor , client , config )
222
222
await rejectByEsc ( )
@@ -231,7 +231,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
231
231
232
232
it ( 'reject - reject - reject' , async function ( ) {
233
233
assertSessionClean ( )
234
- const editor = await openATextEditorWithText ( '' , 'test.py' )
234
+ const editor = await toTextEditor ( '' , 'test.py' )
235
235
236
236
await manualTrigger ( editor , client , config )
237
237
await rejectByEsc ( )
@@ -256,7 +256,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
256
256
257
257
it ( 'reject - accept - reject' , async function ( ) {
258
258
assertSessionClean ( )
259
- const editor = await openATextEditorWithText ( '' , 'test.py' )
259
+ const editor = await toTextEditor ( '' , 'test.py' )
260
260
261
261
await manualTrigger ( editor , client , config )
262
262
await rejectByEsc ( )
@@ -302,7 +302,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
302
302
}
303
303
304
304
assertSessionClean ( )
305
- const editor = await openATextEditorWithText ( '' , 'test.py' )
305
+ const editor = await toTextEditor ( '' , 'test.py' )
306
306
307
307
await manualTrigger ( editor , client , config )
308
308
await navigateNext ( )
@@ -318,7 +318,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
318
318
}
319
319
320
320
assertSessionClean ( )
321
- const editor = await openATextEditorWithText ( '' , 'test.py' )
321
+ const editor = await toTextEditor ( '' , 'test.py' )
322
322
323
323
await manualTrigger ( editor , client , config )
324
324
await navigateNext ( )
@@ -336,7 +336,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
336
336
}
337
337
338
338
assertSessionClean ( )
339
- const editor = await openATextEditorWithText ( '' , 'test.py' )
339
+ const editor = await toTextEditor ( '' , 'test.py' )
340
340
341
341
await manualTrigger ( editor , client , config )
342
342
await navigateNext ( )
@@ -351,7 +351,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
351
351
describe ( 'typing' , function ( ) {
352
352
it ( 'typeahead match accept' , async function ( ) {
353
353
assertSessionClean ( )
354
- const editor = await openATextEditorWithText ( '' , 'test.py' )
354
+ const editor = await toTextEditor ( '' , 'test.py' )
355
355
356
356
await manualTrigger ( editor , client , config )
357
357
await typing ( editor , 'F' )
@@ -365,7 +365,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
365
365
366
366
it ( 'typeahead match, backspace and accept' , async function ( ) {
367
367
assertSessionClean ( )
368
- const editor = await openATextEditorWithText ( '' , 'test.py' )
368
+ const editor = await toTextEditor ( '' , 'test.py' )
369
369
370
370
await manualTrigger ( editor , client , config )
371
371
await typing ( editor , 'F' )
@@ -385,7 +385,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
385
385
// the solution is to waitUntil VSCode InlineSuggestion to resolve the "typeahead" but currently no easy way to know if the InlinSuggestion is shown visible again
386
386
this . skip ( )
387
387
assertSessionClean ( )
388
- const editor = await openATextEditorWithText ( '' , 'test.py' )
388
+ const editor = await toTextEditor ( '' , 'test.py' )
389
389
390
390
await manualTrigger ( editor , client , config )
391
391
await typing ( editor , 'F' )
@@ -398,7 +398,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
398
398
await rejectByEsc ( )
399
399
await assertTextEditorContains ( 'Foo' )
400
400
401
- const anotherEditor = await openATextEditorWithText ( '' , 'anotherTest.py' )
401
+ const anotherEditor = await toTextEditor ( '' , 'anotherTest.py' )
402
402
await manualTrigger ( anotherEditor , client , config )
403
403
await typing ( anotherEditor , 'Qo' )
404
404
await assertTextEditorContains ( 'Qo' )
@@ -415,7 +415,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
415
415
416
416
it ( 'typeahead not match after suggestion is shown and reject' , async function ( ) {
417
417
assertSessionClean ( )
418
- const editor = await openATextEditorWithText ( '' , 'test.py' )
418
+ const editor = await toTextEditor ( '' , 'test.py' )
419
419
420
420
await manualTrigger ( editor , client , config )
421
421
await typing ( editor , 'H' )
@@ -441,13 +441,13 @@ describe.skip('CodeWhisperer telemetry', async function () {
441
441
442
442
it ( 'reject - typeahead not matching after suggestion is shown then invoke another round and accept' , async function ( ) {
443
443
assertSessionClean ( )
444
- const editor = await openATextEditorWithText ( '' , 'test.py' )
444
+ const editor = await toTextEditor ( '' , 'test.py' )
445
445
446
446
await manualTrigger ( editor , client , config )
447
447
await typing ( editor , 'H' )
448
448
await assertTextEditorContains ( 'H' )
449
449
450
- const anotherEditor = await openATextEditorWithText ( '' , 'anotherTest.py' )
450
+ const anotherEditor = await toTextEditor ( '' , 'anotherTest.py' )
451
451
await manualTrigger ( anotherEditor , client , config )
452
452
await acceptByTab ( )
453
453
await assertTextEditorContains ( `Baz${ os . EOL } Baz` )
@@ -462,14 +462,14 @@ describe.skip('CodeWhisperer telemetry', async function () {
462
462
describe ( 'on editor change, focus change' , function ( ) {
463
463
it ( 'reject: trigger then open another editor' , async function ( ) {
464
464
assertSessionClean ( )
465
- const editor = await openATextEditorWithText ( '' , 'test.py' , tempFolder , { preview : false } )
465
+ const editor = await toTextEditor ( '' , 'test.py' , tempFolder , { preview : false } )
466
466
467
467
await manualTrigger ( editor , client , config )
468
468
469
- await openATextEditorWithText ( 'text in 2nd editor' , 'another1.py' , tempFolder , {
469
+ await toTextEditor ( 'text in 2nd editor' , 'another1.py' , tempFolder , {
470
470
preview : false ,
471
471
} )
472
- const anotherEditor = await openATextEditorWithText ( 'text in 3rd editor' , 'another2.py' , tempFolder , {
472
+ const anotherEditor = await toTextEditor ( 'text in 3rd editor' , 'another2.py' , tempFolder , {
473
473
preview : false ,
474
474
} )
475
475
@@ -483,7 +483,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
483
483
484
484
it ( 'reject: trigger then close editor' , async function ( ) {
485
485
assertSessionClean ( )
486
- const editor = await openATextEditorWithText ( '' , 'test.py' )
486
+ const editor = await toTextEditor ( '' , 'test.py' )
487
487
488
488
await manualTrigger ( editor , client , config )
489
489
await closeActiveEditor ( )
@@ -496,7 +496,7 @@ describe.skip('CodeWhisperer telemetry', async function () {
496
496
497
497
it ( 'reject: onFocusChange' , async function ( ) {
498
498
assertSessionClean ( )
499
- const editor = await openATextEditorWithText ( '' , 'test.py' )
499
+ const editor = await toTextEditor ( '' , 'test.py' )
500
500
501
501
await manualTrigger ( editor , client , config )
502
502
await assertTextEditorContains ( '' )
0 commit comments