@@ -24,7 +24,10 @@ import { ISettingRegistry } from '@jupyterlab/settingregistry';
2424
2525import { IRunningSessionManagers , RunningSessions } from '@jupyterlab/running' ;
2626
27- import { ISettingEditorTracker } from '@jupyterlab/settingeditor' ;
27+ import {
28+ IJSONSettingEditorTracker ,
29+ ISettingEditorTracker ,
30+ } from '@jupyterlab/settingeditor' ;
2831
2932import { ITranslator } from '@jupyterlab/translation' ;
3033
@@ -205,7 +208,11 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
205208 ISettingRegistry ,
206209 IToolbarWidgetRegistry ,
207210 ] ,
208- optional : [ IRunningSessionManagers , ISettingEditorTracker ] ,
211+ optional : [
212+ IRunningSessionManagers ,
213+ ISettingEditorTracker ,
214+ IJSONSettingEditorTracker ,
215+ ] ,
209216 autoStart : true ,
210217 provides : INotebookTree ,
211218 activate : (
@@ -215,7 +222,8 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
215222 settingRegistry : ISettingRegistry ,
216223 toolbarRegistry : IToolbarWidgetRegistry ,
217224 manager : IRunningSessionManagers | null ,
218- settingEditorTracker : ISettingEditorTracker | null
225+ settingEditorTracker : ISettingEditorTracker | null ,
226+ jsonSettingEditorTracker : IJSONSettingEditorTracker | null
219227 ) : INotebookTree => {
220228 const nbTreeWidget = new NotebookTreeWidget ( ) ;
221229
@@ -301,13 +309,18 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
301309
302310 app . shell . add ( nbTreeWidget , 'main' , { rank : 100 } ) ;
303311
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+ ) ;
311324
312325 return nbTreeWidget ;
313326 } ,
0 commit comments