@@ -24,7 +24,10 @@ import { ISettingRegistry } from '@jupyterlab/settingregistry';
24
24
25
25
import { IRunningSessionManagers , RunningSessions } from '@jupyterlab/running' ;
26
26
27
- import { ISettingEditorTracker } from '@jupyterlab/settingeditor' ;
27
+ import {
28
+ IJSONSettingEditorTracker ,
29
+ ISettingEditorTracker ,
30
+ } from '@jupyterlab/settingeditor' ;
28
31
29
32
import { ITranslator } from '@jupyterlab/translation' ;
30
33
@@ -205,7 +208,11 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
205
208
ISettingRegistry ,
206
209
IToolbarWidgetRegistry ,
207
210
] ,
208
- optional : [ IRunningSessionManagers , ISettingEditorTracker ] ,
211
+ optional : [
212
+ IRunningSessionManagers ,
213
+ ISettingEditorTracker ,
214
+ IJSONSettingEditorTracker ,
215
+ ] ,
209
216
autoStart : true ,
210
217
provides : INotebookTree ,
211
218
activate : (
@@ -215,7 +222,8 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
215
222
settingRegistry : ISettingRegistry ,
216
223
toolbarRegistry : IToolbarWidgetRegistry ,
217
224
manager : IRunningSessionManagers | null ,
218
- settingEditorTracker : ISettingEditorTracker | null
225
+ settingEditorTracker : ISettingEditorTracker | null ,
226
+ jsonSettingEditorTracker : IJSONSettingEditorTracker | null
219
227
) : INotebookTree => {
220
228
const nbTreeWidget = new NotebookTreeWidget ( ) ;
221
229
@@ -301,13 +309,18 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
301
309
302
310
app . shell . add ( nbTreeWidget , 'main' , { rank : 100 } ) ;
303
311
304
- if ( settingEditorTracker ) {
305
- settingEditorTracker . widgetAdded . connect ( ( _ , editor ) => {
306
- nbTreeWidget . addWidget ( editor ) ;
307
- nbTreeWidget . tabBar . addTab ( editor . title ) ;
308
- nbTreeWidget . currentWidget = editor ;
309
- } ) ;
310
- }
312
+ // add a separate tab for each setting editor
313
+ [ settingEditorTracker , jsonSettingEditorTracker ] . forEach (
314
+ ( editorTracker ) => {
315
+ if ( editorTracker ) {
316
+ editorTracker . widgetAdded . connect ( ( _ , editor ) => {
317
+ nbTreeWidget . addWidget ( editor ) ;
318
+ nbTreeWidget . tabBar . addTab ( editor . title ) ;
319
+ nbTreeWidget . currentWidget = editor ;
320
+ } ) ;
321
+ }
322
+ }
323
+ ) ;
311
324
312
325
return nbTreeWidget ;
313
326
} ,
0 commit comments