@@ -14,6 +14,8 @@ import { DocumentSession } from '../docdb/session/DocumentSession';
14
14
import { QuerySession } from '../docdb/session/QuerySession' ;
15
15
import { type CosmosDbRecordIdentifier , type ResultViewMetadata } from '../docdb/types/queryResult' ;
16
16
import { getNoSqlQueryConnection } from '../docdb/utils/NoSqlQueryConnection' ;
17
+ import { promptAfterActionEventually } from '../utils/survey' ;
18
+ import { ExperienceKind , UsageImpact } from '../utils/surveyTypes' ;
17
19
import * as vscodeUtil from '../utils/vscodeUtils' ;
18
20
import { BaseTab , type CommandPayload } from './BaseTab' ;
19
21
import { DocumentTab } from './DocumentTab' ;
@@ -258,7 +260,8 @@ export class QueryEditorTab extends BaseTab {
258
260
}
259
261
260
262
private async runQuery ( query : string , options : ResultViewMetadata ) : Promise < void > {
261
- await callWithTelemetryAndErrorHandling ( 'cosmosDB.nosql.queryEditor.runQuery' , async ( context ) => {
263
+ const callbackId = 'cosmosDB.nosql.queryEditor.runQuery' ;
264
+ await callWithTelemetryAndErrorHandling ( callbackId , async ( context ) => {
262
265
if ( ! this . connection ) {
263
266
throw new Error ( 'No connection' ) ;
264
267
}
@@ -271,6 +274,7 @@ export class QueryEditorTab extends BaseTab {
271
274
272
275
await session . run ( ) ;
273
276
} ) ;
277
+ void promptAfterActionEventually ( ExperienceKind . NoSQL , UsageImpact . High , callbackId ) ;
274
278
}
275
279
276
280
private async stopQuery ( executionId : string ) : Promise < void > {
@@ -288,7 +292,8 @@ export class QueryEditorTab extends BaseTab {
288
292
}
289
293
290
294
private async nextPage ( executionId : string ) : Promise < void > {
291
- await callWithTelemetryAndErrorHandling ( 'cosmosDB.nosql.queryEditor.nextPage' , async ( context ) => {
295
+ const callbackId = 'cosmosDB.nosql.queryEditor.nextPage' ;
296
+ await callWithTelemetryAndErrorHandling ( callbackId , async ( context ) => {
292
297
context . telemetry . properties . executionId = executionId ;
293
298
294
299
if ( ! this . connection ) {
@@ -302,10 +307,12 @@ export class QueryEditorTab extends BaseTab {
302
307
303
308
await session . nextPage ( ) ;
304
309
} ) ;
310
+ void promptAfterActionEventually ( ExperienceKind . NoSQL , UsageImpact . Medium , callbackId ) ;
305
311
}
306
312
307
313
private async prevPage ( executionId : string ) : Promise < void > {
308
- await callWithTelemetryAndErrorHandling ( 'cosmosDB.nosql.queryEditor.prevPage' , async ( context ) => {
314
+ const callbackId = 'cosmosDB.nosql.queryEditor.prevPage' ;
315
+ await callWithTelemetryAndErrorHandling ( callbackId , async ( context ) => {
309
316
context . telemetry . properties . executionId = executionId ;
310
317
311
318
if ( ! this . connection ) {
@@ -319,10 +326,12 @@ export class QueryEditorTab extends BaseTab {
319
326
320
327
await session . prevPage ( ) ;
321
328
} ) ;
329
+ void promptAfterActionEventually ( ExperienceKind . NoSQL , UsageImpact . Medium , callbackId ) ;
322
330
}
323
331
324
332
private async firstPage ( executionId : string ) : Promise < void > {
325
- await callWithTelemetryAndErrorHandling ( 'cosmosDB.nosql.queryEditor.firstPage' , async ( context ) => {
333
+ const callbackId = 'cosmosDB.nosql.queryEditor.firstPage' ;
334
+ await callWithTelemetryAndErrorHandling ( callbackId , async ( context ) => {
326
335
context . telemetry . properties . executionId = executionId ;
327
336
328
337
if ( ! this . connection ) {
@@ -336,10 +345,12 @@ export class QueryEditorTab extends BaseTab {
336
345
337
346
await session . firstPage ( ) ;
338
347
} ) ;
348
+ void promptAfterActionEventually ( ExperienceKind . NoSQL , UsageImpact . Medium , callbackId ) ;
339
349
}
340
350
341
351
private async openDocument ( mode : string , documentId ?: CosmosDbRecordIdentifier ) : Promise < void > {
342
- await callWithTelemetryAndErrorHandling ( 'cosmosDB.nosql.queryEditor.openDocument' , ( ) => {
352
+ const callbackId = 'cosmosDB.nosql.queryEditor.openDocument' ;
353
+ await callWithTelemetryAndErrorHandling ( callbackId , ( ) => {
343
354
if ( ! this . connection ) {
344
355
throw new Error ( 'No connection' ) ;
345
356
}
@@ -354,10 +365,12 @@ export class QueryEditorTab extends BaseTab {
354
365
355
366
DocumentTab . render ( this . connection , mode , documentId , this . getNextViewColumn ( ) ) ;
356
367
} ) ;
368
+ void promptAfterActionEventually ( ExperienceKind . NoSQL , UsageImpact . Medium , callbackId ) ;
357
369
}
358
370
359
371
private async deleteDocument ( documentId : CosmosDbRecordIdentifier ) : Promise < void > {
360
- await callWithTelemetryAndErrorHandling ( 'cosmosDB.nosql.queryEditor.deleteDocument' , async ( ) => {
372
+ const callbackId = 'cosmosDB.nosql.queryEditor.deleteDocument' ;
373
+ await callWithTelemetryAndErrorHandling ( callbackId , async ( ) => {
361
374
if ( ! this . connection ) {
362
375
throw new Error ( 'No connection' ) ;
363
376
}
@@ -369,6 +382,7 @@ export class QueryEditorTab extends BaseTab {
369
382
const session = new DocumentSession ( this . connection , this . channel ) ;
370
383
await session . delete ( documentId ) ;
371
384
} ) ;
385
+ void promptAfterActionEventually ( ExperienceKind . NoSQL , UsageImpact . Medium , callbackId ) ;
372
386
}
373
387
374
388
private getNextViewColumn ( ) : vscode . ViewColumn {
0 commit comments