@@ -46,6 +46,7 @@ import { EnablementState } from 'vs/workbench/services/extensionManagement/commo
46
46
import { IWorkingCopyBackupService } from 'vs/workbench/services/workingCopy/common/workingCopyBackup' ;
47
47
import { streamToBuffer } from 'vs/base/common/buffer' ;
48
48
import { ILogService } from 'vs/platform/log/common/log' ;
49
+ import { INotebookEditorWorkerService } from 'vs/workbench/contrib/notebook/common/services/notebookWorkerService' ;
49
50
50
51
const NOTEBOOK_EDITOR_VIEW_STATE_PREFERENCE_KEY = 'NotebookEditorViewState' ;
51
52
@@ -89,7 +90,8 @@ export class NotebookEditor extends EditorPane implements INotebookEditorPane {
89
90
@INotebookService private readonly _notebookService : INotebookService ,
90
91
@IExtensionsWorkbenchService private readonly _extensionsWorkbenchService : IExtensionsWorkbenchService ,
91
92
@IWorkingCopyBackupService private readonly _workingCopyBackupService : IWorkingCopyBackupService ,
92
- @ILogService private readonly logService : ILogService
93
+ @ILogService private readonly logService : ILogService ,
94
+ @INotebookEditorWorkerService private readonly _notebookEditorWorkerService : INotebookEditorWorkerService ,
93
95
) {
94
96
super ( NotebookEditor . ID , telemetryService , themeService , storageService ) ;
95
97
this . _editorMemento = this . getEditorMemento < INotebookEditorViewState > ( _editorGroupService , configurationService , NOTEBOOK_EDITOR_VIEW_STATE_PREFERENCE_KEY ) ;
@@ -318,6 +320,7 @@ export class NotebookEditor extends EditorPane implements INotebookEditorPane {
318
320
}
319
321
320
322
this . _handlePerfMark ( perf , input ) ;
323
+ this . _handlePromptRecommendations ( model . notebook ) ;
321
324
} catch ( e ) {
322
325
this . logService . warn ( 'NotebookEditorWidget#setInput failed' , e ) ;
323
326
if ( isEditorOpenError ( e ) ) {
@@ -425,6 +428,24 @@ export class NotebookEditor extends EditorPane implements INotebookEditorPane {
425
428
} ) ;
426
429
}
427
430
431
+ private _handlePromptRecommendations ( model : NotebookTextModel ) {
432
+ this . _notebookEditorWorkerService . canPromptRecommendation ( model . uri ) . then ( shouldPrompt => {
433
+ type WorkbenchNotebookShouldPromptRecommendationClassification = {
434
+ owner : 'rebornix' ;
435
+ comment : 'The notebook file metrics. Used to get a better understanding of if we should prompt for notebook extension recommendations' ;
436
+ shouldPrompt : { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; comment : 'Should we prompt for notebook extension recommendations' } ;
437
+ } ;
438
+
439
+ type WorkbenchNotebookShouldPromptRecommendationEvent = {
440
+ shouldPrompt : boolean ;
441
+ } ;
442
+
443
+ this . telemetryService . publicLog2 < WorkbenchNotebookShouldPromptRecommendationEvent , WorkbenchNotebookShouldPromptRecommendationClassification > ( 'notebook/shouldPromptRecommendation' , {
444
+ shouldPrompt : shouldPrompt
445
+ } ) ;
446
+ } ) ;
447
+ }
448
+
428
449
override clearInput ( ) : void {
429
450
this . _inputListener . clear ( ) ;
430
451
0 commit comments