11import {
22 JupyterFrontEnd ,
33 JupyterFrontEndPlugin
4- } from " @jupyterlab/application" ;
4+ } from ' @jupyterlab/application' ;
55
6- import { PathExt } from " @jupyterlab/coreutils" ;
6+ import { PathExt } from ' @jupyterlab/coreutils' ;
77
8- import { IMainMenu } from " @jupyterlab/mainmenu" ;
8+ import { IMainMenu } from ' @jupyterlab/mainmenu' ;
99
10- import { INotebookTracker , NotebookActions } from " @jupyterlab/notebook" ;
10+ import { INotebookTracker , NotebookActions } from ' @jupyterlab/notebook' ;
1111
1212import { CommandRegistry } from '@lumino/commands' ;
1313
@@ -16,16 +16,16 @@ import {
1616 pythonIcon ,
1717 terminalIcon ,
1818 textEditorIcon ,
19- folderIcon ,
19+ folderIcon
2020} from '@jupyterlab/ui-components' ;
2121
22- import { listSnippets , Snippet , fetchSnippet } from " ./snippets" ;
22+ import { listSnippets , Snippet , fetchSnippet } from ' ./snippets' ;
2323
2424/**
2525 * The command IDs used by the snippets plugin.
2626 */
2727namespace CommandIDs {
28- export const open = " snippets:open" ;
28+ export const open = ' snippets:open' ;
2929}
3030
3131/**
@@ -46,7 +46,7 @@ function toTree(snippets: Snippet[]) {
4646 node . set ( part , new Map < string , Tree > ( ) ) ;
4747 }
4848 node = node . get ( part ) ;
49- } )
49+ } ) ;
5050 } ) ;
5151 return tree ;
5252}
@@ -57,7 +57,11 @@ function toTree(snippets: Snippet[]) {
5757 * @param tree The tree of snippets.
5858 * @param path The current path in the tree.
5959 */
60- function createMenu ( commands : CommandRegistry , tree : Tree , path : string [ ] = [ ] ) {
60+ function createMenu (
61+ commands : CommandRegistry ,
62+ tree : Tree ,
63+ path : string [ ] = [ ]
64+ ) {
6165 const menu = new MenuSvg ( { commands } ) ;
6266 for ( const [ name , map ] of tree . entries ( ) ) {
6367 const fullpath = path . concat ( name ) ;
@@ -70,7 +74,7 @@ function createMenu(commands: CommandRegistry , tree: Tree, path: string[] = [])
7074 const submenu = createMenu ( commands , map , path . concat ( name ) ) ;
7175 submenu . title . label = name ;
7276 submenu . title . icon = folderIcon ;
73- menu . addItem ( { type : 'submenu' , submenu} ) ;
77+ menu . addItem ( { type : 'submenu' , submenu } ) ;
7478 }
7579 }
7680 return menu ;
@@ -80,7 +84,7 @@ function createMenu(commands: CommandRegistry , tree: Tree, path: string[] = [])
8084 * Initialization data for the jupyterlab-snippets extension.
8185 */
8286const extension : JupyterFrontEndPlugin < void > = {
83- id : " jupyterlab-snippets" ,
87+ id : ' jupyterlab-snippets' ,
8488 autoStart : true ,
8589 optional : [ IMainMenu , INotebookTracker ] ,
8690 activate : async (
@@ -95,7 +99,7 @@ const extension: JupyterFrontEndPlugin<void> = {
9599 notebookTracker ?. currentWidget !== null &&
96100 notebookTracker ?. currentWidget === app . shell . currentWidget
97101 ) ;
98- }
102+ } ;
99103
100104 commands . addCommand ( CommandIDs . open , {
101105 label : args => args [ 'label' ] as string ,
0 commit comments