1
1
import {
2
2
JupyterFrontEnd ,
3
3
JupyterFrontEndPlugin
4
- } from " @jupyterlab/application" ;
4
+ } from ' @jupyterlab/application' ;
5
5
6
- import { PathExt } from " @jupyterlab/coreutils" ;
6
+ import { PathExt } from ' @jupyterlab/coreutils' ;
7
7
8
- import { IMainMenu } from " @jupyterlab/mainmenu" ;
8
+ import { IMainMenu } from ' @jupyterlab/mainmenu' ;
9
9
10
- import { INotebookTracker , NotebookActions } from " @jupyterlab/notebook" ;
10
+ import { INotebookTracker , NotebookActions } from ' @jupyterlab/notebook' ;
11
11
12
12
import { CommandRegistry } from '@lumino/commands' ;
13
13
@@ -16,16 +16,16 @@ import {
16
16
pythonIcon ,
17
17
terminalIcon ,
18
18
textEditorIcon ,
19
- folderIcon ,
19
+ folderIcon
20
20
} from '@jupyterlab/ui-components' ;
21
21
22
- import { listSnippets , Snippet , fetchSnippet } from " ./snippets" ;
22
+ import { listSnippets , Snippet , fetchSnippet } from ' ./snippets' ;
23
23
24
24
/**
25
25
* The command IDs used by the snippets plugin.
26
26
*/
27
27
namespace CommandIDs {
28
- export const open = " snippets:open" ;
28
+ export const open = ' snippets:open' ;
29
29
}
30
30
31
31
/**
@@ -46,7 +46,7 @@ function toTree(snippets: Snippet[]) {
46
46
node . set ( part , new Map < string , Tree > ( ) ) ;
47
47
}
48
48
node = node . get ( part ) ;
49
- } )
49
+ } ) ;
50
50
} ) ;
51
51
return tree ;
52
52
}
@@ -57,7 +57,11 @@ function toTree(snippets: Snippet[]) {
57
57
* @param tree The tree of snippets.
58
58
* @param path The current path in the tree.
59
59
*/
60
- function createMenu ( commands : CommandRegistry , tree : Tree , path : string [ ] = [ ] ) {
60
+ function createMenu (
61
+ commands : CommandRegistry ,
62
+ tree : Tree ,
63
+ path : string [ ] = [ ]
64
+ ) {
61
65
const menu = new MenuSvg ( { commands } ) ;
62
66
for ( const [ name , map ] of tree . entries ( ) ) {
63
67
const fullpath = path . concat ( name ) ;
@@ -70,7 +74,7 @@ function createMenu(commands: CommandRegistry , tree: Tree, path: string[] = [])
70
74
const submenu = createMenu ( commands , map , path . concat ( name ) ) ;
71
75
submenu . title . label = name ;
72
76
submenu . title . icon = folderIcon ;
73
- menu . addItem ( { type : 'submenu' , submenu} ) ;
77
+ menu . addItem ( { type : 'submenu' , submenu } ) ;
74
78
}
75
79
}
76
80
return menu ;
@@ -80,7 +84,7 @@ function createMenu(commands: CommandRegistry , tree: Tree, path: string[] = [])
80
84
* Initialization data for the jupyterlab-snippets extension.
81
85
*/
82
86
const extension : JupyterFrontEndPlugin < void > = {
83
- id : " jupyterlab-snippets" ,
87
+ id : ' jupyterlab-snippets' ,
84
88
autoStart : true ,
85
89
optional : [ IMainMenu , INotebookTracker ] ,
86
90
activate : async (
@@ -95,7 +99,7 @@ const extension: JupyterFrontEndPlugin<void> = {
95
99
notebookTracker ?. currentWidget !== null &&
96
100
notebookTracker ?. currentWidget === app . shell . currentWidget
97
101
) ;
98
- }
102
+ } ;
99
103
100
104
commands . addCommand ( CommandIDs . open , {
101
105
label : args => args [ 'label' ] as string ,
0 commit comments